Select to view content in your preferred language

Nearest Feature

302
4
08-16-2024 04:13 AM
sonj
by
Occasional Contributor

In arcobjects we used to find the nearestfeature using IIndexQuery. Is there similar functionality in Pro SDK? If not what is the best process to find the "NearestFeature"

4 Replies
Aashis
by Esri Contributor
Esri Contributor

Have you looked into the GeometryEngine.Instance.NearestPoint?

0 Kudos
sonj
by
Occasional Contributor

IIndexQuery takes IFeatureIndex.FeatureClass is my target FeatureLayer so IIndexQuery.NearestFeature will return the feature ID of the target layer. Pro SDK NearestPoint function takes geometry—the objective is to find the nearest feature ID from a specific featurelayer. If I know the geometry my problem is resolved.

0 Kudos
sonj
by
Occasional Contributor

Is there anyone here that can assist me? I did some research on Analysis.Near(). The functionality is almost exactly what we need, except it updates the closest feature ID and adds new fields. We have no desire to update client data.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Hi,

You can create temporary GDB for Analysis.Near(). Clean and fill it with your analysis data each time.

0 Kudos