3

From ArcGIS Runtime Java API documentation, there is an identifyLayersAsync() method.

From documentation:

Asynchronously identifies the topmost visible geo-element in each identifiable layer attached to the map, near given screen point.

Is there a way to for ArcGIS Runtime to return a single geo-element belonging to any layer, such that it is the topmost element?

P.S. Also asked on gis.stackexchange.

Edit

I'm still having this problem. To rephrase it, I need to find out the feature (that belongs to any layer within a list of layers) that the user has clicked on. The feature returned must be feature that the user thought he/she has clicked on (based on visual judgement).

Additionally, the method must work for both maps and scenes.

I'm going to offer bounty on both sites. At this point I'm quite sure that the API doesn't do this out-of-the-box, so I'm looking for work-around solutions.

Community
  • 1
  • 1
Jai
  • 8,165
  • 2
  • 21
  • 52

1 Answers1

0

I hope I am understanding your question correctly.

There are a few ways you can identify features:

  • You can specify the layer in the stack that you want to identify features from
  • You can Identify for any feature(s) through the entire list of feature layers
  • You can Identify features from the top-most feature layer only

These options are discussed here https://developers.arcgis.com/java/latest/guide/identify-features.htm#ESRI_SECTION1_75682A92F6FA40779E28B68A151F9092

It sounds like you're looking for the second approach?

Eric Bader
  • 31
  • 2
  • That method is exactly the method I pointed out. That methods returns the top-most item in *every* single identifiable layer. All I want is to get a *single* item (that can be from *any* layer) that is intuitively the top-most item from the user's perspective. I forgot to mention that I am using a `Scene` so the features are all 3D as well. – Jai Aug 13 '18 at 02:08
  • Given it's a scene, are you asking for the nearest item? You could follow the topmost item only guide at https://developers.arcgis.com/java/latest/guide/identify-features.htm#ESRI_SECTION1_F295940803A04B96A93CFB6584B36597 except that rather than relying on the layer order, you would use GeometryEngine to calculate the distance to each identified item and pick the nearest: https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#distanceBetween(com.esri.arcgisruntime.geometry.Geometry,%20com.esri.arcgisruntime.geometry.Geometry) – Nixta Aug 13 '18 at 16:00
  • Also, remember that to determine if a layer has something to consider as being topmost, you must ask all layers (or else ask each layer in turn, but that queues up many async web calls in sequence so is very inefficient unless one of the first couple of layers has an item). If you *do* know that in your case, you could queue up calls to identify on a single layer at a time yourself. – Nixta Aug 13 '18 at 16:06