[postgis-users] Question on INTERSECTION functionality...
Carl Anderson
carl.anderson at vadose.org
Mon Mar 21 19:24:33 PST 2005
Aaron Racicot wrote:
<snip>
> The problem I am having is that while all of my initial polygons are
> MULTIPOLYGON type, the intersection operator returns
> GEOMETRYCOLLECTION for some of the intersections. I read over the
> simple features spec and it seems to imply that some intersections
> will generate shapes that can not be represented anymore as polygons,
> but instead polygons and other types like lines. Is this true?
>
yes difference, symdifference, and intersection may all return geometry
types of other dimensions or
collections of various geometry types.
> If it is, I have a problem in that I can not do the intersection
> operator on GEOMETRYCOLLECTION and therefore can not continue my
> process of breaking down overlapping polygons. Is there any solution
> to this problem? I was hoping that you could do some type of “cast”
> from GEOMETRYCOLLECTION to another type, say MULTIPOLYGON, and get a
> “best” approximation by dropping other geometry types out of the
> collection and just returning the resulting polygons.
>
As long as you desire to ignore the geometries of other dimensions
(
point and multipoint are geometries of dimension 0
linestring and multilinestring are geometries of dimension 1
polygon and multipolygon are geometries of dimension 2
)
you can install and use the attached function to filter geometries.
This
C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filter.sql
Type: text/x-sql
Size: 1907 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050321/f9278613/attachment.bin>
More information about the postgis-users
mailing list