0

Some WFS offer a large number of feature types, e.g. a collection of all public datasets from a municipality.

What is the right way to count the number of feature types of a WFS?

My idea was to search the respective XML documents for string that appear once in each feature type block and nowhere else. I searched the GetCapabilties output for and I got 335 results. Then I searched the DescribeFeatureType output for <xsd:complexType and got 339 results. This does not seem the "official" way to do it or maybe I use the wrong search string.

What is the easiest and correct solution here?

1 Answer 1

4

I do not really understand this case. It is supposed to get the list of layers by parsing the GetCapabilities document with a real XML parser, but text search with a well selected string can work as well. It is also possible to use some utilities like ogrinfo

ogrinfo WFS:"https://data.wien.gv.at/daten/geo?version=2.0.0&service=WFS&request=GetCapabilities" 

Ogrinfo finds 335 feature Types. But there are really 339 complexType elements in the DescribeFeatureType response. This is one that appears only in DescribeFeatureType:

<xsd:complexType name="PLANUNGASTOGDType">
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractFeatureType">
        <xsd:sequence>
          <xsd:element maxOccurs="1" minOccurs="1" name="OBJECTID" nillable="false" type="xsd:decimal"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="SHAPE" nillable="true" type="gml:GeometryPropertyType"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="NAME" nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="QUELLE" nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="FERTIG" nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="STAND" nillable="true" type="xsd:string"/>
          <xsd:element maxOccurs="1" minOccurs="0" name="SE_ANNO_CAD_DATA" nillable="true" type="xsd:hexBinary"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

I tried GetFeature with this "extra" feature type but it fails maybe due to timeout.

https://data.wien.gv.at/daten/geo?version=2.0.0&service=WFS&request=GetFeature&typeNames=PLANUNGASTOGD

The server still believes that it could do something with that feature type, because a type name like "PLANUNGASTOGDfoo" yields an error message Feature type :PLANUNGASTOGDfoo unknown.

I would say that the WFS server at data.wien.gv.at is now somehow misconfigured. Maybe they have removed 4 feature types from the service but for some reason the server has not removed them from DescribeFeatureType. I would contact the service provider and report the issue. As an answer to your original question, GetCapabilities is the right document for counting the number of feature types.

1
  • Thank you! Good to know that it's probably an error server-side. I contacted the service provider for support regarding the issue.
    – winnewoerp
    Commented Mar 16, 2023 at 10:08

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.