Is there any way to get CGAL's polyline simplification to work for inner/shared boundaries?

对着背影说爱祢 提交于 2021-02-10 05:22:08

问题


I've been trying to carry out line simplification on polygons belonging to maps with the help of this CGAL guide, e.g. South Korea.

This is a screenshot of South Korea after line simplification with CGAL.

I carried out the line simplification by adding each polygon to CGAL::Constrained_triangulation_plus_2<CDT> ct and then running CGAL::Polyline_simplification_2::simplify(ct, Cost(), Stop(0.5));.

The outer boundaries will get simplified but the inner/shared boundaries (between provinces) will not. Is there any way to get the inner/shared boundaries simplified too?

I've also attempted to simplify each polygon individually and then combining them back together to form the whole country. The issue, however, is that each polygon would get simplified on its own, and so if Polygon1 gets simplified, there's no guarantee that the shared vertices of the adjacent Polygon2 will relocate to the same coordinates as Polygon1's vertices, and so intersections occur when you put them back together, as will happen with this South Korea map.

Thank you.


回答1:


As you write "shared boundaries" I guess they are there twice, once seen from each province. You have to split the province-polygons where three provinces meet, and then only take one of the two shared boundaries.



来源:https://stackoverflow.com/questions/64779837/is-there-any-way-to-get-cgals-polyline-simplification-to-work-for-inner-shared

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!