Discovering layer type

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Tue Oct 25 02:22:22 PDT 2005


Hi,

it depends with the implementation, but it is a difficult theory anyway already :-)

WMS can be coupled to a WFS (on the same data) using a DescribeLayer WMS request. This is part of the SLD WMS spec.
The response of a WMS DescribeLayer is:

a) the onlineresource of a WFS (or WCS for raster layers)
b) the name of the typename

With this info, you could request more info from the associated WFS, mostly WFS DescribeFeatureType will be useful for that. It will give you all the attributes and most likely (depending on the implementation) also an idea of the geometry type. Note that something was changed in Mapserver 4.6 which makes it ouput a gml abstract featuretype by default, which won't give you an idea of the geometry type.

Note also that WMS GetFeatureInfo could give you a rough guess of the geometry type, and the list of attributes in the GML returned. But it is specific to a point clicked in the map. Mapserver also gives back a geometry on the WMS GetFeatureInfo (which you could check for point, polygon or line in the string), but most WMS's don't give back the geometry on WMS GetFeatureInfo.

Anyway, you can see it's not straightforward.

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl

>>> Etienne Labuschagne <elabuschagne at GMAIL.COM> 25-10-2005 10:13 >>>
Hi all,

I'm a newbie to MapServer and OGC in general.

I can discover the layer names with a WMS getCapabilities call.  The other
thing I need to discover is what type each layer is (Point, line, polygon)
and also what attribute fields there are available on each layer.

Is there an OGC way to get this information from any OGC compliant map
server?  The reason I say "OGC" is that my client program that I am writing
need to adhere to that standard and not nescessarily only MapServer.

Although I use MapServer predominantly, I may have to use other map servers
later and do not want to be bound by MapServer proprietary code.

Thanks
Etienne



More information about the MapServer-users mailing list