AnsweredAssumed Answered

Problem Adding Features to Qt Local GDB - QML

Question asked by marcb_al on Aug 30, 2016
Latest reply on Sep 13, 2016 by marcb_al

I'm having troubles adding features to a Local GDB in Qt. Following this code:

 

Geodatabase {

        id: gdb

        path: "Test/FS_SNM_ALS_LimpiezaSumideros.geodatabase"        onValidChanged: {

            if (valid) {

                var gdbtables = gdb.geodatabaseFeatureTables;

                for(var i in gdbtables) {

                    console.log (gdbtables[i].featureServiceLayerName);

                }

            }

        }

    }

FeatureLayer {

                id: featureLayer

                featureTable: gdb.geodatabaseFeatureTableByLayerId(0)

}

function addFeature(mapPoint) {

            console.log("x", mapPoint.x);

            var featureJson = {

                geometry: {

                    x: mapPoint.x,

                    y: mapPoint.y,

                    spatialReference: mapPoint.spatialReference

                },

                attributes: {

                              <attributes>                        

                             }

                }

if (featureLayer.featureTable.featureTableStatus === Enums.FeatureTableStatusInitialized) {

featureLayer.featureTable.addFeature(featureJson);

                }

}

 

When running the code, it seems like the feature was added, but it can't be queried or be seen on the map

 

Any comment is helpful! Thank you!

 

cc: jimy cuesta

Outcomes