0

I have a polygon on my map and I want to resize it in that way I add X km to all of the vertexes. Any idea?

4
  • Resize relative to what? Adding N kilometers to the y dimension and the x dimension of every vertex will simply move the polygon farther away from the zeropoints of the x and y axes of the projection (for latitude, the equator, for example). Commented Jan 30, 2013 at 21:50
  • You do realise that for most polygons this will result in a modified shape? Commented Jan 30, 2013 at 21:52
  • I want to do the same like this: obj.geometry.resize(2, obj.geometry.getCentroid() ); instead of 2 there will be x-km. I'm sorry for the misunderstanding...
    – user14734
    Commented Jan 30, 2013 at 22:17
  • Closely related: gis.stackexchange.com/a/29893.
    – whuber
    Commented Jan 30, 2013 at 22:31

2 Answers 2

3

The spatial operation you need is called BUFFER and is implemented in most geographical database managers

1
  • +1 for this answer... although a general question is, why don't you just redraw the polygon to the specifications that you want?
    – Andy TIce
    Commented Jan 31, 2013 at 5:03
1

if you use geodjango on server side, you can use buffer method in Topological Methods.

polygon.buffer(1000) # 1 km buffer for your polygon

i hope it helps you...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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