[postgis-users] multipolygon polygon test intersects

Christo Du Preez christo at mecola.com
Mon May 28 06:54:17 PDT 2007


Thanx Nicolas,

What if I store my polygons in a geometrycollection instead of a
multipolygon and then use the && operator?

Nicolas Ribot wrote:
>> Hi all,
>>
>> How would I test if a given polygon intersects with one of the polygons
>> currently in a multypolygon geometry?
>>
>> I tried the && operator but if I'm not mistaken it will test the given
>> polygon against the bounding box of the whole multipolygon geometry and
>> not each one individually.
>>
>> Thanx in advance.
>>
>
> Hi,
>
> I think you will have to explode your multipolyons into single
> polygons to do that.
> A multipolygon is considered by postgis as a single object, thus &&
> and overlaps (or other operators) will work on all polygons composing
> the multi.
>
> You can use dump() to generate polygons out of multipolygon, then test
> each individual polygon.
>
> HTH
> Nicolas
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>

-- 
Christo Du Preez

Senior Software Engineer
Mecola IT
Mobile:	 +27 [0]83 326 8087
Skype:	 christodupreez
Website: http://www.locateandtrade.co.za




More information about the postgis-users mailing list