3

I have a procedure to determine if a point is within a polygon, but id like also add a buffer around the polygon to add search results that are X out of the boundry. How would i do this?

Im programming in php. The procedure used to determine if the point is in the polygon is: http://assemblysys.com/php-point-in-polygon-algorithm/

Any help would be great. Thanks.

Erick Dahl
  • 41
  • 4
  • Essentially, you'll want to look at each of the line segments of the polygons, then calculate the shortest distance between your point and each of those line segments. This article might help: http://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment – Lucas Meyer Apr 11 '13 at 00:39
  • 1
    The simplest solution I could think of would be to scale the polygon by X. You can use Matrix Math for scaling. – bitWorking Apr 11 '13 at 00:43
  • 1
    Scaling would only work for convex polygons. – Angus Johnson Apr 11 '13 at 07:03

0 Answers0