WMS and WFS connections

Bart van den Eijnden bartvde at XS4ALL.NL
Wed Mar 30 08:53:34 PST 2005


Hi Stefanie,

answers inline.

Best regards,
Bart

On Tue, 29 Mar 2005 19:49:11 +0200, Stefanie Weykam <sweykam at TELELINE.ES>
wrote:

> I am preparing my application for WMS (or WFS), but the more I read the
> more
> I get confused...
>
> I am actually trying things by using the same application from home (as
> client) to office (the server), retrieving some layers from the remote
> server. I thought I better start with something simple - the WMS
> connection.
> Results:
> GetCapabilities - OK
> DescribeLayer - OK (very little information though, just the layer name)
> GetMap - OK
> The WMS layer displays on my map.....but
> ....how do I get the layer (class) name and symbol into my legend?
> What's the syntax for the GetLegendGraphic request? So far I only get the
> following Exception back: Mandatory LAYER parameter missing in
> GetLegendGraphic request

Example of GetLegendGraphic request:

http://myserver/cgi-bin/mapserv.exe?map=/ms4w/OGC_UMN_services/gemeentes.map&request=GetLegendGraphic&layer=Gemeentes&version=1.1.1&format=image/png

Note that it is LAYER and not LAYERS! It can only take 1 layer at a time.

Make sure all your CLASS elements in the LAYER have a NAME though,
otherwise they don't display in the legend.

>
> I would also like to be able to do very simple queries: at least to find
> the
> features (points) of my WMS layer by point queries on the map. The map
> query
> works fine with my local layers, but not with the WMS layer. I tried
> sending
> the request GetFeatureInfo and Query_layers This requires map
> coordinates -
> but how do I specify these parameters? ..by adding "&X=197&Y=144" for
> example?? The ServiceException code says that the layer given in the
> LAYERS
> parameter is invalid... (yes, the layer IS queryable)
> Shouldn't the click on the map just do the job anyway?

Point queries on the map you could do with WMS GetFeatureInfo. x and y are
in pixel coordinates starting at the upper-left corner of the image.

Example is:
http://myserver/cgi-bin/mapserv.exe?map=/ms4w/OGC_UMN_services/gemeentes.map&request=GetFeatureInfo&layers=Gemeentes&version=1.1.1&bbox=100000,400000,300000,600000&width=500&height=500&query_layers=Gemeentes&info_format=application/vnd.ogc.gml&srs=EPSG:28992&x=300&y=400

>
> Well, since WFS seems to be more adequate I tried the WFS connection.
> GetCapabilities - OK
> DescribeFeature - OK
> GetFeature - OK
> And the WFS layer is displayed on my map, appears in the legend and is
> queryable, BUT I have to specify the class expression and name and
> colors...
> How would a potential client application know? I guess, by studying the
> XML
> document on each feature?
> Or do I have to make up a GML document? Where would I deposit such a
> document?

WFS clients usually style layers with a default style, eg the Cadcorp SIS
Mapbrowser. They determine the type of layer (polygon, point, line etc) by
studying the DescribeFeatureType response or the GML retrieved. If you use
a WFS client layer in Mapserver you have to style it in the MAP file for
it to show up. GML is just like a shapefile dataset once it gets
downloaded.

>
> More questions:
> Can I set up just one map file which suits both WMS and WFS connections?

No problem.

> I
> am actually using two map files, one having "wms_ ... and the other one
> "wfs_.... parameters. Well, actually three map files, the third is the
> one
> my application is based on but it contains additional data layers which
> are
> not (yet) mend to be shared. Its quite enoying to maintain three files.
>
> Thanks for your comments,
> Stefanie
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/



More information about the MapServer-users mailing list