Hi,

If I understand the question correctly, you want to identify polygons which are 
outside of a polygon (including inside the hole of another polygon) but within 
the outer polygon perimeter.

You can do this with a self relation (join a table to itself). Something like:

select t1.name from table t1, table t2
where not ST-Within (t1.geom, t2.geom)
    and ST_Within(t1.geom, ST_Boundary(t2.geom));

To get the count of these, rather than the list of names, try:

select count(t1.name) from table t1, table t2

where not ST-Within (t1.geom, t2.geom)

    and ST_Within(t1.geom, ST_Boundary(t2.geom));

HTH,

 Brent Wood


Sent: Thursday, October 28, 2010 6:07 
  AM
To: PostGIS Users Discussion
Subject: [postgis-users] 
  Selecting polygons circled by one only 
  polygons

Hi,

I have a table of polygon where every 
  polygon can be holed.
And in the hole can be inside another polygon 
  (another record of the table, no multipolygons).

I need to detect all 
  the polygon that are inside a hole of another polygon.

Initially I 
  think this was easy but
after some test I notice this is not so easy 
  because the polygon inside the hole is formerly disjoint from the polygon 
with 
  hole.

For more example I don't search the polygon that are full circled 
  by more than 1 polygon, but only the polygon circled by 1 only 
  polygon

There is some method to detect this type of situations 
  ?


Thx,

Andrea peri.

-- 
  
-----------------
Andrea Peri
. . . . . . . . . 
qwerty 
  àèìòù
-----------------


-----Inline Attachment Follows-----

_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to