質問

イギリスの郡の輪郭を定義する多角形を持っています。これらの形状は非常に詳しく(それぞれ10Kから20Kポイント)、したがって関連する計算をレンダリングする(ポリゴンPのポイントxの場合は?)かなり計算上の高価です。

このように、私の多角形を「サブサンプリング」し、より少ないポイントで似た形状を得ることを望みます。そうするためのさまざまなテクニックは何ですか?

些細なものは、Nポイントを1つにすることです(したがって、ファクタガコドキャロードによるサブサンプリング)が、これが「原油」を感じます。私はむしろポイントの平均化、あるいはその風味の何かをしたいと思います。どんなポインタですか?

役に立ちましたか?

解決

Two solutions spring to mind:

1) since the map of the UK is reasonably squarish, you could choose to render a bitmap with the counties. Assign each a specific colour, and then render the borders with a 1 or 2 pixel thick black line. This means you'll only have to perform the expensive interior/exterior calculation if a sample happens to lie on the border. The larger the bitmap, the less often this will happen.

2) simplify the county outlines. You can use a recursive Ramer–Douglas–Peucker algorithm to recursively simplify the boundaries. Just make sure you cache the results. You may also have to solve this not for entire county boundaries but for shared boundaries only, to ensure no gaps. This might be quite tricky.

他のヒント

Here you can find a project dealing exactly with your issues. Although it works primarily with an area "filled" by points, you can set it to work with a "perimeter" type definition as yours.

It uses a k-nearest neighbors approach for calculating the region.

Samples:

enter image description here

Here you can request a copy of the paper.

Seemingly they planned to offer an online service for requesting calculations, but I didn't test it, and probably it isn't running.

HTH!

Polygon triangulation should help here. You'll still have to check many polygons, but these are triangles now, so they are easier to check and you can use some optimizations to determine only a small subset of polygons to check for a given region or point.

As it seems you have all the algorithms you need for polygons, not only for triangles, you can also merge several triangles that are too small after triangulation or if triangle count gets too high.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top