python判断地标是否在多边形区域里
2020-11-05 本文已影响0人
吱吱菌啦啦
import sys, geopy.distance, json
from shapely.geometry import Point, Polygon
coords = [
(32.045885,119.00756),
(32.038365,119.041483),
(32.02752,119.072238),
(32.039152,119.072381),
(32.046497,119.077843),
(32.050537,119.075112),
(32.054463,119.074756),
(32.058438,119.075998),
(32.073004,119.071111),
(32.091416,119.067063),
(32.087011,119.027394),
(32.07563,119.006266),
(32.065838,119.003679),
(32.045885,119.00756)
];
area = Polygon(coords)
poi = (32.05590972468656,118.78922570313483)
print(poi)
print(Point(poi).within(area))