[postgis-users] Deleting an arbitrary polygon

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Fri Sep 26 06:08:50 PDT 2008


Oh, I missed your certain % comment.  You would use something like this
in your base query:

Area2d(intersection(a.the_geom,b.the_geom)) / area2d(a.the_geom) as
pct_cover 

And then filter out ones whose pct_cover met your threshold.

r.b.

Robert W. Burgholzer
Surface Water Modeler
Office of Water Supply and Planning
Virginia Department of Environmental Quality
rwburgholzer at deq.virginia.gov
804-698-4405
Open Source Modeling Tools:
http://sourceforge.net/projects/npsource/

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Martin Davis
Sent: Thursday, September 25, 2008 8:13 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Deleting an arbitrary polygon

AFAIK there is no way to do this in a single pass. 

One way to do it iteratively is:
- add a column which will flag features which are "nonoverlapping" (and 
which will be kept)
- choose one feature and flag it as nonoverlapping
- iterate {
    - delete all features which overlap some "nonoverlapping" feature
    - pick an unmarked feature and flag it as "nonoverlapping"
    - exit if all features are flagged as "nonoverlapping"
}

This is probably going to be slow...

Dylan Lorimer wrote:
> Hey PostGIS Friends, here's a problem that's stumping me, hoping you
can help:
>
> I have a bunch of polygons, many of which overlap with each other. I
> would like to trim down the set of polygons to only those that do not
> overlap. I'm not particular about which I delete, so long as they
> overlap by a certain %.
>
> Any thoughts on how to do this? I was trying for a self join but can't
> figure out how to not to delete all polygons that overlap.
>
> Cheers,
> dylan
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list