1

I have an offline geodatabase in android ArcGIS which I have downloaded through gdbAsyncTask.

how do I loop into every feature in that geodatabase?

for example I could have collect all the IDs from the geodatabase and then loop into each in a for loop but this is not possible.

new FeatureLayer(localGdb.getGeodatabaseFeatureTableByLayerId(id)).getFeatureIDs(x,y,tolerance);

getFeatureIDs method does not work since I guess I have to also add the layer in my map. But I want to do that without having to add it to my map. Since I need to get the geometries only.

After the point: localGdb.getGeodatabaseFeatureTableByLayerId(id), how do I guery for all the features? or query for all the feature IDs, so then I can reach every feaure?

1 Answer 1

1

The oid of the features in the feature layer generally match the 'rowid' so can be used incrementally.

Long lenLayer = gvOC.geodatabaseFeatureTable.getNumberOfFeatures();
Long featureid;
Geometry g;
for (long i = 1; i <= lenLayer;  i++) { 
        Feature selectedFeature = gvOC.featureLayer.getFeature(i);
        featureid = selectedFeature.getId();
        g = selectedFeature.getGeometry();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.