我正在尝试处理以下情况:
- Getting polygon coordinates from google earth
Getting boundaries with Shapely:
>>> polygon = Polygon([(53.349459,-6.260159),(53.349366,-6.260126),(53.349383,-6.260012),(53.349478,-6.260053),(53.349459,-6.260159)]) >>> polygon.bounds (53.349366, -6.260159, 53.349478, -6.260012)
I am getting 2 coordinates, which are 2 border points on the top of my figure.
Getting distance with geopy
And now I am stuck... trying to figure out:
- How to find 2 other border points (in the bottom)
- How to detect whether a user is near (e.g. 3 meters) the polygon from any side? (left, right, up, down). in this case, I need to know not only the edges border points, but also all the border points from left, right, up and down? I can calculate the distance between the user location and the polygon, but what point to from polygon to take dynamically? Can I use existing libs for this, like geopy and Shapely?