[postgis-users] Select polygons within polygon with PostGIS 2.0

Paolo Corti pcorti at gmail.com
Wed Oct 10 05:20:50 PDT 2012


On Wed, Oct 10, 2012 at 12:16 PM, Sandro Santilli <strk at keybit.net> wrote:
>
> One benefit is making the spatial relationships explicit, so that
> you could encode your counties as being composed by the districts,
> and the districts would be composed by faces, which would be defined
> by (shared) edges.
> At that point querying for "all districts in a county" would just be
> a matter of listing the components of a "county" TopoGeometry.
>
> But I guess you're still in the data preparation phase as you still
> don't know which district record belong to which county, right ?
> In that case you'll need ST_Covers (assuming the input data is
> _really_ correct and doesn't contain cases in which the shape
> of a district is slightly outside the shape of its county.
>
> Note that storing the data in a topology would be an excellent way to
> have better control on those kind of data problems (often not easily
> detectable as invisible to the eye).
>
> --strk;
>

+1 for this approach
I have been using it for managing European administrative borders with
excellent results!
regards
p

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti



More information about the postgis-users mailing list