如何智能降级或平滑 GIS 数据(简化多边形)? [英] How to intelligently degrade or smooth GIS data (simplifying polygons)?

查看:28
本文介绍了如何智能降级或平滑 GIS 数据(简化多边形)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有详细的美国县地图,来自 TIGER LINE 数据集.我如何对数据进行采样、平滑或降级,以便获得更直、更四四方方、更少嘈杂"的形状来表示地理特征——在这种情况下只是县界和州界线,但也许在一般情况下也是如此?

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 生成的多段线——但是任何解决方案,如果您采用波浪线并将其简化为对人类解释器具有大致相同意义的平滑线,则将非常有用.

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.

这种方法的一个很好的例子是 Douglas-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.

这篇关于如何智能降级或平滑 GIS 数据(简化多边形)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆