[postgis-users] Slivers -- eliminating programmatically

Josh Livni josh at livniconsulting.com
Sat Mar 17 23:18:32 PDT 2007


Webb,

I probably didn't explain myself very well, but I don't see how that 
method could introduce gaps or overlaps:  All it will do is remove 
overlapping 'slivers'.

What it won't do is 'grow' your district to match a county boundary in 
the case where there is a 'gap' between the district and boundary.

In any case, if simply getting rid of slivers, where a sliver is defined 
as that part of a district that overlaps a county that district is not 
supposed to be located in, then I think the general method I mentioned 
do the trick.

Anyway, I imagine the clipping thing I think you were describing you 
wanted is probably a common scenario - others may have a superior or 
more clear explanation and method to solve it.

  -Josh

Webb Sprague wrote:
> Josh,
>
>> Seems to me that if the centroid of the district is always reliably
>> within the county, then for the purposes of just finding out which
>> districts are in which counties, your current query (centroid/poly) is
>> fine - and faster than a within() with two polygons.
>
> Yes, clipping is just necessary for future database cleaning.
>
>> Without going to the trouble of actually coming up with sql, ways to
>> programmatically 'clip' your districts seem to depend a little on some
>> assumptions.  Assuming once clipped, that inside the correct county
>> there's just one contiguous polygon for the district, then one method
>> might be to select the intersection of the poly tables, and then simply
>> select the largest polygon for each district from the result....
>
> I will think on it.  It seems possible, but slightly dangerous with
> the alternation of gaps (district too small) and overlaps (district
> too big).  Also, I am afraid that I will introduce gaps and overlaps
> near the vertex where two districts meet a county line.
>
> Thx
>
> W
>
>
>>
>>   -Josh
>>
>>
>> Webb Sprague wrote:
>> > 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
>> > _______________________________________________
>> > postgis-users mailing list
>> > postgis-users at postgis.refractions.net
>> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>



  From MAILER-DAEMON  Sun Mar 18 13:01:21 2007
Return-Path: <>
X-Original-To: postgis-users at postgis.refractions.net
Delivered-To: postgis-users at netnation.refractions.net
Received: from mail.inet.dk (mail99.123hotel.dk [80.160.71.178])
	by netnation.refractions.net (Postfix) with ESMTP id B52B72C06F8
	for <postgis-users at postgis.refractions.net>;
	Sun, 18 Mar 2007 13:01:00 -0700 (PDT)
Received: from ([64.40.100.236])
	by mail.inet.dk (80.160.71.178=mail.inet.dk) with SMTP id XXT74623
	for <postgis-users at postgis.refractions.net>;
	Sun, 18 Mar 2007 21:01:23 +0100
Date: Sun, 18 Mar 2007 21:01:23 +0100
From: Martin Hoegh <mh at svaj.dk>
To: <postgis-users at postgis.refractions.net>
Message-Id: <913483819 at mail.inet.dk>
Content-Type: text/plain; charset="utf-8"
Subject: [postgis-users] Re: postgis-users Digest, Vol 53, Issue 18
X-BeenThere: postgis-users at postgis.refractions.net
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
List-Id: PostGIS Users Discussion <postgis-users.postgis.refractions.net>
List-Unsubscribe: <http://postgis.refractions.net/mailman/listinfo/postgis-users>,
	<mailto:postgis-users-request at postgis.refractions.net?subject=unsubscribe>
List-Archive: <http://lists.refractions.net/pipermail/postgis-users>
List-Post: <mailto:postgis-users at postgis.refractions.net>
List-Help: <mailto:postgis-users-request at postgis.refractions.net?subject=help>
List-Subscribe: <http://postgis.refractions.net/mailman/listinfo/postgis-users>,
	<mailto:postgis-users-request at postgis.refractions.net?subject=subscribe>
X-List-Received-Date: Sun, 18 Mar 2007 20:01:21 -0000

Jeg er på forældreorlov indtil d. 14. maj. Mine kollegaer kan traeffes paa tlf. 98129300.

I am on parental leave until May 14. If you have any matter of urgency please do not hesitate to call my collegues on +45 98129300




More information about the postgis-users mailing list