AW: [postgis-users] Detecting holes in geometries

Barend K=?ISO-8859-1?B?9g==?=bben kobben at itc.nl
Fri Aug 24 02:32:02 PDT 2007


Well a multipolygon is just a set of polygons, so going through them and
getting the holes per polygon should work, something like:

 SELECT AsText(InteriorRingN( GeometryN(geom,1),1) AS geometryOfHole from
areas

Should get tyou the first hole in the first polygon of the multipolygon...
Did not check, no PG access at the moment).


On 24-08-2007 11:06, "Thorsten Kraus" <Thorsten.Kraus at ptv.de> wrote:

> Thanks. Unfortunately this function is only defined for polygons, but my
> geometries are of type multipolygon :(
> A cast like this did not help: SELECT AsText(InteriorRingN(geom::POLYGON,1))
> from xxxportugal2dig_s.
> Is there any other possibility to get the hole position out of a multipolygon?
> 
> -----Ursprüngliche Nachricht-----
> Von: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]Im Auftrag von
> Barend Köbben
> Gesendet: Freitag, 24. August 2007 10:59
> An: PostGIS Users Discussion
> Betreff: Re: [postgis-users] Detecting holes in geometries
> 
> 
> 
>  SELECT AsText(InteriorRingN(geom),1) AS geometryOfHole from areas
> 
> Would get you the geometry of the 1st hole as OGC Well-Known Text...
> 
> 
> __ 
> Barend Köbben
> International Institute for Geo-information
> Sciences and Earth Observation (ITC)
> PO Box 6, 7500AA Enschede (The Netherlands)
> ph: +31 (0)53 4874253; fax: +31 (0)53 4874335
> 
> 
> On 24-08-2007 10:15, "Thorsten Kraus" <Thorsten.Kraus at ptv.de> wrote:
> 
>> Hello,
>> 
>> I am able to detect the number of holes in a geometry with the following sql
>> statement:
>> 
>> SELECT SUM(NumInteriorRings(geom)) AS countHoles from areas
>> 
>> Is there any possibility to get the position where the holes are?
>> Regards,
>> Thorsten
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list