[Mapserver-users] need help with WFS

Gregor Mosheh stigmata at blackangel.net
Tue Jun 1 11:36:39 PDT 2004


I'm trying to get WFS server and client support to work, but am having a
difficult time with it. Unlike the WMS client howto, the WFS one is rather
terse so I'm not sure where to begin troubleshooting it.

When I zoom in far enough to include the WFS layer (street data, maxscale
75000) I get this error:

msDrawMap(): Image handling error. Failed to draw layer named 'streets'.
msWFSLayerWhichShapes(): WFS connection error. WFS request produced
unexpected output (junk?) for layer streets.

Okay, junk output. According to the httpd log, it sent this request:

POST
/mapserv?REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=streets
HTTP/1.1

So I gave it a try manually:

GET /mapserv?REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=streets
HTTP/1.0

And got this:

<?xml version='1.0' encoding="ISO-8859-1" ?>
<wfs:FeatureCollection
   xmlns="http://www.ttt.org/myns"
   xmlns:myns="http://www.ttt.org/myns"
   xmlns:wfs="http://www.opengis.net/wfs"
   xmlns:gml="http://www.opengis.net/gml"
   xmlns:ogc="http://www.opengis.net/ogc"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs
../wfs/1.0.0/WFS-basic.xsd
                       http://www.ttt.org/myns
http://wms.hostgis.com:800/mapserv?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=streets">
   <gml:boundedBy>
      <gml:null>inapplicable</gml:null>
   </gml:boundedBy>
</wfs:FeatureCollection>



I don't know what to make of that at all. For what it's worth, here is the
WFS server's mapfile. It is configured to do both WMS and WFS. WMS
supports works perfectly.


#
# This mapfile sets up a dedicated WMS server.
# The output is always in latlong format; we'll let the client reproject
it as they need.
#

NAME HostGIS_WMS

PROJECTION
   "init=epsg:4269"
END

WEB
  MINSCALE 3000
  MAXSCALE 2000000
  IMAGEPATH "/usr/local/apache-wms/htdocs/"
  IMAGEURL "/"

  METADATA
    "wms_title"            "HostGIS WMS Server"
    "wms_onlineresource"   "http://wms.hostgis.com:800/mapserv?"
    "wms_srs"              "EPSG:4269"

    "wfs_onlineresource"          "http://wms.hostgis.com:800/mapserv?"
    "wfs_title"                   "HostGIS WFS Server"
    "wfs_srs"                     "EPSG:4269"
    "wfs_geometry_element_name"   "the_geom"
  END
END


### BEGIN LAYER DEFINITIONS


# All roads and highways in the USA
LAYER
  NAME streets
  TYPE line
  STATUS on
  DUMP true

  CONNECTIONTYPE postgis
  CONNECTION "user=XXXXXX dbname=XXXXXX password=XXXX host=localhost"
  DATA "the_geom from streets"

  PROJECTION
     "init=epsg:4269"
  END
  METADATA
    "wms_title"  "streets"
    "wfs_title"  "streets"
  END

  LABELITEM "name"
  CLASS
    COLOR 0 0 0
    LABEL
      COLOR 0 0 0
    END
  END
END

# citis, towns, and landmarks
LAYER
  NAME places
  TYPE point
  STATUS on
  DUMP true

  CONNECTIONTYPE postgis
  CONNECTION "user=XXXXXX dbname=XXXXXX  password=XXXX host=localhost"
  DATA "the_geom from places"

  PROJECTION
     "init=epsg:4269"
  END
  METADATA
    "wms_title"  "places"
    "wfs_title"  "places"
  END

  LABELITEM "name"
  CLASS
    COLOR 255 0 0
    LABEL
      COLOR 255 0 0
    END
  END
END


# ZIP code boundaries
LAYER
  NAME zipcodes
  TYPE polygon
  STATUS on
  DUMP true

  CONNECTIONTYPE postgis
  CONNECTION "user=XXXXXX dbname=XXXXXX password=XXXX host=localhost"
  DATA "the_geom from zipcode_extents"

  PROJECTION
     "init=epsg:4269"
  END
  METADATA
    "wms_title"  "zipcodes"
    "wfs_title"  "zipcodes"
  END

  LABELITEM zip
  CLASS
    OUTLINECOLOR 180 180 180
    LABEL
      COLOR 0 0 0
    END
  END
END


### END OF LAYER DEFINITIONS

# the end
END






More information about the MapServer-users mailing list