While using OpenLayers 6 and GeoServer 2.16 (with PostGIS), I encountered a problem where the geometry name of loaded layers from GeoServer gets overwritten. In GeoServer, the geometry name (and column in PostGIS) is defined as geom
. The XML response from GeoServer reflects this structure. However, in OpenLayers, the object assigns the geometry name as geometry
, disregarding the original name provided by GeoServer.
Although it may seem like a minor issue, it causes errors when attempting to edit features, resulting in an error message such as
org.geoserver.wfs.WFSException: No such property: geometry
. Manually changing the geometry name and its corresponding value in my code feels like a temporary workaround rather than a proper solution.
I'm uncertain whether this behavior is due to a bug or if there's a specific setting that I have overlooked in the documentation.
Any assistance on this matter would be greatly appreciated! (I couldn't find any similar questions regarding this particular error; most inquiries seem to focus on POST requests, whereas mine pertains to WFS retrieval. Please inform me if this question has already been addressed elsewhere.)