Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SatelliteImage class for reading sensor metadata in favor of a Raster option #628

Merged
merged 12 commits into from
Nov 20, 2024

Conversation

rhugonnet
Copy link
Contributor

@rhugonnet rhugonnet commented Nov 17, 2024

This PR removes the SatelliteImage class (child of Raster) and replaces it by a parse_sensor_metadata argument (False by default) and silent argument of Raster.__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, the tags metadata is written as str 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 a str as reference (which is inconsistent with the rest of the package that never accepts strings as method input), as it sometimes triggered errors depending on fiona/pyogrio reading.
We could add back this functionality consistently everywhere after solving #595, if desired.

Resolves #626
Resolves #532

TO-DO

  • Add new tests for parse_sensor_metadata behaviour,
  • Test if tags are conserved after writing to file and re-reading.

@rhugonnet rhugonnet merged commit b39408f into GlacioHack:main Nov 20, 2024
16 checks passed
@rhugonnet rhugonnet deleted the remove_satimg_class branch November 20, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant