Trouble with OGC Workshop WFS Client Demo

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Fri Jan 18 07:40:59 PST 2008


Hi,

I'm getting the same error on my version.  I seem to remember something
about a path issue with a newer version of OGR, but I could be wrong.

Assefa: do you remember what the cause of this is?

..Tom


> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Scott Wittenburg
> Sent: 17 January, 2008 2:59 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] Trouble with 
> OGC Workshop WFS Client Demo
> 
> Hello All,
> 
> I'm new to mapserver, and I'm having trouble getting one of 
> the OGC Workshop demos to work.  Hopefully I'll include 
> enough support information here so that someone can help me 
> figure what I'm doing wrong.  
> If anything is missing, please ask and I'll provide any other 
> necessary details.  Thanks for taking the time to read this 
> problem description.
> 
> Ok, specifically, when I attempt to run the WFS client demo, 
> I get an error in my browser window which looks like this:
> 
> msDrawMap(): Image handling error. Failed to draw layer named 
> 'envirodat'. msOGRFileOpen(): OGR error. Open failed for OGR 
> connection 
> `/ms4w/tmp/ms_tmp/e80d38d9bdf59eada6d84cd0b21eb99e.tmp.gml'. 
> File not found or unsupported format.
> 
> The url that generated this error was:
> 
> http://localhost/cgi-bin/mapserv.exe?map=%2Fms4w%2Fapps%2Fms_o
> gc_workshop%2Fclient%2Fwfs%2Fdemo.map&layer=envirodat&layer=ri
> vers&layer=land_shallow_topo_2048&zoomsize=2&zoomdir=1&program
> =%2Fcgi-bin%2Fmapserv.exe&map_web=imagepath+%2Fms4w%2Ftmp%2Fms
> _tmp%2F+imageurl+%2Fms_tmp%2F
> 
> When I look in the directory "C:\ms4w\tmp\ms_tmp\", I see the 
> file in question and I've looked at it.  It appears to be 
> valid GML, though the cygwin "ls -lt" 
> command shows the file permissions as
> "-rwxrwx---".  Is this a problem (not world readable)?  
> The "C:\ms4w\tmp\ms_tmp\" directory permissions are even more 
> restrictive: "drwx------".  I've tried opening up all the 
> permissions on all these files and directories, but it didn't 
> seem to help.
> 
> Here are some system configuration details:
> 
> I'm running Windows XP, SP2.  I installed MS4W version 2.2.6 
> and the OGC Workshop version 1.0.8 into the recommended 
> location, "C:\" (root directory is "C:\ms4w\").  Everything 
> seemed to work fine, and several of the workshop demos worked 
> fine, but when I clicked on the WFS-Client demo link and then 
> clicked the "Initialize" button, I got the error message shown above.
> 
> I noticed a message in the archives that looked very similar 
> to this error, but the problem was actually an extra path 
> separator char getting put into the tmp file path.  Other 
> than that, I haven't really seen this problem addressed 
> anywhere, so most people obviously aren't seeing it.  One 
> thing I found that people have said could be a problem is the 
> version of OGR/GDAL used by mapserver.  I've used the 
> "C:\ms4w\tools\gdal-ogr\ogrinfo.exe
> program to look at the tmp gml file in question:
> 
> C:\ms4w\tools\gdal-ogr>ogrinfo.exe 
> C:\ms4w\tmp\ms_tmp\e80d38d9bdf59eada6d84cd0b21eb99e.tmp.gml
> 
> Had to open data source read-only.
> INFO: Open of 
> 'C:\ms4w\tmp\ms_tmp\e80d38d9bdf59eada6d84cd0b21eb99e.tmp.gml'
>            using driver 'GML' successfull.
> 1: envirodat
> 
> So that seems fine, doesn't it?  The MS4W 2.2.6 documentation 
> says it includes "GDAL/OGR 1.4.2 and Utilities", so that 
> seems fine too.
> 
> Here's the mapfile of the demo that caused the
> problem:
> 
> #
> # $Id: demo.map,v 1.2 2006/08/08 19:02:46 tkralidi Exp $ # # 
> Start of map file #
> 
> MAP
> 
>  # all temp files get prefixed with this string  NAME ms_ogc_workshop
> 
>  # always returns a map
>  STATUS ON
> 
>  # image format options
>  OUTPUTFORMAT
>   NAME png
>   DRIVER "GD/PNG"
>   MIMETYPE "image/png"
>   IMAGEMODE RGB
>   EXTENSION "png"
>  END
> 
>  # width / height of map image
>  SIZE 500 300
> 
>  # projection of the INTERFACE that this mapfile supports  PROJECTION
>   "init=epsg:4326"
>  END
> 
>  # minx miny maxx maxy
>  EXTENT -180 -90 180 90 # World
> 
>  # units of map/app
>  UNITS DD
> 
>  # def pointers for symbols
> 
>  SYMBOLSET "../../etc/symbols/symbols.sym"
>  FONTSET   "../../etc/fonts/fonts.txt"
> 
>  #
>  # Start of web interface definition
>  #
>  WEB
> 
>   TEMPLATE "../../templates/demo.html"
>   HEADER   "../../templates/query_header.html"
>   FOOTER   "../../templates/query_footer.html"
>   
>   # this is set in the form which initializes the page, but 
> can be set here if you want
>   IMAGEPATH "/ms4w/tmp/ms_tmp/"
> 
>   # this is set in the form which initializes the page, but 
> can be set here if you want
>   IMAGEURL "/ms_tmp/"
>  END
> 
>  #
>  # Start of reference map
>  #
>  REFERENCE
>   # which image is the base image for refmaps
>   # a area of interest box will be drawn on top of it
>   IMAGE ../../graphics/refmap_world_4326.gif
> 
>   # extents of ref image (minx miny maxx maxy)
>   EXTENT -180 -90 180 90
> 
>   # width / height of image
>   SIZE 150 75
> 
>   # always generated
>   STATUS ON
> 
>   COLOR -1 -1 -1
> 
>   # color of outline
>   OUTLINECOLOR 255 0 0
>  END
> 
>  #
>  # Start of legend
>  #
>  LEGEND
>   KEYSIZE 18 12
>   LABEL
>    TYPE BITMAP
>    SIZE MEDIUM
>    COLOR 0 0 89
>   END
>   TEMPLATE "../../templates/legend.html"
>   STATUS ON
>  END
> 
>  #
>  # Start of scalebar
>  #
>  SCALEBAR
>   IMAGECOLOR 255 0 0
>   LABEL
>    COLOR 0 0 0
>    SIZE tiny    
>   END
>   STYLE 1
>   SIZE 80 2
>   COLOR 0 0 0
>   UNITS KILOMETERS
>   INTERVALS 1
>   TRANSPARENT TRUE
>   STATUS TRUE
>  END
> 
>  # start of querymap object
>  QUERYMAP
>   SIZE 200 200
>   STATUS ON
>   STYLE HILITE
>   COLOR 255 0 0
>  END
> 
>  # start of layer definitions
> 
>  LAYER
>   # name of layer
>   NAME land_shallow_topo_2048
>   GROUP "RASTER"
>   
>   # projection: if the data is NOT in the same projection as 
> the global
>   # mapfile, you must explicitly give the native projection 
> code of the data
>   # some common projections:
>   # lat/long: epsg:4326
>   # NRCan LCC: epsg:42304
>   PROJECTION
>    "init=epsg:4326"
>   END
> 
>   # what type of data is this?
>   TYPE RASTER
> 
>   # always returned with interface
>   STATUS ON
> 
>   # actual data pointer
>   DATA ../../data/land_shallow_topo_2048.tif
>   
>   DUMP TRUE
>   
>   HEADER   "../../templates/land_shallow_topo_2048_query_header.html"
>   TEMPLATE "../../templates/land_shallow_topo_2048_query_body.html"
>   
>   TOLERANCE 5
>     
>  END
>  
>  LAYER
>   # name of layer
>   NAME rivers
>   GROUP "VECTOR"
>   
>   # projection: if the data is NOT in the same projection as 
> the global
>   # mapfile, you must explicitly give the native projection 
> code of the data
>   # some common projections:
>   # lat/long: epsg:4326
>   # NRCan LCC: epsg:42304
>   PROJECTION
>    "init=epsg:4326"
>   END
> 
>   # what type of data is this?
>   TYPE LINE
> 
>   # always returned with interface
>   STATUS ON
> 
>   # actual data pointer
>   DATA ../../data/rivers
> 
>   # data is queryable
>   DUMP TRUE
> 
>   # query templates for HTML-based queries
>   HEADER   ../../templates/rivers_query_header.html
>   TEMPLATE ../../templates/rivers_query_body.html
> 
>   TOLERANCE 5
> 
>   # how will this data look?
>   CLASS
>    NAME "Rivers"
>    COLOR 0 0 255
>   END
>  END
> 
>  LAYER
>   NAME envirodat
>   GROUP "VECTOR"
>   TYPE POINT
>   STATUS ON
>   # this is a remote OGC:WFS
>   CONNECTIONTYPE WFS
> 
>   # the server URL prefix
>   # MapServer will add the OGC:WMS specific
>   # keyword value pairs accordingly
>   #CONNECTION 
> "http://map.ns.ec.gc.ca/envdat/map.aspx?service=WFS&version=1.
> 0.0&request=GetFeature"
>   CONNECTION "http://map.ns.ec.gc.ca/envdat/map.aspx?"
> 
>   PROJECTION
>    "init=epsg:4326"
>   END
> 
>   # base info MapServer needs to know to generate the
>   # OGC:WFS GetFeature request
>   METADATA
> 
>    # MapServer default sends POST
>    # force to GET
>    
>    "wfs_request_method" "GET"
>    
>    # how long (in seconds) should MapServer use
>    # in issuing and receiving the data?
>    "wfs_connectiontimeout" "60"
> 
>    # which version of the OGC:WFS should MapServer communicate with
>    "wfs_version" "1.0.0"
> 
>    # service type for connection
>    # this info is a bit redundant
>    "wfs_service" "WFS"
> 
>    # what is the feature type you are querying
>    "wfs_typename" "envirodat"
> 
>    # what is the spatial extent?
>    "wfs_latlonboundingbox" "-64.6622 46.7594 -52.6808 55.2333"
>    #
>   END
>   #
>   # MapServer will then use this information to generate a 
> string like:
>   # 
> http://map.ns.ec.gc.ca/envdat/map.aspx?version=<wfs_version>&s
ervice=<wfs_service>&request=GetFeature&typename=<wfs_typename>
>   #
>   # missing required keyword value pairs get generated according
>   # to the application using this mapfile, i.e.:
>   # &bbox, &filter, etc.
> 
>   CLASS
>    NAME "Water Quality Monitoring Stations"
>    COLOR 255 255 0
>   END
>  END
> END
> 



More information about the MapServer-users mailing list