[postgis-users] line simplication

David Blasby dblasby at refractions.net
Thu Feb 27 09:33:33 PST 2003

>I'd like to receive feedback about some issues:
>   1: Some polygon rings reduce to a single point or line (2 or 3 points).
>   2: Some lines reduce to a single point (1 point).
>   3: Points are untouched.
>   When encountering these cases what should the function do ?

I think the primary goal should be to produce valid geometries:

1. remove rings that are are 2 or 3 points.  If its the outer ring, 
remove the entire polygon
2. remove lines that are only one point.  Alternatively, you could 
return a POINT (but the type change will be problematic), or a line with 
the first and last points being the same.

As an aside, if you're simplifying polygons, you're probably running the 
risk of producing non-valid ones.  You could be introducing 
self-intersection  problems or having your holes outside the polygon.

I cannot wait to get this in the main code base!


More information about the postgis-users mailing list