I would like to create buffered polygons of locations (towns, villages etc) in order to use them for searching in radius.
This is what I would like to achieve (units for ilustration):
This is how I do it in pyclipper:
import pyclipper coordinates = # Array of lat,lng tuples clipper_offset = pyclipper.PyclipperOffset() coordinates = pyclipper.scale_to_clipper(coordinates) clipper_offset.AddPath(coordinates, pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON) scaled_coordinates = clipper_offset.Execute(1000.0) scaled_coordinates = pyclipper.scale_from_clipper(scaled_coordinates)
Number 1000.0 is arbitrary and my question is - how do I calculate the right offset ratio for Execute method, so that the offset polygon will approximately be offset by 10,20 and 50km ?
Btw. is this the right approach to this problem ?