如何智能地降低或光滑的GIS数据(简化多边形)?多边形、光滑、智能、数据

2023-09-11 01:50:06 作者:猖狂

我有详细的美国地图县,从 TIGER线的数据集。我怎么可能样,光滑或降低数据让我得到直,更四四方方,少噪音的形状,以重新present的地域特点 - 在这种情况下,刚刚县界和国家线,但也许还一般情况下?

I have detailed US county maps, from the TIGER LINE data sets. How might I sample, smooth, or degrade the data so that I get straighter, more boxy, less "noisy" shapes to represent the geographical features -- in this case just county boundaries and state lines, but maybe also in the general case?

采样可能发生在再现的时间,如果能够有效地进行,或者可以被产生并存储的并行数据集。我使用 PostGIS的和线是由 shp2pgsql 生成的多折线 - - 但如果你把一个波浪线,并将其降低到平滑的线大致相同的意义,人际preTER任何解决方案将是非常有用的。

The sampling could happen at rendering time if that can be done efficiently, or a parallel data set could be generated and stored. I am using PostGIS, and the lines are multi-polylines generated by shp2pgsql -- but any solution where you take a squiggly line and reduce it to a smoother line of roughly the same significance to a human interpreter would be very useful.

推荐答案

用简单的扔远点的问题是,你可以迅速歪曲原多边形的形状。更好的方法是要来它从另一个方向;开始与多边形的基本近似,然后向上缩小它朝向你的复杂形状。

The problem with simply throwing away points is that you can quickly distort the shape of the original polygon. A better approach is to come at it from the other direction; start with a basic approximation of the polygon and then refine it upwards towards your complex shape.

这种方法的一个很好的例子就是道格拉斯 - Puecker算法。你开始从完全的多边形绘制两个顶点。通过选择一个位于最远离所述第一两个顶点之间画一条边添加第三顶点。继续添加点,直到你有一些足够类似于原来的多边形。

An excellent example of this approach is the Douglas-Puecker algorithm. You start with two vertices drawn from the full polygon. Add a third vertex by selecting the one that lies farthest from an edge drawn between the first two vertices. Continue adding points until you have something that sufficiently resembles your original polygon.