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?

  • 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). – MappingTomorrow Jan 30 '13 at 21:50
  • You do realise that for most polygons this will result in a modified shape? – lynxlynxlynx Jan 30 '13 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 Jan 30 '13 at 22:17
  • Closely related: http://gis.stackexchange.com/a/29893. – whuber Jan 30 '13 at 22:31

2 Answers2

3

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

  • +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 Jan 31 '13 at 05: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...

urcm
  • 22,533
  • 4
  • 57
  • 109