I'm handling a problem which I find quite difficult to solve;

My input is a changing number of coordinates (real GPS coordinates), usually I get 4-8 coordinates, and another number,which indicates a distance, let's call it $d$,while $d<0$. Using those coordinates , I need to do the following :

First of all , I need to create a polygon. Later on , using this polygon, I need to create another polygon, with edges that are in distance $d$ from the original polygon's edges. Finally ,I need to calculate the area of the second polygon.

I'd like to know if any of you have got a solution to this problem. By solution I also mean a calculation formula or even a JS/PHP library which may handle this task.

Thanks in advnace.


I think this is what you are looking for: how to expand a polygon

  • $\begingroup$ Hey, first of all thanks for the answer. What I need is to get an inner polygon of an existing one, not to expand.Sorry if it was not clear. $\endgroup$ – itamar Aug 29 '14 at 11:36
  • $\begingroup$ I believe the expandPolygon function handles both cases - read the description of the function, specifically: "The input polygon POLY must be oriented counter-clockwise. Otherwise, distance is computed inside the polygon." It also states: "It is also possible to specify negative distance, and get all points inside the polygon." $\endgroup$ – Mufasa Aug 29 '14 at 11:39
  • $\begingroup$ BTW: Here is an algorithm to find the area of any irregular polygon: mathopenref.com/coordpolygonarea2.html $\endgroup$ – Mufasa Aug 29 '14 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.