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

Wrong ODC query when CRS is specified #4

Open
pierocampa opened this issue Jul 15, 2022 · 1 comment
Open

Wrong ODC query when CRS is specified #4

pierocampa opened this issue Jul 15, 2022 · 1 comment

Comments

@pierocampa
Copy link
Member

pierocampa commented Jul 15, 2022

When crafting the ODC query for the case of a non-default CRS:

            if self.crs is not None:
                query['crs']  = 'epsg:' + str(self.crs)
                query['x']  = (self.south,self.north)
                query['y'] = (self.east,self.west)
                query['output_crs'] = 'epsg:' + str(self.crs)
                query['resolution'] = [10,10]

(odc_wrapper.py)

There are imho 2 issues:

  • x / y are wrongly assigned, they should be flipped!
  • the resolution should be removed in order to keep the datacube's original one (in case of projected CRS, usually the uom of axis is meters, so the query seems to aggressively upsample the output data to a 10x10 m resolution, whereas in case of geographic CRS the output is downsampled to 10x10 degrees, whole continents in one pixel)

Note that the arbitrary 10x10 resolution is set also in the handling of the exception: Product has no default CRS. Must specify 'output_crs' and 'resolution'.

@clausmichele
Copy link
Member

Sorry for not addressing this issue for long time. Going in order:

  • The inversion is fixed now 63155cc
  • The issue comes from a single collection that we host at Eurac, the Sentinel-2 over the Alps. This collection is a composition of all UTM S2 tiles covering the Alps with different projections. OpenDataCube does not allow to fix a resolution for a collection/product if we do not specify the output CRS as well. So currently it automatically detects the CRS for the required area, but not the resolution. I don't see many solutions here at the moment, maybe we could consider retrieving the resolution info from the STAC metadata.
  • I have to investigate about the WGS84 cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants