opendatacube / datacube-core

Open Data Cube analyses continental scale Earth Observation data through time
http://www.opendatacube.org
Apache License 2.0
514 stars 177 forks source link

Availability of different CRS #503

Closed jankovicgd closed 6 years ago

jankovicgd commented 6 years ago

Will further CRS be implemented e.g. Azimuthal Equidistant? If not soon, could it be implemented just by adding the functions and filling in CRS_PARAM_WRITERS as in the pattern at:

https://github.com/opendatacube/datacube-core/blob/0e4fe679dd7b72c7cb35ae3e32ce94bcb8b22de8/datacube/storage/netcdf_writer.py#L170-L188

Or is there more to it than that?

WKT submitted

PROJCS["Azimuthal_Equidistant",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Azimuthal_Equidistant"],PARAMETER["false_easting",5837287.81977],PARAMETER["false_northing",2121415.69617],PARAMETER["central_meridian",24.0],PARAMETER["latitude_of_origin",53.0],UNIT["Meter",1.0]]

Error

Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/executor.py", line 151, in _run_cloud_pickled_function
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/scripts/ingest.py", line 250, in ingest_work
    storage_config=config['storage'])
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/drivers/netcdf/driver.py", line 53, in write_dataset_to_storage
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/storage/storage.py", line 636, in write_dataset_to_netcdf
    netcdfparams)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/storage/storage.py", line 588, in create_netcdf_storage_unit
    netcdf_writer.create_grid_mapping_variable(nco, crs)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/storage/netcdf_writer.py", line 228, in create_grid_mapping_variable
    crs_var = _create_projected_grid_mapping_variable(nco, crs)
  File "/usr/local/lib/python3.5/dist-packages/datacube-1.6rc2+2.g6aa9d16.dirty-py3.5.egg/datacube/storage/netcdf_writer.py", line 194, in _create_projected_grid_mapping_variable
    raise ValueError('{} CRS is not supported'.format(grid_mapping_name))
ValueError: azimuthal_equidistant CRS is not supported

Environment information

omad commented 6 years ago

Hi @jankovicgd , for writing to NetCDF that's all that would be needed. We simply haven't had to use that projection.

We're following the NetCDF CF conventions, see http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#azimuthal-equidistant for the specification for Azimuthal Equidistant.

jankovicgd commented 6 years ago

Thanks for the info. I've managed to do it without errors regarding CRS, but there seem to be some new errors. I'll see if I can solve them otherwise I might open a new issue