0

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):

Polygon radiuses

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 ?

4
  • 1
    you need to reproject your data into a projection in metres – Ian Turton Oct 17 '17 at 7:49
  • So I should project degrees to cartesian in meters ? – Michal Gallovic Oct 17 '17 at 8:02
  • yes, the exact method will vary depending on your tools. – Ian Turton Oct 17 '17 at 8:07
  • do you think using WGS84 to convert is fine ? – Michal Gallovic Oct 17 '17 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.