0

I'm trying to query WFS service of Qgis Server by a URL.

So far, I was succeeded to send this request:

http://10.253.69.120/cgi-bin/qgis_mapserv.fcgi?SERVICE=WFS&&REQUEST=DescribeFeatureType&MAP=/home/user/Documents/MyFirst.qgz

And get back this result:

<schema version="1.0" targetNamespace="http://www.qgis.org/gml" elementFormDefault="qualified">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
<element name="GeoCoding_Plugin_Results" type="qgs:GeoCoding_Plugin_ResultsType" substitutionGroup="gml:_Feature"/>
<complexType name="GeoCoding_Plugin_ResultsType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element maxOccurs="1" name="geometry" type="gml:PointPropertyType" minOccurs="0"/>
<element name="fid" type="long"/>
<element nillable="true" name="address" type="string"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="JerusalemGIS_GPL0" type="qgs:JerusalemGIS_GPL0Type" substitutionGroup="gml:_Feature"/>
<complexType name="JerusalemGIS_GPL0Type">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element maxOccurs="1" name="geometry" type="gml:MultiPolygonPropertyType" minOccurs="0"/>
<element nillable="true" name="CODE" type="long"/>
<element nillable="true" name="SCHN_NAME" type="string"/>
<element nillable="true" name="Shape_STAr" type="decimal"/>
<element nillable="true" name="Shape_STLe" type="decimal"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="Joined_layer" type="qgs:Joined_layerType" substitutionGroup="gml:_Feature"/>
<complexType name="Joined_layerType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element maxOccurs="1" name="geometry" type="gml:PointPropertyType" minOccurs="0"/>
<element name="fid" type="long"/>
<element nillable="true" name="address" type="string"/>
<element nillable="true" name="CODE" type="long"/>
<element nillable="true" name="SCHN_NAME" type="string"/>
<element nillable="true" name="Shape_STAr" type="decimal"/>
<element nillable="true" name="Shape_STLe" type="decimal"/>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="אזורים_סטטיסטיים_2011_50501_Lamas_Census_Tracts_2011" type="qgs:אזורים_סטטיסטיים_2011_50501_Lamas_Census_Tracts_2011Type" substitutionGroup="gml:_Feature"/>
<complexType name="אזורים_סטטיסטיים_2011_50501_Lamas_Census_Tracts_2011Type">
<complexContent>
</complexContent>
</complexType>
</schema>

What I'm trying to is for a way to query this project and get back a feature for a specific coordinate (Which I assume I'll have to use BBOX for), but as a starting point - I'd like to get back ANY data (feature) from that map.

Trying to send this request:

http://10.253.69.120/cgi-bin/qgis_mapserv.fcgi?SERVICE=WFS&&REQUEST=GetFeature&MAP=/home/user/Documents/MyFirst.qgz&FEATUREID=geometry.STAT11

Returned this error:

<ServiceExceptionReport version="1.2.0">
<ServiceException code="RequestNotWellFormed">TypeName 'geometry' unknown</ServiceException>
</ServiceExceptionReport>

I feel the solution for this is very close to me, but what should be the last step?

4
  • 1
    you don't have a TypeName called geometry, your typenames are GeoCoding_Plugin_Results, JerusalemGIS_GPL0, Joined_layer, and 50501_Lamas_Census_Tracts_2011
    – nmtoken
    Jan 5, 2022 at 10:52
  • What is the form of the gml:id when you do a GetFeature request like: http://10.253.69.120/cgi-bin/qgis_mapserv.fcgi?SERVICE=WFS&REQUEST=GetFeature&MAP=/home/user/Documents/MyFirst.qgz&version=1.1.0&typename=JerusalemGIS_GPL0&count=1
    – nmtoken
    Jan 6, 2022 at 15:12
  • @nmtoken Thanks for looking into this. I'll go back to the project file and check for the available typenames. As about your second comment - I'm not sure I follow. What should I look for?
    – Offer
    Aug 20, 2022 at 14:15
  • in the GetFeature response you will see a gml:id for each feature returned
    – nmtoken
    Aug 22, 2022 at 11:10

0

Your Answer

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

Browse other questions tagged or ask your own question.