Select to view content in your preferred language

find closest xy on a polyline from a point

1301
10
Jump to solution
01-08-2025 06:14 AM
StuartMoore
Frequent Contributor

so this sounds simple and if i use Near in Pro it is but i want to create a AGOL python notebook to run once a day to loop over any point features created that day and get the closest XY to a feature service of polylines (50k features)

i tried following the example here Part 3 - Spatial operations on geometries | ArcGIS API for Python

but even if i just manually populate the geomenty json for both the point and the polyline it returns None

StuartMoore_0-1736345673403.png

 

10 Replies
StuartMoore
Frequent Contributor

thanks @DavidPike  i changed the spatial reference when querying my layers and it works, even gives me the correct distance

 

StuartMoore_0-1736500519723.png