[postgis-users] buffer, slice overlaps in two, convert to geography, simplify, dissolve

John Abraham jea at hbaspecto.com
Tue Feb 7 23:19:34 PST 2012


(First, I'm very sorry but I got confused between topology and geography. Obviously Geography isn't going to help here, but Topology could if it deals with slivers implicitly.  However I'm not going to go there now.)

Second, I'm making some progress with an algorithm but I don't know how to select "the part of the polygon that intersects no other polygons in this layer".  I'm doing it using temporary tables with 
ST_Union(the_geom) where other.gid <> my.gid as other_geom
to union all the other polygons, then ST_Difference to find the part of the polygon that doesn't intercept the union of all the others, but I end up with all sorts of TopologyExceptions ("found non-noded intersection") this way.  Isn't there a simpler way to do this part?

The algorithm is like this:
1) simplify
2) buffer (more than you simplified)
3) find the parts of each buffered polygon that intercepts someone else's simplified polygon.
4) remove those parts from my buffered polygon, unless they are also part of my own simplified polygon.

This gives simplified and buffered polygons that overlap, but the overlapping sections do not extend (much) past the simplified boundaries. Now the challenge is to assign the overlapping sections to one polygon or the other, which I could do with a _pgoverlap type of function http://trac.osgeo.org/postgis/wiki/UsersWikiExamplesPolygonOverlaps 

Unfortunately, I get all sorts of non-noded intersection errors :(

--
John 


On 2012-02-07, at 4:46 PM, John Abraham wrote:

> What's the best way to simplify a coverage layer that might have unnecessary holes, slivers, or other details such as non-convexivities?
> 
> Or, if there are overlapping segments, how can I slice them down the middle?
> 
> Details:
> 
> I have a layer of zoning (land use regulation codes) which is based on a union of a cadastral dataset of the zoning of each legal parcel.
> 
> It is quite a complex multipolygon layer, for instance a whole subdivision might have the same zoning except for the road right of ways.  The road areas would have been be "holes" in the cadastral file, so the union looks reasonable at 30000 in a choropleth map without the boundaries drawn, but if you zoom in or draw the boundaries you see all sorts of unnecessary detail about the original cadastral boundaries that isn't necessary to describe the zoning.  The unnecessary detail is visual clutter and also immensely slows down the point-in-polygon operations that I'm doing.
> 
> So what I think I want to do is 
> 
> 1) buffer it to push the boundaries out at least to the midpoint of minor roads (20m should do it.)
> 
> 2) remove overlaps by picking the midpoint of any overlapping segments (so that the zoning for the parcels on both sides of the road get pushed approximately to the centre point of the road), i.e. picking a common boundary between adjacent polygons even if they were separated by a road width before.
> 
> 3) convert it to a geography, maybe?  Sure this would be nice since it would avoid any future sliver problems, but it's not really necessary.  Except it might help with 2) (above) and 4) (below)
> 
> 4) simplify it, just to speed things up and remove unnecessary detail.  But the simplification shouldn't leave (m)any overlaps or slivers, which might mean I should simplify before 1) and 2), or  redo 1) and 2) again after simplifying.
> 
> Is this the right approach?  I know how to buffer 1) and simplify 4).  How can I slice overlapping regions down the middle?  Can I use the geography coverage to help me?
> 
> --
> John

--
John Abraham
jea at hbaspecto.com
403-232-1060








More information about the postgis-users mailing list