# Selecting MultiPart Polygons if there are buildings in at least two of the parts

my data situation:

shape of polygons (some are MultiPart Poylgons) shape of building locations (Points)

What I need: Select all polygons that have two ore more parts and contain one building or more in at least two of the parts.

What I did so far:

1. I added and calculated a field that tells me if a poylgon has multiple parts. Field calculator Python: `!shape.isMultipart!`

2. I calculated of how many parts each MultiPart Polygon consists. Field calculator Python: `!Shape!.partCount`

Now I have all the MultiPart Polygons with two or more parts selected. From this point, how can I select only the polygons that contain a building in at least two of their parts?

PS: I'm working with ArcGIS

• Welcome to GIS SE! As a new user be sure to take the Tour. Would you be able to edit your question to include the precise procedure or code that you used up to where you are stuck, please? – PolyGeo Sep 7 '15 at 10:37

Someone may be able to provide a better workflow, but here's mine:

1) Your polygons up to now probably look something like this.

2) Explode or use the Multipart to Singlepart tool to convert them into singlepart polygons.

3) Select by Location the exploded (singlepart) polygons that intersect the points and export as a new feature class.

4) With the selected polygon feature class, run a Frequency on how many UnqiueID or ORIG_FID frequency values occurred more than once. These UniqueIDs/ORIG_FIDs are your answer.

5) You can Join the frequency table to your original multipart polygon feature class to create your selection query. Something like `PartCount > 1 AND FREQUENCY > 1`.

Let us know if this works, or if someone else has an easier solution feel free to contribute.

• I skipped the Frequency Step and used Dissolve with summing of the ORIG_FID field. Works perfectly so far. Thank you very much :) – poll_f Sep 8 '15 at 14:02

today I found a even simpler solution. My whole process now looks like this:

Steps:

1. Load shape of areas (some of them are multi part)
2. Explode all to single part
3. Select all polygons with buildings in it
4. Dissolve parts by AreaName and count up occurence of ORIG_FID in the same step.
5. Select everything where COUNT_ORIG_FID is not 1

That results exactly in all multi part polygons, that have buildings in at least two of their parts.