如何简化形状中的边界几何

问题描述:

我正在整齐地使用GIS,但是在将每个邮政编码的几何图形加载到内存时遇到了内存错误,因为几何图形参差不齐且非常复杂.

I'm working with shapely to do GIS, but I'm running into memory errors when loading the geometry of each zip code into memory because the geometry is so jagged and complicated.

我想通过尽可能减少边界点的数量而不使形状过度失真来使形状更小.使用凸包似乎是一个可能的答案,因为可以简单地从边界上扔掉很多点.我想知道是否已经有解决该问题的东西.

I'd like to make the shape smaller in memory by reducing the number of boundary points as low as possible without distorting the shape too much. Using the convex hull seems like one potential answer, as could simply throwing away lots of points from the boundary. I'm wondering if there's something already out there that solves this problem.

尝试使用几何图形的简化方法,指定公差距离.

Try using the geometry's simplify method, specifying a tolerance distance.