English 中文(简体)
a. 计算法,将多角分解成/碎块:它称之为什么,什么是法典?
原标题:algorithm to recursively divide a polygon into in/out quadrants: what s it called and where s the code?

I have a lot of points (hundreds of thousands) and I want to check which ones are inside a polygon. For a relatively small polygon (i.e., likely to contain only tens or hundreds of points) I can just use the bounding box of the polygon as an initial check, and then do a regular point-in-poly check for those points inside the box. But imagine a large (i.e., likely to contain thousands of my points), irregularly shaped polygon. Many points will pass the bounding box check, and furthermore the point-in-poly check will be more expensive because the larger polygon is made up of many more points. So I d like to be able to filter most points in or out without having to do the full point-in-poly check.

因此,我有计划,而且我主要想知道,我所说的什么是众所周知的算法,如果是的话,那么它所说的算法,以及我可能为它找到现有的法典。 我不相信我所描述的是哪怕是一 qua树或一tree树,我不知道如何寻找。 I m称其为“红树”。

目的是处理这些较大的多功能:

一种“红树”的预处理方法,即树 depth的深度因多角大小而异(即,使大圆形更加深入)。 rec树将把多角的捆绑箱分割成4/4。 它将检查每季度是否完全在多角大楼内,完全不在多角。 如果两者都不会令人厌恶地分割分界线,则继续如此,直到所有开端完全位于内或外,或达到最大深度为止。 因此,这一想法是:(a) 进行这一树苗的预处理时间,尽管它自己将进行数点对面检查,但却是值得的,因为时间被要检查的点数所冲淡;(b) 绝大多数的点可以通过简单的捆绑箱子检查处理(如你 des树等一些检查),而较少的树木则需要做全点对口的检查(例如,当你到达一个仍在“内部”的叶子时)。

所谓的计算法是什么? 法典在哪里? 事实上,这似乎很难写字,但我是在跳跃加入编码之前,向我提出。

最佳回答

我实际上最后采用一种相关但不同的方法。 我认识到,我所建树结构基本上只不过是在低分辨率基础上形成的多角。 例如,如果我的树木跌至8个深度,这真像是把我的多角推到第256x256号决议的比照图上,然后对多角进行粉碎测试。 因此,我扩大了这一想法,并使用了一个快速制图图书馆(CImg图书馆)。 我以4000x4000的黑白比图绘制多角。 然后,我只对照该比图检查这些要点。 魔法是,绘制这一巨大的蓝图与我建造树木的时间相比,确实很快。 因此,我比我拥有的树子大得多。

一个问题是能够发现多角边缘附近的点,由于四千零四千米大小的四舍五入/分辨率问题,这些点可能被错误地列入或排除。 如果你需要确切了解这些要点是否存在或消失,你就可以在另一肤色的多角周围打上中风,如果你的六氯苯试验击中这个颜色,你就会在多彩的检查中全分。 就我而言,4 000x4000决议是好的(我可以容忍我的某些边点被错误地列入/排斥)。

So the fundamental trick of this solution is the idea that polygon drawing algorithms are just super fast compared to other ways you might "digitize" your polygon.

问题回答

暂无回答




相关问题
Point in rectangle

What is the fastest way to find if a point is in a rectangle given in this form: I have two points which are the centers of opposite sides of the rectangle, and a number which is the height of those ...

Point-in-polygon for a large number of points

I m wondering what may be the most efficient way of determining whether a large number of points (O(1 million) are inside or outside a collection (O(10)) of polygons? The latter are not necessarily ...

Point in Polygon check with SVG and JavaScript?

I have a map that I converted from a raster graphic into an SVG file by converting the differently coloured areas into paths. I know how to do a basic point-in-polygon check given an array of edges, ...

Retrieve set of rectangles containing a specified point

I can t figure out how to implement this in a performing way, so I decided to ask you guys. I have a list of rectangles - actually atm only squares, but I might have to migrate to rectangles later, ...

Algorithm for fast point lookup and line of sight traversal

I m putting together a small library that consumes Geographic Information System (GIS) data and allows for fast point in feature, point near feature, and line of sight queries. Much of this data will ...

Reading in polygons from a Object File Format (.off) file

I need to read in a list of polygons from a Object File Format (.off) file (in c++). The format of .off files is basically like this: Header infomation x y z //co-ords for each vertex ... NVertices ...

Does this mySQL Stored Procedure Work?

I got the following stored procedure from http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html Does this work? CREATE FUNCTION myWithin(p POINT, ...

Delete holes in a Polygon

I have a polygon determined by an Array of Points. This polygon is crossing itself making some holes in the polygon itself. My questions is: How can I omit this holes and just get the exterior ...

热门标签