[postgis-users] noding problem

Kevin Neufeld kneufeld at refractions.net
Wed Oct 24 12:29:02 PDT 2007


Chris Hermansen wrote:
> ...
> If I execute:
>
> select geometryType(st_intersection(pblk.geom,pvri.geom))
> from pblk,pvri
> where pblk.geom && pvri.geom;
>
> I get something quite different than what I expect.  I expect to get
> polygons, and sometimes multipolygons - which I assume arise when the
> intersection process splits up polygons into several constituent parts.
>
> But I also get a bunch of geometrycollections.  And these
> geometrycollections are apparently empty, for example, the first few
> lines of output from the above select:
>
>  numgeometries |    geometrytype   
> ---------------+--------------------
>                | POLYGON
>                | POLYGON
>              0 | GEOMETRYCOLLECTION
>              0 | GEOMETRYCOLLECTION
>                | POLYGON
>              0 | GEOMETRYCOLLECTION
>
> Are these supposed to be there?  What conceivable purpose could they serve?
>
>   
Hi Chris,

Consider the cases where geometry bounding boxes intersect but the 
geometries do not.  In these cases, the intersection will be empty.  You 
probably want to add an additional filter to your query. "WHERE 
pblk.geom && pvri.geom AND distance(pblk.geom, pvri.geom) = 0". (You 
could alternatively use intersects(geometry, geoemetry), but distance==0 
is faster).

Does this help?
-- Kevin



More information about the postgis-users mailing list