datacube-core icon indicating copy to clipboard operation
datacube-core copied to clipboard

Extent extraction is broken for datasets using Geographic CRSs

Open Kirill888 opened this issue 7 years ago • 6 comments

Expected behaviour

Should be able to define Dataset grid_spatial with Geographic CRS, like EPSG:4326 using latitude/longitude keys instead of y,x for for geo_ref_points construct:

'grid_spatial': {'projection': {
'spatial_reference': 'EPSG:4326',
'geo_ref_points': {
    'll': {'latitude': 3.9118399999999993, 'longitude': -71.8432},
    'lr': {'latitude': 3.9118399999999993, 'longitude': -70.84252},
    'ul': {'latitude': 4.912519999999999, 'longitude': -71.8432},
    'ur': {'latitude': 4.912519999999999, 'longitude': -70.84252}},
   }}

Actual behaviour

Fails with KeyError in here:

https://github.com/opendatacube/datacube-core/blob/a82de5c031d711043b5dedbb09b609de0d544a4f/datacube/model/init.py#L273-L274

Kirill888 avatar Sep 17 '18 23:09 Kirill888

I think the original intention was that grid_spatial -> projection is always a projected coordinate system. It would be grid_spatial -> <something else> for non projected bounds.

That said, it's still a problem that needs fixing, whether by documenting and enabling the format you've described, or some more comprehensive overhaul of the entire grid_spatial subtree.

omad avatar Sep 18 '18 04:09 omad

At the very least we should detect absence of expected keys and generate descriptive exception.

But we should probably just abandon the whole 4 corner system, and supply envelope or valid polygon.

Kirill888 avatar Sep 18 '18 04:09 Kirill888

Related issue and an annoying discrepancy is #556 when working with EPSG:4326.

Have to use lat|lon names in your product spec, but y,x in your dataset yaml :nauseated_face:

Kirill888 avatar Oct 16 '19 22:10 Kirill888

make it latitude|longitude not lat|lon

Kirill888 avatar Oct 17 '19 03:10 Kirill888

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 08 '20 06:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 08 '21 04:05 stale[bot]

According to @SpacemanPaul , this information is created internally within Core code, is isn't written within dataset documents.

While there is some potential for confusion, with everything being named with x, y, it would make the internal code more complex for no particular gain.

omad avatar May 18 '23 03:05 omad