How to get a specific ENCFeature without IdentifyLayerAsync in Java runtime

1429
3
10-26-2020 12:24 AM
FuzailSiddiqui
New Contributor III

Hello Esri Community,

I'm working on a Java Desktop application that utilizes the ArcGIS java runtime SDK v100.7.0. I've been provided with a requirement where I need to generate an alert message in the application when my ship/vessel (which has a Point Geometry that moves by certain time) gets near to a highlighted safety depth contour line (present on the ENCLayer) at a user defined distance of let's say 0.3 NM or something (this can vary depending on user input). To implement this, I would need to first get the Polyline Geometry of the safety depth contour line and then use these two geometries and calculate their distance and other such parameters. 

After going through the documentation, I found that I can get the IdentifyLayerResult by calling

MapView.identifyLayerAsyn(Layer, Point2D, tolerance, returnPopupsOnly);

override. But this object gives me only those GeoElements which were identified by the Point2D under the tolerance.

My question is that how can I get a single GeoElement (specifically the ENCFeature) from the ENCLayer without specifying any Point2D screen point ? I do not want to adjust the screen point tolerance value. I want to know if there's a way to get only this ENCFeature (Designated for the Safety Depth Contour line) in my code just by the ENCLayer so that I can extract its attributes and Geometry.

Thanks in Advance.

0 Kudos
3 Replies
by Anonymous User
Not applicable

Hello!

If I'm understanding your requirements correctly it sounds like a reasonable work flow would be to:

1) create a buffer passing in the vessel location point geometry and the user defined distance. This will result in a buffer polygon

2) test whether the buffer polygon geometry from buffer intersects with the highlighted safety depth contour line. This returns a boolean

3) If intersect boolean is true, alert message!

You can checkout a Java sample which uses buffers here and another sample demonstrating spatial relationships (including intersection) here.

Let me know how it goes!

Kind regards,

Trevor

0 Kudos
FuzailSiddiqui
New Contributor III

Hi Trevor,

I'm sorry but I don't think you understand the question or maybe my words weren't clear enough. The safety contour line is not highlighted (it's not highlighted by me giving any screen point). By highlighted I meant to say the contour line that is dark grey bolded which is set by the Safety Contour Depth Value (the line that actually separates the light blue and sky blue sea color). What I wanted to know is that how can I obtain the Polyline geometry of this Safety Contour Line without using IdentifyLayerAsync(...) method. I do not want to pass any screen point. I want to get either all the depth contours in given ENCLayer or the one safety contour line that is bolded. Only then I can perform intersection check as you've mentioned.

Thanks.

0 Kudos
by Anonymous User
Not applicable

Hi Fuzail,

I've spoken with the engineers now and it sounds like there is no way to to obtain the polyline geometry of the Safety Countour Line without using identify. ENC in runtime is based on the S-57 standard which does not permit exposure of the geometry of ENC features.

ENC layers support identify and selection, but not querys, unfortunately.

Kind regards,

Trevor

0 Kudos