[postgis-users] minor change to UsersWikiSimplifyWithTopologyExt
Sandro Santilli
strk at kbt.io
Tue Oct 31 06:12:49 PDT 2017
On Mon, Oct 30, 2017 at 04:42:53PM +0100, G. Allegri wrote:
> Hi,
> reading the suggested SQL to generate the simplified edges geoms I thinkg a
> minor change would provide more robust resolults:
>
> Phase 3:
>
> >select ST_Collect(st_simplifyPreserveTopology(geom, 10000)) as geom
>
> should be canged to:
>
> >select ST_SimplifyPreserveTopology(ST_Collect(geom), 10000)) as geom
>
> this guarantees that topology is preserved between edge_data geometries.
> This solved various issues I obtained while applying the original SQL to
> some intricated geometries.
>
> If you agree on this I can modify the wiki page directly.
I think the actual way to preserve topology would be to
pass the result of ST_Simplify (or ST_SimplifyPreserveTopology)
as the input to ST_ChangeEdgeGeom, which would be checking
if topology is preserved and throw an exception otherwise
(which can can catch to reduce tolerance, for example).
The above process is described here:
https://strk.kbt.io/blog/2012/04/13/simplifying-a-map-layer-using-postgis-topology/
--strk;
More information about the postgis-users
mailing list