[mapserver-users] RE: Error with WFS request from MapInfo

Jelmer Baas baas at speerit.nl
Fri Aug 19 05:05:44 PDT 2011


Oh, wow, thanks to adding the wfs_extent and fixing a few other mistakes I found, I actually got it to work! 

Thanks a lot for the quick answers!

Regards,
Jelmer Baas


> -----Original Message-----
> From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
> Sent: vrijdag 19 augustus 2011 12:41
> To: Jelmer Baas; 'mapserver-users at lists.osgeo.org'
> Subject: Re: Error with WFS request from MapInfo
> 
> Hi,
> 
> You can also try to add this to LAYER
> wfs_extent
> 
>     Description: (Optional) Used for the layer's BoundingBox tag for cases
> where it is impossible (or very inefficient) for MapServer to probe the data
> source to figure its extents. The value for this metadata is "minx miny maxx
> maxy" separated by spaces, with the values in the layer's projection units. If
> wfs_extent is provided then it has priority and MapServer will NOT try to
> read the source file's extents.
> 
> And of course you should always be the boss and test with the basic hand
> written requests first before letting the GIS client to add for the complexity.
> Something like these:
> 
> http://myserver.xx/cgi-
> bin/mapserv.exe?service=wfs&version=1.0.0&request=getCapabilities&map
> =path/to/the/wfs.map
> http://myserver.xx/cgi-
> bin/mapserv.exe?service=wfs&version=1.0.0&request=DescribeFeatureTyp
> e&typeName=mytest&map=path/to/the/wfs.map
> http://myserver.xx/cgi-
> bin/mapserv.exe?service=wfs&version=1.0.0&request=GetFeature&typeNa
> me=mytest&maxFeatures=10&map=path/to/the/wfs.map
> 
> -Jukka Rahkonen-
> 
> > -----Alkuperäinen viesti-----
> > Lähettäjä: Jelmer Baas [mailto:baas at speerit.nl]
> > Lähetetty: 19. elokuuta 2011 12:45
> > Vastaanottaja: Rahkonen Jukka; 'mapserver-users at lists.osgeo.org'
> > Aihe: RE: Error with WFS request from MapInfo
> >
> > Jukka,
> >
> > Thanks for your pointers, I'll check out other WFS servers
> > and see how far I get. I did add the extent as EXTENT -180
> > -90 180 90 in the map file but that doesn't seem to change anything.
> >
> > Regards
> > Jelmer Baas
> >
> > > -----Original Message-----
> > > From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
> > > Sent: vrijdag 19 augustus 2011 11:05
> > > To: Jelmer Baas; 'mapserver-users at lists.osgeo.org'
> > > Subject: Re: Error with WFS request from MapInfo
> > >
> > > Hi,
> > >
> > > I would start by addind EXTENT to MAP level. WFS 1.0.0 does
> > not support
> > > reprojection so select the desired output srsName and use
> > that as map level
> > > PROJECTION. Express extents to suit that projection.
> > >
> > > Mapserver has been pretty poor WFS server for real GIS
> > clients but it is
> > > getting better. However, I cannot promise you any amazing
> > interoperability.
> > > At least I would recommend you to update to 6.0. If you
> > want to get some
> > > good feelings about WFS consider having a try with TinyOWS
> > first. It works
> > > only with PostGIS (v. 1.5 or higher) but that looks to be
> > OK for you. I have
> > > managed to read features from TinyOWS with Kosmo GIS,
> > gvSIG, QGis, uDig,
> > > ArcGIS, MapInfo, Gaia, SIS Map Browser and iGeoDesktop.
> > With some clients
> > > even attribute and spatial filters work. Come back to
> > Mapserver WFS later
> > > and start making bug reports. Glad that you learned already
> > to study the
> > > POST traffic, it is really a must with WFS debugging. I am
> > using Fiddler for that
> > > purpose.
> > >
> > > MapInfo seems to send a most basic WFS call (or stupid,
> > just orders the
> > > whole layer from you) so that should not be a trouble in
> > this case. Once you
> > > get the extents corrected you can continue and wait excited
> > if MapInfo will
> > > have troubles with checking the schemas and parsing the GML
> > that comes
> > > from Mapserver.
> > >
> > > -Jukka Rahkonen-
> > >
> > >
> > >
> > >
> > > > -----Alkuperäinen viesti-----
> > > > Lähettäjä: mapserver-users-bounces at lists.osgeo.org
> > > > [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta
> > Jelmer Baas
> > > > Lähetetty: 19. elokuuta 2011 11:26
> > > > Vastaanottaja: mapserver-users at lists.osgeo.org
> > > > Aihe: [mapserver-users] Error with WFS request from MapInfo
> > > >
> > > > Hello list,
> > > >
> > > > I've been struggling with this issue for a while, now. When I
> > > > try to add a WFS layer in MapInfo, I receive the following
> > > > error (from the mapserver logfile):
> > > > prepare_database(): Query error. Error declaring cursor:
> > > > ERROR:  BOX3D parser - couldnt parse.  It should look like:
> > > > BOX3D(xmin ymin zmin,xmax ymax zmax) or BOX3D(xmin ymin,xmax
> > > ymax)
> > > > LINE 1: ...:text from pandactueel WHERE geometrie &&
> > > > setSRID('BOX3D(-1....
> > > >                                                              ^
> > > >
> > > > With query string: DECLARE mycursor BINARY CURSOR FOR SELECT
> > > > asbinary(force_collection(force_2d(geo)),'NDR'),oid::text
> > > > from mytable WHERE geo && setSRID('BOX3D(-1.#INF
> > > > -1.#INF,1390604146415.56 -16080812.3872859)'::BOX3D, 28992 )
> > > >
> > > > The layer itself works, via normal GetMap requests.
> > > >
> > > > This is my mapfile:
> > > >
> > > > MAP
> > > > 	NAME TEST
> > > > 	STATUS ON
> > > > 	UNITS meters
> > > > 	FONTSET "fontset.txt"
> > > >   	DEBUG 5
> > > >   	CONFIG  "MS_ERRORFILE" "c:\temp\mapserver.log"
> > > >   	IMAGECOLOR 255 55 255
> > > > 	OUTPUTFORMAT
> > > > 		NAME aggpng24
> > > > 		DRIVER AGG/PNG
> > > > 		TRANSPARENT ON
> > > > 		IMAGEMODE RGBA
> > > > 		MIMETYPE "image/png"
> > > > 		EXTENSION "png"
> > > > 	END
> > > >
> > > >     WEB
> > > >       METADATA
> > > >         "wms_title" "TEST"
> > > >         "wfs_title" "TEST"
> > > >         "wms_srs" "epsg:4326 epsg:900913"
> > > >         "wfs_srs" "epsg:4326 epsg:900913"
> > > >         "wms_onlineresource" "***"
> > > >         "wfs_onlineresource" "***"
> > > >       END # METADATA
> > > >     END #web
> > > >
> > > >
> > > > 	SYMBOLSET "symbols_mapinfo2.sym"
> > > > 	PROJECTION
> > > > 		"init=epsg:4326"
> > > > 	END
> > > > 	LAYER
> > > > 		TYPE POLYGON
> > > > 		STATUS ON
> > > >     	DUMP TRUE
> > > >     	CONNECTIONTYPE POSTGIS
> > > >     	CONNECTION "host=localhost dbname=TEST user=postgres
> > > > password=*** port=5432"
> > > >     	DATA "geo from mytable using unique oid using
> > srid=28992"
> > > >     	NAME mytest
> > > > 	CLASS
> > > > 		NAME " mytest "
> > > >       		STYLE
> > > >         			COLOR 0 0 250
> > > >         			OUTLINECOLOR 0 250 0
> > > >       		END
> > > > 	END
> > > >     	PROJECTION
> > > >      		"init=epsg:28992"
> > > >    	 END
> > > > 	MINSCALE 1
> > > > 	MAXSCALE 80000000
> > > > 	METADATA
> > > > 		"wms_title" " mytest "
> > > > 		"wms_srs" "epsg:4326 epsg:900913"
> > > >       		"wfs_title" " mytest "
> > > > 		"wfs_srs" "epsg:4326 epsg:900913"
> > > >       		"gml_featureid" "oid"
> > > >       		"gml_include_items" "all"
> > > > 	END # METADATA
> > > > END
> > > > END # Map File
> > > >
> > > >
> > > > MapInfo sends its requests as post (I'd prefer get...) and
> > > > after using a packet sniffer I found out it sends this:
> > > > <?xml version="1.0" encoding="utf-8"?>
> > > > <GetFeature version="1.0.0" service="WFS" outputFormat="GML2"
> > > > xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
> > > > xmlns:gml="http://www.opengis.net/gml"
> > > > xmlns:ogc="http://www.opengis.net/ogc"
> > > > xmlns="http://www.opengis.net/wfs"
> > > > xsi:schemaLocation="http://www.opengis.net/wfs
> > > > ../wfs/1.0.0/WFS-basic.xsd"
> > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Query
> > > > typeName=" mytest"/></GetFeature>
> > > >
> > > > I use MapServer version 5.4.2, by the way.
> > > >
> > > > Can anyone tell me what I'm missing? Should I add extends in
> > > > the MapFile or something? And where do those weird numbers come
> > > from?
> > > >
> > > > Regards,
> > > > Jelmer Baas
> > > > Speer IT B.V.
> > > > _______________________________________________
> > > > mapserver-users mailing list
> > > > mapserver-users at lists.osgeo.org
> > > > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > > >
> >



More information about the MapServer-users mailing list