Select to view content in your preferred language

Looking for samples to check if a point is located inside a polygon

85
1
Tuesday
SanchezNuñez
Occasional Contributor II

Good afternoon,

I am looking to create a service in Python (Geoservice) that will run in ArcGIS Portal and reads a point (customer) and returns the name of the area where the customer is located (parcel)

Two cases:

1) compare point with polygon

2) compare point with point (centroid)

Thanks

 

0 Kudos
1 Reply
David_McRitchie
Esri Contributor

Hey Sanchez, 

The following thread might be of use and provides a useful code sample.

In regards to comparing generated points with the polygon centroid I would build a feature class with centroids first using the Feature to Point tool in ArcPy. From there it depends what you want to compare exactly but for something like distance the Near tool is suitable.

 

Hope that helps,

David

Esri UK -Technical Support Analyst
0 Kudos