Open velle opened 1 year ago
Hello, the geometry field is called the_geom
in your WFS service response (classic name for this field).
Check the XML data block shown to you on the error.
You can identify this part of the XML data as a geometry, because it contains a GML geometry type. Here it is "MultiPoint".
So you should configure this specific field name on your WFS layer initialisation, by adding this option : geometryField: 'the_geom'
For the purpose of testing I created a very simple layer (
footest
) on GC2, with only two features. When trying to load this layer with leaflet-WFST, the following message is printed to console (for each feature).I don't know enough about WFS to tell if the data returned by GC2 is in fact invalid or has data missing. It appears valid to me though, and I have had no issues importing the layer into QGIS. Can anybody tell if this seems to be an error in Leaflet-WFST?
Error message in console
Geometry field 'Shape' doesn' exist inside received feature: '<cubetown:gid xmlns:cubetown="http://companyname.admin.gc2.io/companyname/cubetown">35</cubetown:gid><cubetown:id xmlns:cubetown="http://companyname.admin.gc2.io/companyname/cubetown">45</cubetown:id><cubetown:the_geom xmlns:cubetown="http://companyname.admin.gc2.io/companyname/cubetown"><gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" srsName="urn:ogc:def:crs:EPSG::3857"><gml:pointMember><gml:Point><gml:pos>2632472.43108 10411830.80244</gml:pos></gml:Point></gml:pointMember></gml:MultiPoint></cubetown:the_geom>', so feature will be skipped and won't be converted into leaflet layer
HTML/JS used for testing:
I inspected the data in the Chrome dev tool, and the two requests are listed below, together with the response data (pretty formatted).
WFS request 1 - DescribeFeatureType
Url:
https://companyname.admin.gc2.io/wfs/cubetown@companyname/cubetown/3857?
Request payload:
Response:
Wfs Request 2 - GetFeature
Url:
https://companyname.admin.gc2.io/wfs/cubetown@companyname/cubetown/3857?
Request payload:
Response:
Company name removed
I have removed part of the URL, which reveals the company whose data I am working on. Otherwise the data above is unedited.