Given a way geometry (from OSM), I would like to convert them to "circles" - a center point + radius guaranteed to contain the whole object. Plus I would need a set of functions to perform various union operations:

  • calculate centroid (already done using shapely)
  • calculate smallest radius that encloses the whole way
  • be able to combine two circles, produce a new center+radius circle that contains both.
  • be able to combine one circle with one point (find a new center + radius that contain previous circle and the node)
  • (simple case) combine two nodes into a circle

Is there a (preferably Python) library to do this? Ideally the library should calculate surface distance rather than direct distance for the radius.

  • i think a circle, enclosing an arbitrary shape, will be the circle enclosing the minimal bounding rectangle (mbr). So you should find your solution by construction the circle as a circumcircle (? "Umkreis" in German) around that MBR. – Andreas Müller Aug 31 '17 at 9:01
  • @AndreasMüller thanks, that's a interesting thought! Is there an algo to measure "width/height" along the earth's curvature for a given bbox? The "width" of such bbox depends on its latitude too, so its not a trivial "west minus east". Hm, spoke too soon - gis.stackexchange.com/questions/59087/… – Yurik Aug 31 '17 at 19:27

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.