# Plotting the naval territory of a country

1. Aug 29, 2008

### jbunten

OK, say we have the border of a country represented by a polygon, how do we obtain a new border which at every point has it's nearest point to the country at exactly say 10 miles from it?

Is there an algorithm to do this or is it highly computational?

It's not as simple as it first seems.

2. Aug 29, 2008

### mgb_phys

If you have an equation for each straight line segment, you could generate a parallel line 10miles from it (have to get the sign right for =outside).
Then find the intersect fro each line segment with the next to cut them into a single polygon.
Might not be the most efficent and for a true 10mile limt you would have to round the corners where the line segments meet to a 10mi radius.

There is probably a well known aglorithm for this - try http://www.cgal.org/

3. Aug 29, 2008

### jbunten

That's what I thought, but the problem is far more complex, imagine a bay that goes very far inland (20mi for instance) then 10mi from that bay can be very near to another part of the island, the problem is deceptively complex.

4. Aug 29, 2008

### mgb_phys

Yes, it is tricky.
In image processing it's known as dilation, you use it to close up any gaps in an image and then erode back to the original size before doing operations like character recognition. If you have the map as a bitmap you can probably find an image library thatworks well (eg opencv?)

5. Aug 30, 2008

### jbunten

Hi, fraid not, they would have to exist as a set of coordinates.