-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 > Union will have the desired effect, but it isn't the most efficient way > of dealing with the problem. The most efficient way is to iterate over > all the polygons in the MultiPolygon, and drop any which are contained > in another one in the set.
I'm having a hard time figuring out how to do this, because I cannot figure out a way to store a set in a local variable. I need to do something like this: myset := (select ScrubPolygon(geom) from (select (ST_Dump(input)).geom) as x); And then something like this: output := (select ST_Collect(f1.the_geom) from myset f1, myset f2 where not ST_Within(f1.the_geom, f2.the_geom)); But I cannot figure out how to store the set in a variable. AFAIK, it is not possible to declare a variable of type "setoff geometry". I also tried using a temporary table, but there doesn't seem to be a way to create one in the scope of a function call. Another approach would be to collect all the polygons into a single multipolygon and then scrub the nested shells from that, but I have not found a way to efficiently append a polygon to a multipolygon. -----BEGIN PGP SIGNATURE----- Version: PGP Universal 2.8.3 Charset: us-ascii wsBVAwUBSKRxUB6WPRoYuvd0AQhSlQgAsB37OJl3ZA+3+kqJGbwNkQR5Cfqmd/Sf 0n74UED6yKkCmzDy04yDIrIdHInSy3Lm2j9nIBl8nTaeK4ZOSJZcYpvInj0CEDAE OXgU2ij0LUrkRPHo8gmwt5xab8XbHhx/v4Na648nbz917R31vXQwmgK5Oi0+vQxf tMpm7ZQcuSaegkbOsyGL+l0WwY9nGlC9pnFt8y20A04AsD+bIa5l2GBo869qbnJm CcPneGAyb1EwdWqY/ATrjobY97P86jtEQ9d9VsB2+1f34tKQfD0weEHU/Cii1GF1 JH4gNGFVgZgz/yug9nMDwFlEZW1KMpH00/ilHbDzqsYXH/Hojp4ijA== =Grft -----END PGP SIGNATURE----- _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users