appelmar / gdalcubes

Creating and analyzing Earth observation data cubes in R
https://gdalcubes.github.io
Other
120 stars 28 forks source link

Collection projection system in "proj:wkt2" attribute not supported #60

Closed SarahVal closed 2 years ago

SarahVal commented 2 years ago

Hi ! We encountered issues when loading a collection from a stac path, and for which the projection system is stored in WKT format, in the attribute"proj:wkt2":... (the attribute "proj:epsg" is null.) With this collection, it seems that the use of a new projection system in the function cube_view is not supported thus resulting in an incorrect cube cropping. Thanks for helping ! Sarah

appelmar commented 2 years ago

Thanks for the issue! I think it should work now if you install the package from GitHub, although I could not test. Please let me know if there are still problems.

appelmar commented 2 years ago

Is it a public STAC catalog that I can use for testing?

glaroc commented 2 years ago

There seems to be an issue with the way the functions are exported in the current version on Github. After installation:

> gdalcubes::stac_image_collection()
   Error: 'stac_image_collection' is not an exported object from 'namespace:gdalcubes'`
appelmar commented 2 years ago

Oops, sorry, NAMESPACE was broken, does it work now?

glaroc commented 2 years ago

Installation works and I believe the proj:wkt2 works as well!

appelmar commented 2 years ago

Thanks for checking, I'll close the issue for now. Feel free to re-open if anything does not work.

glaroc commented 1 year ago

@appelmar is it possible that extract_geom() won't work if the source raster data in the STAC collection that forms the cube has a projection defined with proj:wkt2 ? I'm trying to debug extraction from one of our datasets and I feel that this might be the issue.

appelmar commented 1 year ago

Sounds rather unlikely to me, can you share some more details (e.g. image collection file, scripts or debug output)?

glaroc commented 1 year ago

Upon further testing, I believe the issue was that the structure of that collection in our Stac catalog didn't fit with the expected structure of extract_geom(). I changed the order of operations and now it works with proj:wkt2 definition.

appelmar commented 1 year ago

OK, thanks for the update, there is a small chance that this is also related to the apostrophe issue (#70), if the WKT contains single quotes.