Geo Fencing - point inside/outside polygon

后端 未结 16 1740
我在风中等你
我在风中等你 2020-11-28 02:15

I would like to determine a polygon and implement an algorithm which would check if a point is inside or outside the polygon.

Does anyone know if there is any exampl

16条回答
  •  离开以前
    2020-11-28 02:43

    If you have a simple polygon (none of the lines cross) and you don't have holes you can also triangulate the polygon, which you are probably going to do anyway in a GIS app to draw a TIN, then test for points in each triangle. If you have a small number of edges to the polygon but a large number of points this is fast.

    For an interesting point in triangle see link text

    Otherwise definately use the winding rule rather than edge crossing, edge crossing has real problems with points on edges, which if your data is generated form a GPS with limited precision is very likely.

提交回复
热议问题