MapServer, PostGIS, and WFS

Christopher Condit condit at SDSC.EDU
Thu Dec 8 14:58:31 PST 2005


Hi All-

I've got a curious problem with MapServer 4.6 that I'm trying to use for
WMS and WFS.  If I query a shape file layer, everything runs fine.
However, when I attempt the same with a PostGIS layer, things don't go
so smoothly.  The WMS from PostGIS works fine - but the WFS yields
strange results.

When I query the server with:

http://localhost/mapserver/mapserv.exe?MAP=maps/tutorial/example1-5.map&
SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&typename=simpletest&BBOX=-9
0,0,-90,0

 

I get the following error:

XML Parsing Error: junk after document element

Location:
http://localhost/mapserver/mapserv.exe?MAP=maps/tutorial/example1-5.map&
SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&typename=simpletestBBOX=-90
,0,-90,0

Line Number 79, Column 1:msPOSTGISLayerRetrievePK: field length =
$imsPOSTGISLayerRetrievePK: field length = $imsPOSTGISLayerRetrievePK:
field length = $i

 

The data in PostGIS is loaded from the shapefile that _is_ working for
both WMS and WFS.  Is there another step I need to make WFS work with
PostGIS?

 

Thanks in advance...

 

Chris

 

Here's the LAYER definition from my Map file

LAYER

  NAME simpletest

  METADATA

    "wfs_title"    "SimpleWFSTest"

    "wfs_geometry_element_name" "the_geom"

  END

  TYPE POLYGON

  STATUS OFF

  EXTENT        -180 -90 180 90

  CONNECTIONTYPE POSTGIS

  CONNECTION "user=user dbname=shapecache password=blah"

  DATA "the_geom from test"

  CLASS

      COLOR        232 0 0

      OUTLINECOLOR 32 32 32

  END

  DUMP TRUE

  TRANSPARENCY 50   

  PROJECTION

    "init=epsg:4326"

  END

END

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051208/c378e31a/attachment.htm>


More information about the MapServer-users mailing list