Extract geometries out of geodatabase

694
6
Jump to solution
07-29-2019 07:38 AM
DevendraKhatri
New Contributor III

Here is what I want to do today,

I have some geodatabases that I am loading on my map, I do some edits and update those. After all the process, I need to extract the geometries as JSON for all the features [ geodatabases] that has been edited.

To achieve this I found a way,

Use getAddedFeaturesAsync() on my geodatabase table and get the features, it gives me FeatureQueryResult class as the response. But I do not find any method in FeatureQueryResult class that gives me geomteries out of it.

What am I missing ! Or is there a good way !

Thanks !

0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor

If you have a FeatureQueryResult you are very close!

So the FeatureQueryResult will allow you to iterate over a collection of Features.

For each feature, you will be able to get at the geometry.  Remember that once you've performed your getGeomertry, you will need some logic to downcast to the actual geometry type.  Geometry is the base class, and this will downcast to something like a Point, Polyline or Polygon for example.

It may help to look at the GeometryType in the FeatureQueryResult to help with identifying the type of geometry.

Does that help?

View solution in original post

6 Replies
MarkBaird
Esri Regular Contributor

If you have a FeatureQueryResult you are very close!

So the FeatureQueryResult will allow you to iterate over a collection of Features.

For each feature, you will be able to get at the geometry.  Remember that once you've performed your getGeomertry, you will need some logic to downcast to the actual geometry type.  Geometry is the base class, and this will downcast to something like a Point, Polyline or Polygon for example.

It may help to look at the GeometryType in the FeatureQueryResult to help with identifying the type of geometry.

Does that help?

Nicholas-Furness
Esri Regular Contributor

If you're just extracting JSON for the geometry, you don't even need to downcast. You should be able to just take the Geometry you get back from getGeometry() and call toJson() on it.

DevendraKhatri
New Contributor III

Hi Mark/Nicholas,

I want to draw Circle/Rectangle/Triangle/Arrow geometries in my app with ArcGIS android sdk. 

These geometries are supported in iOS sdk but not in Android, is there any work around or is there a hack. Also, android does not allow rotate/scale/drag of geometry. 

I am using sketch editor for this, do we have any alternative to achieve this ! please suggest 

Need to achieve this anyhow.

Thanks

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi. Could you post this as a new question please as it'll help others discover it?

DevendraKhatri
New Contributor III

I have asked this question already, I did not get any response yet, thought I should ask here.

https://community.esri.com/thread/237774-moverotatescale-geometry-using-sketch-editor

Thanks

0 Kudos
DevendraKhatri
New Contributor III

thanks Mark, it works 

0 Kudos