Remove SatelliteImage
class for reading sensor metadata in favor of a Raster
option
#628
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
SatelliteImage
class (child ofRaster
) and replaces it by aparse_sensor_metadata
argument (False
by default) andsilent
argument ofRaster.__init__
, as discussed in #532.All sensor metadata is saved in
Raster.tags
along other metadata, with practical datatypes when relevant (datetime, float). By necessity, thetags
metadata is written asstr
on disk, so this PR also adds a function that automatically "decodes'" sensor metadata to convert it back to its datatype.In short, the sensor metadata can be written/read from file consistently!
Additionally, this PR removes the old option of
Vector.reproject()
accepting astr
as reference (which is inconsistent with the rest of the package that never accepts strings as method input), as it sometimes triggered errors depending onfiona
/pyogrio
reading.We could add back this functionality consistently everywhere after solving #595, if desired.
Resolves #626
Resolves #532
TO-DO
parse_sensor_metadata
behaviour,tags
are conserved after writing to file and re-reading.