[postgis-users] Transform overlapping polygons to non-overlapping?
bfraser at geoanalytic.com
Fri Jul 11 09:14:46 PDT 2008
There doesn't seem to be an obvious answer to the problem given below (aka cleaning polygons, creating planar polygons, etc). I did see a note on the PostGIS wiki wishlist to "Add a geometry cleaner". There is also a suggestion to convert to linestrings, node, then polygonize (while that may work for a small set of polygons, I've got 1.1 million to clean). JTS, Geos, etc will likely fail due to the large number of polygons so I'll need a different approach.
I'm considering writing some code to iterate through my table of polygons, cleaning a small subset at a time. I think using PostGIS for the geometry storage and spatial query/selection makes sense. Any suggestions on which API to use?
Brent Fraser wrote:
> I've got a table of overlapping polygons. How can I make it a table of
> non-overlapping polygons?
> For example, if table "polys2" contains two polygons A1 and B1 which
> overlap. I'd like to create table "polys3" with polygons A2, B2, C2,
> where C2 is the overlap region of A1 and B1, and A2 = A1 - C2, and B2 =
> B1 - C2.
> Looking at the overlay operations in the JTS doc it looks like doing an
> Intersection (to get only the overlapping area) then adding the
> Symmetric Difference (to get the non-overlapping areas) might work.
> Am I on the right track or is there an easier way (since all the
> polygons are in one table)?
> Brent Fraser
> postgis-users mailing list
> postgis-users at postgis.refractions.net
More information about the postgis-users