# proximity to a location polygon (Geozone)

Given a set of points (latitude/longitude) that make a location polygon, how would you determine the straight line distance between this polygon and  separate point (lat/long)?  In essence how do we calculate the proximity to the polygon?
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Assuming that the point is outside the polygon, the distance would be the minimum distance from the point to any line segment on the boundary of the polygon.
If the dot product between vector between the end points of a segment and the vector between the first endpoint and the separate point is between 0 and 1, then the closest point on the segment is between the end end points, otherwise it is one of the end points.

If the polygon is small enough that it can be approximated as flat, you can use planar geometry, otherwise, you can use spherical geometry.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
GIS/GPS Programming

From novice to tech pro — start learning today.