[postgis-users] line simplication

strk strk at freek.keybit.net
Mon Mar 10 02:38:33 PST 2003


dblasby wrote:
> >
> >
> >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.

I've answered to this already... we probably want to keep 1point polygons.
What we could do is merging subobjects closer then the given epsilon.
For example a reduced-to-point polygon close enaught to another polygon
from the same collection could be removed. This should be generalized
for collections (line--polygon--point in same record).

> 
> 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.
> 

Yes, this is true. I've seen thouhg that postgis does not check these
cases at insert time (you can add these polygons with no error raised).
Checking for this kind of invalidity could require a significant amount 
of time, so we could add a parameter stating wheater we DO want integrity
checking or not. For example if we have a middleware that scales the
output those errors could be sistematically removed (for this it would be
worth knowing the maximum distance an hole could be outside its outer ring
and similarly the maximum distance between self-intersdecting rings as 
a function of epsilon - so you can scale output of that amount of input units)

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

You'll have to wait dave :p unless someone else will help me.

--strk;




More information about the postgis-users mailing list