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).– MappingTomorrowCommented Jan 30, 2013 at 21:50
-
You do realise that for most polygons this will result in a modified shape?– lynxlynxlynxCommented 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...– user14734Commented Jan 30, 2013 at 22:17
-
Closely related: gis.stackexchange.com/a/29893.– whuberCommented Jan 30, 2013 at 22:31
Add a comment
|
2 Answers
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? Commented Jan 31, 2013 at 5:03
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...