eoxserver
eoxserver copied to clipboard
Handling of NetCDF Data
Suggested code updates to support NetCDF data with multiple variables
When loading NetCDF files for rendering via mapserver, due to a limitation in GDAL, the following string is not supported:
NETCDF:<path-to-data>:<variable-name>:<index>
. This leads to issues when opening the data to access metadata as well as when rendering the data via WMS.
Instead, we are able to extract the desired index from the NetCDF by using gdal.translate
and save this as a temporary file which can then be used when rendering the data onto the map. This avoids relying on the gdal.Open
call which does not offer the same functionality for NetCDF as it does for ZARR data formats, i.e. index is not supported.
The same issue has been addressed when opening the NetCDF data to determine its size, here we don't need a temporary file, as simply using the call NETCDF:<path-to-data>:<variable-name>
is sufficient to extract the correct 2D size of the data.
This PR helps to resolve the issue captured under issue #569.