WFS request to GeoServer to retrieve "name" & "featureNS"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

WFS request to GeoServer to retrieve "name" & "featureNS"

Simon
I tried WFSGetCapabilities and sent a GetCapabiliteis request to geoservr. From the result of WFSGetCapabilities().read(), I can loop each featureType and retrieve some basic info(e.g., name, title, featureNS, srsName). Then in order to retieve the "geometryName" property of this feature type, (which is needed to load this featureLayer into map), I sent a DescribeFeatureType request to server by attaching "&TypeName="feature.name. However, i found that the full name of the feature is truncated, i.e., feature.name is the feature's name without its namespace prefix. However, this namespace prefix is needed in DescribeFeatureType request URL.

my question is, how can I get the full name (with namespace prefix) in order to execute this DescribeFeatureType request and retrieve the geometryName property?

appreciate any helps!!!!
Reply | Threaded
Open this post in threaded view
|

Re: WFS request to GeoServer to retrieve "name" & "featureNS"

Phil Scadden
I am also pretty interested in this. There are some crude workarounds
that I can think of.
1/ Parse the GetCapabilities document yourself and either read the
fully-qualified names for layers or read the xmlns line and translate
featureNS yourself.
2/ Call DescribeFeatureType with no typename and parse the lot.

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS request to GeoServer to retrieve "name" & "featureNS"

Andreas Hocevar-2
In reply to this post by Simon
Hi,

you don't need the namespace prefix. According to the WFS 1.1.0 spec, the KVP format for DescribeFeatureType is as follows:

http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.1.0&request=DescribeFeatureType&typename=myns:states&namespace=xmlns(myns=http://www.openplans.org/topp)

This means you can choose an arbitrary prefix (myns in this case), and then you use the namespace parameter to provide the namespace uri and map it to the prefix.

Andreas.

On Sep 4, 2011, at 04:03 , Simon wrote:

> I tried WFSGetCapabilities and sent a GetCapabiliteis request to geoservr.
>> From the result of WFSGetCapabilities().read(), I can loop each featureType
> and retrieve some basic info(e.g., name, title, featureNS, srsName). Then in
> order to retieve the "geometryName" property of this feature type, (which is
> needed to load this featureLayer into map), I sent a DescribeFeatureType
> request to server by attaching "&TypeName="feature.name. However, i found
> that the full name of the feature is truncated, i.e., feature.name is the
> feature's name without its namespace prefix. However, this namespace prefix
> is needed in DescribeFeatureType request URL.
>
> my question is, how can I get the full name (with namespace prefix) in order
> to execute this DescribeFeatureType request and retrieve the geometryName
> property?
>
> appreciate any helps!!!!
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/WFS-request-to-GeoServer-to-retrieve-name-featureNS-tp6757618p6757618.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS request to GeoServer to retrieve "name" & "featureNS"

Phil Scadden
Hmm, works but only on geoserver 2.1 or higher.

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users