Hi,
I'm programmatically adding a bunch of feature layers to a map from a local, runtime geodatabase. Prior to adding to the map, I would like to get the geometry type of the feature table (or feature layer). Can someone assist me with the most efficient way to get that info? I'm pretty new to QML.
Thanks in advance!
Mike
Solved! Go to Solution.
You could do something like this:
// create the geodatabase
Geodatabase {
id: gdb
path: dataPath + "geodatabase/LA_Trails.geodatabase"
Component.onCompleted: load();
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded) {
console.log("Geodatabase loaded");
for (var i = 0; i < geodatabaseFeatureTables.length; i++) {
const ft = geodatabaseFeatureTables[i];
ft.loadStatusChanged.connect(()=>{
if (ft.loadStatus === Enums.LoadStatusLoaded) {
if (ft.geometryType === Enums.GeometryTypePoint) {
console.log("this is a point")
} else if (ft.geometryType === Enums.GeometryTypePolygon) {
console.log("this is a polygon")
} else if (ft.geometryType === Enums.GeometryTypePolyline) {
console.log("this is a polyline")
}
}
});
ft.load();
}
}
}
}
You could do something like this:
// create the geodatabase
Geodatabase {
id: gdb
path: dataPath + "geodatabase/LA_Trails.geodatabase"
Component.onCompleted: load();
onLoadStatusChanged: {
if (loadStatus === Enums.LoadStatusLoaded) {
console.log("Geodatabase loaded");
for (var i = 0; i < geodatabaseFeatureTables.length; i++) {
const ft = geodatabaseFeatureTables[i];
ft.loadStatusChanged.connect(()=>{
if (ft.loadStatus === Enums.LoadStatusLoaded) {
if (ft.geometryType === Enums.GeometryTypePoint) {
console.log("this is a point")
} else if (ft.geometryType === Enums.GeometryTypePolygon) {
console.log("this is a polygon")
} else if (ft.geometryType === Enums.GeometryTypePolyline) {
console.log("this is a polyline")
}
}
});
ft.load();
}
}
}
}