4

Using WFSGetCapabilities I sent a GetCapabilities request to GeoServer. 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 retrieve 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?

5
  • Can you provide examples of actual values returned by GetCapabilities?
    – unicoletti
    Commented Sep 6, 2011 at 5:20
  • Were you able to obtain the solution for this? Could you post it here?
    – Sam007
    Commented Sep 26, 2012 at 17:32
  • 1
    @Sam007: it was a long time ago. i tried: 1) wfsServerURL + '/ows?service=wfs&version=' + wfsServiceVersion + '&request=GetCapabilities'; parse its response, you will find responsibilities.featureTypeList.featureTypes[i] has several properties: name, full name,title, srs, featureNS etc. 2) service_url + '/ows?service=wfs&version=' + version +'&&request=DescribeFeatureType&TypeName=' + full_name; here using full name.
    – Simon
    Commented Sep 27, 2012 at 18:25
  • @Simon thanks for the reply. I also worked on it and found a better way using WMS itself. Here gis.stackexchange.com/questions/34336/…
    – Sam007
    Commented Sep 27, 2012 at 20:00
  • @Sam007 not so sure that's a same question from the link you attached. but as long as you found a solution, thats good.
    – Simon
    Commented Sep 28, 2012 at 20:13

1 Answer 1

2

However, this namespace prefix is needed in DescribeFeatureType request URL.

You don't need to specify a TypeName in a DescribeFeatureType request, so you don't need a namespace. If you omit the TypeName parameter you get all types represented by the service.

And these responses will give you the TypeName with their namespace prefix, for example:

http://geoserver.cprm.gov.br/geoserver/CPRM_EN_Bedrock_and_Age/ows?SERVICE=WFS&version=2.0.0&request=DescribeFeatureType&

or

http://ogc.bgs.ac.uk/cgi-bin/BGS_GSI_EN_Bedrock_and_Structural_Geology/ows?service=WFS&request=DescribeFeatureType&version=1.1.0&

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.