Changes between Initial Version and Version 1 of DODSExample1


Ignore:
Timestamp:
Jan 27, 2009, 3:34:14 PM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DODSExample1

    v1 v1  
     1= DODSExample1 =
     2
     3== DODS Example ==
     4
     5In this example we extract point data from a "nested sequence" server and plot it in mapserver.
     6
     7The server in question is http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp. If we look at the DDS definition (from http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp.dds) we see:
     8{{{
     9Dataset {
     10    Sequence {
     11        Float32 lat;
     12        Float32 lon;
     13        Float64 time;
     14        Int32 _id;
     15        Sequence {
     16            Float32 P_1;
     17            Float32 depth;
     18            Float32 T_20;
     19            Float32 S0_43;
     20            Float32 BO_61;
     21            Float32 pH_159;
     22            Float32 NO3_182;
     23            Float32 PO4_186;
     24            Float32 SI_188;
     25            Float32 TCO2_1751;
     26            Float32 PCO2_1755;
     27        } profile;
     28    } location;
     29} natl_prof_bot;
     30}}}
     31A default view of this dataset through OGR would be something like this:
     32{{{
     33warmerda@gdal2200[20]% ogrinfo -ro -al -so 'DODS:http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp'
     34INFO: Open of `DODS:http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp'
     35using driver `DODS' successful.
     36
     37Layer name: location
     38Geometry: Unknown (any)
     39Feature Count: 1000
     40Extent: (0.000000, 0.500000) - (0.000000, 58.080002)
     41Layer SRS WKT:
     42(unknown)
     43lat: Real (0.0)
     44lon: Real (0.0)
     45time: Real (0.0)
     46_id: Integer (0.0)
     47profile.P_1: RealList (0.0)
     48profile.depth: RealList (0.0)
     49profile.T_20: RealList (0.0)
     50profile.S0_43: RealList (0.0)
     51profile.BO_61: RealList (0.0)
     52profile.pH_159: RealList (0.0)
     53profile.NO3_182: RealList (0.0)
     54profile.PO4_186: RealList (0.0)
     55profile.SI_188: RealList (0.0)
     56profile.TCO2_1751: RealList (0.0)
     57profile.PCO2_1755: RealList (0.0)
     58}}}
     59You will note that the default action is to convert the subsequences into "list" attributes. These are of limited use in MapServer since filters and so forth don't work on OGR list type variables. The DODS url is converted into a form usable by OGR by prepending "DODS:" to it.
     60
     61For plotting the points we don't need much. Just the lat, and lon. We use the DODS "projection" concept to request only the fields we are interested in. This will dramatically reduce the amount of data that the DODS server needs to return to mapserver. In this case we might use the following OGR datasetname:
     62{{{
     63ogrinfo -ro -al 'DODS:http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp?lat,lon'
     64INFO: Open of `DODS:http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cd
     65p?lat,lon'
     66using driver `DODS' successful.
     67
     68Layer name: location
     69Geometry: Unknown (any)
     70Feature Count: 1000
     71Extent: (0.000000, 0.500000) - (0.000000, 58.080002)
     72Layer SRS WKT:
     73(unknown)
     74lat: Real (0.0)
     75lon: Real (0.0)
     76OGRFeature(location):0
     77  lat (Real) = 0.5
     78  lon (Real) = 0
     79  POINT (0.00000000 0.50000000)
     80...
     81}}}
     82To minimally plot the data, we might use a .map file like:
     83{{{
     84MAP
     85NAME  "test"
     86SIZE  400 400
     87EXTENT  -30 0 30 60
     88
     89PROJECTION
     90"proj=latlong"
     91END
     92
     93SYMBOL
     94  NAME "cross"
     95  TYPE vector
     96  POINTS
     97    2 0
     98    2 4
     99    -99 -99
     100    0 2
     101    4 2
     102  END
     103END
     104
     105LAYER
     106  NAME  "test"
     107  TYPE POINT
     108  CONNECTIONTYPE OGR
     109  CONNECTION 'DODS:http://www.epic.noaa.gov:10100/dods/wod2001/natl_prof_bot.cdp?lat,lon'
     110  DATA 'location'
     111  STATUS  default
     112  CLASS
     113    COLOR 255 255 0
     114    SYMBOL 'cross'
     115    SIZE 8
     116  END
     117END
     118
     119END
     120}}}
     121As per normal OGR usage, the datset name is the CONNECTION string, and the layer name is in the DATA statement. In this case symbol yellow cross symbols are used to plot the points.