we need some help!
In our Android app, we use the IdentifyTask:
This works well as long as we provide an URL to a map service as input parameter for the IdentifyTask. However, now we would like to use the IdentifyTask in an offline version of our app, i.e. for feature layers that are contained within an offline geodatabase.
How can we do this? Any ideas?
Hello Lageplan Göttingen,
I believe that this identify task is more closely assimilated with the identify server task found here:
What you might want to do instead is work on creating a query against your offline geodatabase and then creating a callout from that query that shows the relevant information. This can be done via a layer query:
I hope this helps!
Hi @Alexander Nohe, thanks for your reply!
However, I am not quite sure how to use LayerQuery to accomplish this task, or if it is even possible.
Here are some more details:
We have six layers with different POIs (one layer for bus stops, one layer for campus security, one layer for parent-child rooms on campus…). The user can either turn off all layers, or activate only the layers they want, or activate all of them. When a layer is activated, small POI icons are shown on the map. The user can then click on the icon to get more information.
The problem is how to find out to which layer a clicked icon belongs, especially if all layers are activated and shown on the map. Of course we could first query the bus stop layer, then the campus security layer, … and so on, until the correct one is found. But this would not be very efficient. That’s why we used the IdentifyTask that identifies features for all layers that are currently activated, and returns an IdentifyResult.
But I am not sure how to do this in an offline environment. “LayerQuery” seems to query features only for a given layer, but we might have up to six layers that need to be queried at the same time….?
The identify task is not supported by local server and would not work on the device. Instead, a more efficient way to query would be to run query features, and then in the query parameters, apply a spatial filter with setGeometry. From there, you can iterate over the feature results and check which result contains data (featureResult.getCount() > 0). Then you can aggregate the results and return them to the user in either a popup or recycler view so the user can select the specific one they would like to identify.
Alexanders reply above looks correct to me, but thought I would also add that we've improved the API for exactly this type of workflow in the current Beta version, so in future you'll be able to use identify methods to identify a tapped feature on any of the layers - Identify features—ArcGIS Runtime SDK for Android (Quartz Beta) | ArcGIS for Developers .