我想使用matplotlib路径。包含\u点对顶点和点使用纬度/经度。在
我需要对lat/lon对进行某种转换才能正常工作吗?这个例子似乎很好用,但我想确保我在所有情况下都能正确使用。在
如果我需要改造,怎么做?在
def point_in_poly(vertices, x, y)
from matplotlib.path import Path as mpPath
path =mpPath(vertices)
point = (x,y)
return path.contains_point(point)
vertices = [(146.0,-42.0),(147.0,-42.0),(147.0,-43.0), (146.0,-43.0)]
print(point_in_poly(vertices, 146.5, -42.5)
谢谢
目前没有回答
相关问题 更多 >
编程相关推荐