[mapserver-users] Extract raster point values with mapserver

William Hudspeth bhudspeth at edac.unm.edu
Sat Dec 13 12:14:39 PST 2014


Hello,

This is how Postgresql makes the data available. PostgresQL stores the 
information about the location of the geotiffs and the timestamp 
associated with them:

pm25_monthly=# \d pm25_monthly_global
                            Table "public.pm25_monthly_global"
   Column  |            Type             | Modifiers
----------+-----------------------------+-----------------------------------------------
  oid              | integer                                  | default 
nextval('pm25_monthly_seq'::regclass)
  rundate      | timestamp with time zone    |
  datetime    | timestamp with time zone    |
  location      | text                                        |
  timezone    | timestamp without time zone |
  the_geom   | geometry(MultiPolygon,4326) |
Indexes:
     "pm25_monthly_global_oid_key" UNIQUE CONSTRAINT, btree (oid)


The 'location' field simply gives the full path to the relevant geotiff 
on the file system. And, I define the index in the mapfile:


#*********************************************LAYER - TILE INDEX FOR 
PM2.5 RASTERS (Time sensitive) **********************************

LAYER
   STATUS ON
   NAME "pm25_time_index"
   TYPE POLYGON
   DATA "the_geom from pm25_monthly_global using unique oid using SRID=4326"
   METADATA
     "ows_title" "PM25 TIME INDEX"
     "ows_srs" "EPSG:4326"
     "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy]
     "wms_timeformat" "YYYY-MM-DDTHH:MM:SS"
     "wms_timeextent" "2011-01-01T00:00:00/2012-12-01T00:00:00"
     "wms_timeitem" "timezone"
     "wms_timedefault" "2011-01-01T00:00:00"
     wcs_resolution '0:10 0:10'
#    wcs_resolution '0.10 0.10'
   END

   #CONNECTION "user=wilbur dbname=pm25_monthly host=localhost 
password=iiiiiiiiii"
   #CONNECTIONTYPE postgis
   CONNECTIONTYPE POSTGIS
   CONNECTION "host=127.0.0.1 dbname=pm25_monthly user=wilbur 
password=EUR2_live port=5432"
   DATA "the_geom from pm25_monthly_global using unique oid using srid=4326"

END


#*********************************************LAYER - MONTHLY PM2.5 
(Time Sensitive)*********************************

#http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=pm25_monthly&STYLES=&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=1600&HEIGHT=800&FORMAT=image/png&SLD=http://localhost/pm25_mapserver/public_html/pm25_sld.xml&TIME=2011-09-01T00:00:00Z

LAYER
     NAME 'pm25_monthly'
     TYPE RASTER
     STATUS ON
     DEBUG OFF
     DUMP TRUE
     #TRANSPARENCY 50
     #FILTER ""

     METADATA
         "ows_keywordlist" 'PM2.5 (ug/m3), Global' #wms_keywordlist 
(Keywordlist)
         "ows_description" "Global monthly mean PM 2.5 (ug/m3)concentration"
         "ows_name" "Global monthly mean PM2.5 - Concentration Values 
(ug/m3)"
         "ows_label" "Global PM 2.5 (ug/m3)"
         "ows_srs" "EPSG:4326 EPSG:900913"
         "ows_extent" "-180 -90 180 90" #[minx][miny][maxx][maxy]
         "ows_formats" "GEOTIFF"
         "ows_nativeformat" "8-bit GeoTIF"
         "ows_timeitem" "timezone"
         "wms_onlineresource" 
"http://localhost/cgi-bin/mapserv?map=/var/www/pm25_mapserver/public_html/pm25_ogc_services.map"
         "wms_abstract" 'Global monthly mean PM 2.5 
(ug/m3)concentration'  #wms_abstract(Abstract)
         "wms_opaque" '0' #wms_opaque(layer)
         "wms_title" "Global monthly mean PM 2.5 (ug/m3)concentration"
         "ows_timeformat" "YYYY-MM-DDTHH:MM:SSZ"
         "ows_timeextent" "2011-01-01T00:00:00Z/2012-12-01T00:00:00Z"
         "ows_timedefault" "2011-01-01T00:00:00Z"
         "wms_enable_request" "*"

         "wcs_resolution" "0:10 0:10"
         #"wcs_resolution" "0.10 0.10"
         "wcs_bandcount" "1"
         "wcs_size" "3600 1800"

         layer_name pm25_monthly
     END   #METADATA

     PROJECTION
         "init=epsg:4326"     #WGS84 Decimal Degrees
     END  #PROJECTION

     TILEITEM "location"
     TILEINDEX "pm25_time_index"

END  #LAYER






Thanks


More information about the mapserver-users mailing list