Checking Point Containment in a Polygon: Ray Tracing vs. Matplotlib
To determine if a point lies within a polygon, two primary methods are commonly used: ray tracing and Matplotlib's path.contains_points.但是,Shapely的第三个选项为几何计算提供了专门的解决方案。
在基本标记中已显示出更快的速度,如提供的代码中所示。它的速度优势使其成为涉及频繁的点容器检查检查的方案。射线跟踪方法
shapely
Pixel-Based Grid Optimization
In scenarios where a high degree of precision is not required, creating a pixel-based grid of Boolean values can offer an efficient and rapid alternative.通过分配为属于多边形内部的网格元素而分配给外部人员的网格元素,可以使用网格索引计算后续的关闭检查检查。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3