[postgis-users] Topology: Simplifying Coastlines with Islands

Stephen Woodbridge woodbri at swoodbridge.com
Mon May 28 13:19:01 PDT 2012


On 5/28/2012 3:58 PM, Sandro Santilli wrote:
> On Mon, May 28, 2012 at 02:50:43PM +0200, Michiel J. van Heek wrote:
>> Quoting Sandro Santilli<strk at keybit.net>:
> ...
>>> How do your country boundaries look now ? :)
>>
>> They look pretty good. Most remaining trouble edges are relatively
>> short. Three long coastlines remain problematic: arctic Canada,
>> southern/eastern USA, and Brazil. (Red color in attached
>> screenshot.) Probably because they have some quite large islands
>> very close to the coastline.
>
> "Probably" ? Dissipate any dubt, take a closer look !
> Pick the Brazil coast, looks interesting.
> Zoom in, see the edge which was colliding in the ST_ChangeEdgeGeom
> error message.
>
>> If we want to handle these kind of
>> cases automatically, the easiest way would be to removed the
>> islands, but I don't like that idea, because some islands may be
>> very big, like the arctic islands of Canada. It is like removing
>> Great Britain from the map. :-)
>
> One way would be to split the edge introducing nodes making it
> harder for each sub-edge to collide to anything. I wonder how
> finding such new nodes could be automated. But we're running too
> much. Zoom on the Brazil coast first, and extrapolate the actual
> error message. Oh, note that running a second time might give you
> more successes, so worth reaching a "stable state" before going
> on.

Hi Sandro,

If you can detect that an edge collides with another polygon, then you 
could take the the points where the edge intersects the polygon an 
project them back onto the original edge and split the edge at those 
projected points.

But I'm not sure that helps anything because making it harder does not 
insure success. I think the algorithm needs an additional and 
unfortunately expensive step to validate that there is no collision, 
something like:

1. identify point to be removed between two adjacent edges
2. test the new edge with point removed for collision with other geometry
3. if it collides, rollback that point removal and try the next point 
targeted for removal.

You have to have step 2. to insure topological consistency, otherwise 
you are just hoping for good results unless splitting the edge insures 
the topology consistency the same as an additional test.

Thoughts,
   -Steve



More information about the postgis-users mailing list