[mapserver-users] WMS-T support for vector data using OGR

Even Rouault even.rouault at mines-paris.org
Mon Jun 9 12:34:02 PDT 2014


Le lundi 09 juin 2014 21:15:05, Hari Pradhan a écrit :
> Hello List,
> 
> I have been trying to implement MapServer WMS -T using tile index. But I am
> not able to make it work. I made some changes to the mapfile defined for
> "WMS-T for raster imagery" in the link
> "http://mapserver.org/ogc/wms_time.html" to make it work for vector data
> and followed the post in the link "
> http://osgeo-org.1560.x6.nabble.com/WMS-WFS-and-yearly-time-dependent-data-
> td4275270.html", but it didn't fix it out.
> 
> The thing that I did:
> 1. I had a set of vector shape file captured at different time frame. Say
> v1.shp, v2.shp,...
> 2. I used ogrtindex to generate a tileindex (say 'VectorLayer2.shp) for
> above shape files. The dbf file of this tileindex has 'location' attribute.
> 3. I ran my script to add 'Time' field to this tileindex such that the
> final dbf file has two fields as location and Time.
>    My dfb file looks like:
>         LOCATION                                        Time
>        C:\data\tif\VectorLayer\SiteAddress_1.shp,0    20070301
>        C:\data\tif\VectorLayer\SiteAddress_2.shp,0    20070302
> 
> 4. Then finally I wrote the map file with layer section as:
> 
> LAYER
>     NAME "states"
>         DEBUG 5
>         CONNECTIONTYPE OGR
>         TILEINDEX "VectorLayer2.shp"
>         TILEITEM "Location"
>         TYPE POLYGON
>     STATUS ON
> 
>     METADATA
>       "wms_title"    "states"
>           "wms_include_items"   "all"
>           "wms_dataurl_format" "text/HTML"
>       "ows_include_items"     "all"
>       "wms_exceptions_format" "application/vnd.ogc.se_xml"
>           'wms_srs'             'EPSG:42304'
>           "wms_timeextent" "20070301/20070302"
>           "wms_timeitem" "Time"
>           "wms_timedefault" "20070302"
>     END
>         FILTER "Time = '20070302'"
>                 PROJECTION
>       "init=epsg:42304"
>     END
>                 CLASS
>       NAME       "The Upper Great Lakes States"
>       STYLE
>         COLOR        232 232 232
>         OUTLINECOLOR 32 32 32
>       END
>     END
>   END
> 
> By doing this, I got the following error.
> msOGRLayerInitItemInfo(): OGR error. Invalid Field name: Time".
> 
> Could anyone please help me to resolve this problem?

Hum, I'm wondering if FILTER "Time = '200070302'" doesn't apply to the 
shapefile referenced by the tileindex, instead of the tileindex itself. Perhaps 
you could try to remove it ?

Also you could try to seperate a layer with the tileindex itself and the 
vector layer using it, as in the example in 
http://www.mapserver.org/ogc/wms_time.html

> 
> Thanks in advance.
> 
> Thanks

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the mapserver-users mailing list