gdal can open DAP datasets using DAP2 but only recognizes 2d Arrays and Grids - CEs fail. Fix

Description

A plain URL to a dataset with a grid works (it’s actually an Array)

{code}

edamame:gdal jimg$ gdalinfo http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5

Driver: DODS/DAP 3.x servers

Files: none associated

Size is 4, 8

Corner Coordinates:

Upper Left ( 0.0, 0.0)

Lower Left ( 0.0, 8.0)

Upper Right ( 4.0, 0.0)

Lower Right ( 4.0, 8.0)

Center ( 2.0, 4.0)

Band 1 Block=4x8 Type=Float32, ColorInterp=Undefined

{code}

And a simple CE works too

{code}

edamame:gdal jimg$ gdalinfo http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature

Driver: DODS/DAP 3.x servers

Files: none associated

Size is 4, 8

Corner Coordinates:

Upper Left ( 0.0, 0.0)

Lower Left ( 0.0, 8.0)

Upper Right ( 4.0, 0.0)

Lower Right ( 4.0, 8.0)

Center ( 2.0, 4.0)

Band 1 Block=4x8 Type=Float32, ColorInterp=Undefined

{code}

But various attempts at providing a CE with []s fails:

{code}

edamame:gdal jimg$ gdalinfo http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[*][*]

ERROR 1: An error occurred while creating a virtual connection to the DAP server: Missing [x] or [y] in constraint.

gdalinfo failed - unable to open 'http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[*][*]'.

edamame:gdal jimg$ gdalinfo http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[][]

ERROR 1: An error occurred while creating a virtual connection to the DAP server: Missing [x] or [y] in constraint.

gdalinfo failed - unable to open 'http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[][]'.

edamame:gdal jimg$ gdalinfo http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[0:3][0:7]

ERROR 1: An error occurred while creating a virtual connection to the DAP server: Missing [x] or [y] in constraint.

gdalinfo failed - unable to open 'http://test.opendap.org/opendap/data/hdf5/grid_1_2d.h5?temperature[0:3][0:7]'.

edamame:gdal jimg$

{code}

 

This matters because for 3+ dimensioned Arrays and Grids (e.g., Coads Climatology) cannot be sliced to 2d and thus don’t open. Fix the CE processing.

 

Here’s the code we need to modify:

This needs to build two strings, one that’s a list of var names and one that’s the full CE. If we assume that the list is names or names with []s, then it should be possible to parse the resulting CE into a list of names only.

Alternative: We can send the CE to request_dds and then process all the variables in the returned DDS response.

 

Status

Assignee

James Gallagher

Reporter

James Gallagher

Priority

Medium

Labels

None

Story Points

5

Fix versions

None
Configure