wiki:DODSExample3

DODSExample3

DODS Example 3 - Grid Access

This example is built against the Aggregation server at:

http://opendap.aviso.oceanobs.com/dodsC/en/h/msla_oer_en_err

The key data item looks like this:

    Grid {
     ARRAY:
        Float32 Grid_0001[time = 51][NbLongitudes = 1080][NbLatitudes = 915];
     MAPS:
        Int32 time[time = 51];
        Float64 NbLongitudes[NbLongitudes = 1080];
        Float64 NbLatitudes[NbLatitudes = 915];
    } Grid_0001;

In order to make this accessable via the OGR linkage *with* spatial location for each data item, it is necessary to use an AIS file. This file is primarily used to define what fields to use for the latitude and longitudes:

Attributes {
    ogr_layer_info_1 {
	string layer_name Grid_0001;
	string spatial_ref WGS84;
	string target_container Grid_0001;
        x_field {
            string name NbLongitudes;
	    string scope dds;
        }
        y_field {
            string name NbLatitudes;
	    string scope dds;
        }
    }
}

Note that the actual data from the server is quite large, and currently mapserver cannot restrict the portion of the remote dataset requested based on the current spatial viewing region. If we don't restrict the range manually it will take quite a bit of time to fetch the full dataset (perhaps minutes). For restricted testing we can give an explicit subregion we want to access. For instance, with the above AIS info in place, we could do something like this to take only timeslice 1, for a small subarea:

ogrinfo -ro 'DODS:http://opendap.aviso.oceanobs.com/dodsC/en/h/msla_oer_en_err?Grid_0001[0][400:415][300:315]' -al
...

OGRFeature(Grid_0001):0
  time (Integer) = 19599
  NbLongitudes (Real) = 133.33333333332
  NbLatitudes (Real) = -46.34524017702091
  Grid_0001 (Real) = 36.46790313720703
  POINT (133.33333333 -46.34524018)

...
Last modified 14 years ago Last modified on Jan 27, 2009, 3:48:53 PM
Note: See TracWiki for help on using the wiki.