Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
geoarray
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Daniel Scheffler
  • geoarray
  • Issues
  • #18

Closed
Open
Created Sep 13, 2018 by Daniel Scheffler@danschefMaintainer

[ValueError: GeoArray.metadata can only be set]: in case the GeoArray instance has only 1 row/column/band or only 1 row/colum/band is requested

This only happens in case an array dimension has only one element or a single row/column/band is requested:

im = GeoArray('/home/gfz-fe/scheffler/temp/Landsat-8__OLI_TIRS__LC81940242014072LGN00_L2B.bsq')
sub = im.get_subset(xslice=slice(0, 1))
OUT:
ValueError                                Traceback (most recent call last)
<ipython-input-133-c683229ddcbd> in <module>()
      1 im = GeoArray('/home/gfz-fe/scheffler/temp/Landsat-8__OLI_TIRS__LC81940242014072LGN00_L2B.bsq')
----> 2 sub = im.get_subset(xslice=slice(0, 1))
      3 sub.shape

~/scheffler/python/geoarray/geoarray/baseclasses.py in get_subset(self, xslice, yslice, zslice, return_GeoArray, reset_bandnames)
   1541 
   1542         sub_gA.gt = sub_gt
-> 1543         sub_gA.metadata = _meta_out
   1544         sub_gA.bandnames = bNs_out
   1545         sub_gA.filePath = self.filePath

~/scheffler/python/geoarray/geoarray/baseclasses.py in metadata(self, meta)
    517             raise ValueError("%s.metadata can only be set with an instance of geoarray.metadata.GDAL_Metadata of "
    518                              "which the band number corresponds to the band number of %s."
--> 519                              % (self.__class__.__name__, self.__class__.__name__))
    520         self._metadata = meta
    521 

ValueError: GeoArray.metadata can only be set with an instance of geoarray.metadata.GDAL_Metadata of which the band number corresponds to the band number of GeoArray.
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None