Hello Keith, There's no easy way I'm afraid but it possible to compute which polygons of a region form holes ("-ve") and which are actual ("+ve"). There is also a work-around which is the option I have chosen for most data development projects.
The problem with identifying holes is that MapInfo regions consist of any number of polygons and the order tells you nothing! The first polygon could well be a hole, etc. There are also cases where you can programmatically build bad regions which have polygons sitting across another polygon and are therefore "half fill and half hole". The way to compute the +ve and -ve polygons is to follow the fill rules used when drawing regions. This is known as the odd-even rule and you can find a good explanation of it at the following URL: http://www.daimi.au.dk/~beta/Manuals/latest/bifrost-ref/bifrost-ref-12.html A polygons centroid is a good place to make tests as it's guaranteed to be within a single-polygon region. So, I guess one test could be... For each polygon within a region, extract the polygon (using ExtractNodes()) and then test if the point is inside each polygon in the region (including the polygon it came from) and count the number of "in's". If the count is odd, it's a +ve (an inclusive area), if even it's a -ve (exclusive area, donut hole, etc.). I've never tried this(!) but I think it would work assuming you have well-formed regions (no self/inter-polygon intersections). One thing that another respondent forgot is that you can have inclusive areas within holes within exclusive areas, etc. For example imagine a three polygon region depicting some land (+ve), with a lake (-ve) and an island (+ve). Only the "count" can really help you. Now the workaround. I decided sometime ago to normalise all my regions so that the major +ve polygon was always first and subsequent polygons were only holes. If I needed to "refill" part of a donut hole, I use another record (i.e. In my example above, the island would be a separate record). It's easy to test that polygons 2+ are in polygon 1 and some simple MapBasic tools give me the ability to reorder polygons in a region. I do other things in normalisation too - such as polygon orientation - but that's another story! Hope that helps. Regards, Warren Vick Europa Technologies Ltd. (U.K.) http://www.europa-tech.com -----Original Message----- From: Campbell, Keith A [mailto:[EMAIL PROTECTED] Sent: 19 November 2003 14:06 To: [EMAIL PROTECTED] Subject: MI-L Identifying Regions with Holes Hi all, Is there any way to identify, by a query or other straightforward process, all regions that have a hole or holes in them? The ObjectInfo function will enable multi-polygon regions to be identified, but I can't see that it will provide what I want. Any suggestions? TIA, Keith ---------------------------------------------- Keith Campbell GIS Consultant ATKINS ENVIRONMENT Cornerstone House Stafford Park 13, Telford Shropshire, TF3 3AZ England Tel: +44 (0)1952 21 3268 * Fax: +44 (0)1952 20 0981 * Email: [EMAIL PROTECTED] * Web: www.atkinsglobal.com <www.atkinsglobal.com> * This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding. --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 9222 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 9249