1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| from shapely.geometry import Point, polygon
Point(0,0).distance(Point(1,1))
polygon = Polygon([(0, 0), (1, 1), (1, 0)]) polygon.area
polygon = Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]) polygon.contains(Point(1, 1)) polygon.contains(Point(3, 2)) polygon.contains(Point(0, 2))
polygon = Polygon([(0, 0), (2, 0), (2, 2), (0, 2)]) polygon.contains(Polygon([(0, 0), (1, 1), (1, 0)])) polygon.contains(Polygon([(0, 0), (1, 1), (1, -1)]))
|