Learning WFS

Bart van den Eijnden (OSGIS) bartvde at XS4ALL.NL
Fri Apr 28 08:00:06 PDT 2006


Chip,

do a DescribeFeatureType request on your WFS, maybe the attribute has a 
namespace in front of it and you need to use that namespace in the 
LABELITEM, so eg ms:STATE. But to be sure, check your 
DescribeFeatureType response.

?request=DescribeFeatureType&typename=states&version=1.0.0

Best regards,
Bart

Chip Taylor wrote:

>I am beginning to learn WFS and have had some success in setting up a WFS
>server using MapServer 4.6.1 under IIS6 and then accessing it.  However, I
>am not able to get "gml_include_items" to work.  Here is my WFS server
>layer:
>
>##################################### 
># WFS States
>#
>LAYER
>     NAME "states"
>     METADATA
>	"wfs_title"		"States"
>	"gml_include_items"	"STATE"
>     END
>       DATA "US/States/statesp020"
>     STATUS ON
>     TYPE polygon
>     DUMP TRUE
>     PROJECTION
>	"init=epsg:4326"
>     END
>     CLASS
>          STYLE
>               COLOR 0 0 255
>          END
>     END
>     
>END
>
>-------------------------------------
>And here is the call from Mapserver as a client:
>
>##################################### 
># getWFS Layer
>#
>LAYER
>  NAME "getWFS"
>  TYPE POLYGON
>  STATUS ON
>  CONNECTIONTYPE WFS
>  CONNECTION
>"http://mapwfs.com/cgi-bin/mapserv.exe?map=../mapfiles/map_files/wfs_test.ma
>p"
>  METADATA
>    "wfs_typename"          "states"
>    "wfs_version"           "1.0.0"
>    "wfs_request_method"    "GET"
>    "wfs_connectiontimeout" "60"
>    "wfs_maxfeatures"       "all"
>    "wfs_srs"		    "epsg:4326"
>  END
>  PROJECTION
>    "init=epsg:4326"
>  END
>  LABELITEM STATE
>  CLASS
>    NAME "States"
>    STYLE
>      COLOR 80 80 250
>      OUTLINECOLOR 120 120 120
>    END
>    LABEL
>      COLOR 0 0 0
>      OUTLINECOLOR 200 0 0
>      SIZE 20
>    END
>  END
>
>END
>------------------------------------
>Here is the error I receive:
>msDrawMap(): Image handling error. Failed to draw layer named 'getWFS'. 
>msOGRLayerInitItemInfo(): OGR error. Invalid Field name: STATE
>
>If I leave the LABELITEM off the layer draws fine (with no layers).  The
>shapefile used by the WFS server does have a "STATE" attribute.  I have
>tried replacing "STATE" with "all" in the gml_include_items with the same
>result.  Looking at the GML produced, thee are no attribute fields included
>there.
>
>If I access the WFS server directly using mode=map and include the same
>label info in its mapfile, the labels show up fine.
>
>What am I doing wrong that the attributes are not being sent by the WFS
>server in the GML?
>
>Chip Taylor
>
>
>  
>


-- 
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl



More information about the MapServer-users mailing list