1

Here I read, that the WFS-Request DescribeFeatureType requests information about an individual feature type before requesting the actual data.

Because I want to inform myself about the FeatureType on a GeoServer, I entered the following command:

http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType

I entered this command in a browser that could display XML.

After sending the command a question pops up to save a file. I saved this file. The content of the file is:

    <?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" elementFormDefault="qualified" targetNamespace="http://www.opengis.net/gml/3.2">
  <xsd:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.2.1/gml.xsd"/>
</xsd:schema>

I expected to see informations about FeatureTypes. What am I doing wrong?


Edit after jbalks answer:

I entered this command

http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType?typeNames=KRE_ALKIS:sg_flurstueck_f

and get

<ows:ExceptionReport version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">
<ows:Exception exceptionCode="OperationNotSupported" locator="DescribeFeatureType?typeNames=KRE_ALKIS:sg_flurstueck_f">
<ows:ExceptionText>
No such operation wfs 2.0.0 DescribeFeatureType?typeNames=KRE_ALKIS:sg_flurstueck_f
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

enter image description here


Edit on 7.12.2019

If I enter
http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=KRE_ALKIS:sg_flurstueck_f
I get enter image description here

If I enter
http://localhost:8080/geoserver/KRE_ALKIS/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=KRE_ALKIS:sg_flurstueck_f
or
http://localhost:8080/geoserver/KRE_ALKIS/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=sg_flurstueck_f
I see an message that asks me if I want to save a file. The first lines in the file are

<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:KRE_ALKIS="KRE_ALIKS" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="21350" numberReturned="5" timeStamp="2019-12-07T21:04:58.547Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://172.16.206.128:8080/geoserver/schemas/wfs/2.0/wfs.xsd KRE_ALIKS http://172.16.206.128:8080/geoserver/KRE_ALKIS/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=KRE_ALKIS%3Asg_flurstueck_f http://www.opengis.net/gml/3.2 http://172.16.206.128:8080/geoserver/schemas/gml/3.2.1/gml.xsd"><wfs:member><KRE_ALKIS:sg_flurstueck_f gml:id="sg_flurstueck_f.108878"><KRE_ALKIS:id>DEBBAL650002cvLg</KRE_ALKIS:id><KRE_ALKIS:id_hash>305dea1e70263fdbe12bc329b1049ab6</KRE_ALKIS:id_hash><KRE_ALKIS:area>525.923984998768</KRE_ALKIS:area>

If I enter
http://localhost:8080/geoserver/KRE_ALKIS/wfs?service=wfs&version=1.0.0&request=DescribeFeatureType&typeNames=KRE_ALKIS:sg_flurstueck_f
or
http://localhost:8080/geoserver/KRE_ALKIS/wfs?service=wfs&version=1.0.0&request=DescribeFeatureType&typeNames=sg_flurstueck_f
I see the output nicly formatted in my browser. The first lines are

<wfs:FeatureCollection xsi:schemaLocation="http://www.opengis.net/wfs http://172.16.206.128:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd KRE_ALIKS http://172.16.206.128:8080/geoserver/KRE_ALKIS/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=KRE_ALKIS%3Asg_flurstueck_f">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<KRE_ALKIS:sg_flurstueck_f fid="sg_flurstueck_f.108878">
<KRE_ALKIS:id>DEBBAL650002cvLg</KRE_ALKIS:id
  • 2
    On the linked page in your question, the documentation says that the typeNames parameter is required for DescribeFeatureType. It's also confusing - they show an example of DescribeFeatureType where they have not specified the typeNames parameter. – jbalk Dec 6 '19 at 22:07
  • Thank you jbalk. I have addes text to my question above. I tried it with typeNames. Unfortunately I still see an "Error". Maybe I use the wrong value for type names? – astridx Dec 6 '19 at 22:38
  • 1
    Take a look at the answer on the question I linked in my last comment. It has some tips you can try, such as capitalizing WFS. So service=WFS. Try that with your original get request – jbalk Dec 6 '19 at 23:33
  • Thanks once again. I have now found my mistake. I copied too much the example in the documentation. I forgot to add your_geoserver_workspacename in localhost:8080/geoserver*your_geoserver_workspacename*/wfs?service=wfs&version=2.0.0&request=getfeature&typename=layer_name – astridx Dec 7 '19 at 7:29
1

The issue with your first request is that you have a ? instead of a & separating your parameters.

http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType?typeNames=KRE_ALKIS:sg_flurstueck_f

should be:

http://localhost:8080/geoserver/wfs?service=wfs&version=2.0.0&request=DescribeFeatureType&typeNames=KRE_ALKIS:sg_flurstueck_f
  • Thank you @Ian Turton. You are right. This was a typo here. The main problem was, as wrote in the command above, that forgot the workspacename. – astridx Dec 7 '19 at 9:15
  • You don't need the workspace name if you use the prefix on your featurename, this is much more standard and will work with all WFS servers not just GeoServer – Ian Turton Dec 7 '19 at 9:54
  • Strange. In my case localhost:8080/geoserver/workspace/… and localhost:8080/geoserver/workspace/… works OK. But localhost:8080/geoserver/… does not work. I just tried that extra one more time. But since I found a solution, that's OK. – astridx Dec 7 '19 at 11:54
  • Or do you mean that I did not set something correctly on the server? It is unfortunately all local, because I'm still learning with a virtual machine at the moment and have no opportunity to make the GeoServer public. – astridx Dec 7 '19 at 11:54
  • the second url in my answer should work on a local geoserver install (unless you deleted the sample data). – Ian Turton Dec 7 '19 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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