Open jamieodonnell opened 4 years ago
It is known bug of creating simple geometry when it stores in 'Multi' type. Was fixed there. You should use one of beta versions since v2.0.1-beta.18 and initialize layer with special option forceMulti.
var wfstPoly = new L.WFST({
url: 'http:localhost:8080/geoserver/ows',
typeNS: 'schememapper',
typeName: 'geoserver-polygons',
crs: L.CRS.EPSG4326,
geometryField: 'geom',
forceMulti: true, //<<<<<<<<<<<here for example
style: {
color: 'blue',
weight: 2
}
}).addTo(map)
.once('load', function () {
// map.fitBounds(wfstPoly);
});
I have a GeoServer installation on top of a PostGIS database. I am trying to set up a leaflet webmap (using Leaflet WFS-T plugin) so that I can insert, update and delete polygon features. I have managed to get this to work fine for Point features but something seems to be going wrong when inserting polygons.
Below is the request payload to GeoServer:
Below is my Leaflet code (I am using Leaflet draw to create the polygons):
EDIT: This may have something to do with GML versions. I.E. Geoserver is expecting the XML of the request to be structured differently.
Aasked on stackexchange here with bounty: https://gis.stackexchange.com/questions/348819/leaflet-geoserver-wfst-inserting-polygons-to-postgis-database