[postgis-users] Topology: Simplifying Coastlines with Islands

Sandro Santilli strk at keybit.net
Sat May 26 15:07:49 PDT 2012


On Sat, May 26, 2012 at 10:37:14PM +0200, Michiel J. van Heek wrote:
> Sandro,
>
> I replaced ST_Simplify by ST_SimplifyPreserveTopology, and as a result, 
> like you expected, the coastline of Norway was simplified at the 0.25 
> iteration.
>
> So, why not use ST_SimplifyPreserveTopology by default? Or is that  
> function generally a lot slower than ST_Simplify?

Is a lot slower. 
But the script was just an example, you can tweak the heuristic to
parse the error message and use *PreserveTopology for the 'non-simple'
case, rather than reduce the tolerance. Also, you may want to reduce
less than 1/2. You could have got away with a 0.45. Finally you could
just let that edge go in the first iteration and run a second time.
Some times just letting the function run for other edges automatically
removes the obstacles for next iteration...

Have more fun with topology, and consider sharing your final script
version on the wiki ! :)

--strk;

  ,------o-.
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'



More information about the postgis-users mailing list