I am sending my modified features to database with transactional WFS. The problem is when I render my vector features on map their property name which describes geometry is changed to 'geometry' and geometry column name in database is wkb_geometry(in this case). So every time I am sending request via WFS-T I have to set geom property name to 'wkb_geometry'

feature.set('wkb_geometry', feature.getGeometry());

, if I leave 'geometry' response will return :

<ows:ExceptionText>No such property: geometry</ows:ExceptionText>

Is there some workaround for this because I can't hardcode it this way, some times maybe geometry column name will be something else except wkb_geometry.

  • If you have some way of identifying possible names you might be able to search the properties to find the appropriate one:to use from Object.keys(feature.getProperties()) – Mike Sep 6 at 14:27
  • @Mike Yes but the problem is that OpenLayers changes name of my geometry column from data base to 'geometry' property and then I have to reset it back manualy – Goran Sep 6 at 15:00
  • does feature.getGeometryName() give any clues? – Mike Sep 6 at 15:31
  • 1
    You can use describeFeatureType to get the geometry name from the wfs – Ian Turton Sep 6 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.