I am trying to send my drawn features with WFS-t to DB. This particular layer has two columns in DB ogc_fid(which is autoincrementing primary key) and wkb_geometry (type geom, which is my geometry column).


WFS_transactional_node = new ol.format.WFS().writeTransaction(featuresForInsertion, null , null, {
                                gmlOptions: {srsName: "EPSG:3765"},
                                featurePrefix: "test",
                                featureType: 'test_layer',

In featuresForInsertion my features are drawn points which only have geometry property 'wkb_geometry'. Feature looks like this:

0: ol.Feature
dispatching_: {}
geometryChangeKey_: {bindTo: ol.Feature, callOnce: false, listener: ƒ, 
target: ol.g…m.MultiPoint, type: "change", …}
geometryName_: "wkb_geometry"
id_: undefined
listeners_: {change:wkb_geometry: Array(2), change: Array(2), propertychange: 
ol_lm: {change:wkb_geometry: Array(2), change: Array(2), propertychange: 
ol_uid: 101
pendingRemovals_: {}
revision_: 3
styleFunction_: undefined
style_: null
values_: {wkb_geometry: ol.g…m.MultiPoint}
__proto__: ol.Object
length: 1
__proto__: Array(0)

When I try to execute chunk of code marked #1 I got error:

 Uncaught TypeError: Cannot read property 'wkb_geometry' of undefined

Don't know what am I doing wrong. On some places I have red that geometry property and geometry column name in database has to be same, think I already done it.

  • Are they both MultiPoint or is the database geometry Point? Can you use the WebDeveloper tools in your browser (F12 key, then Network, select line that has the longest url, then Params / Response) to view the payload of WFS request?
    – vinh
    Commented Sep 12, 2019 at 14:59
  • @vinh I solved the problem , I haven't defined featureNS attribute inside WFS().writeTransaction options parameter
    – Goran
    Commented Sep 12, 2019 at 15:03


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.