[postgis-users] Slivers -- eliminating programmatically

Webb Sprague webb.sprague at gmail.com
Fri Mar 16 22:28:22 PDT 2007


Hi all,

We have a counties shapefile and a state wide school districts
shapefile that we have imported.  Each of these is internally
consistent (no slivers or gaps) but there are slivers and gaps where a
school district should coincide with a county boundary.  We would like
to adjust the school district boundaries to fit the county whenever
they line up.  We assume the county boundaries are the right ones and
we can just clobber the district boundaries.  Note that many school
districts will have boundaries that only partially align with the
county boundary, but then turn inward; we need to keep the internal
boundaries the same.

Has anybody done this programmatically before?  Or can someone point
me to a discussion? I googled a little, but I couldn't find anything
(at least easily)

Right now, if we want to find "what districts are in county X" we do
something like:

blah blah WHERE within (centroid(district.the_geom), counties.the_geom)

 because a within() or overlaps() on the two sets of polygons will get
messed up from the slivers and gaps issue.

I assume that whatever solution will still need to be checked, because
we probably need to use a tolerance parameter in the alignment
algorithm.

If necessary, I will come up with a tractable example tommorrow.

Thanks
W



More information about the postgis-users mailing list