# Selecting the greatest Polygons

1993
7
09-13-2012 04:18 AM
Emerging Contributor
[ATTACH=CONFIG]17657[/ATTACH]
I have two Layer. The once Layer contain parcels (green), the other Layer contains bulidings (grey).
Can I select the greatest Polygon by overlapping of the two layers for every parcel?
[ATTACH=CONFIG]17658[/ATTACH]

Tags (4)
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: m.gasior

Here's an another approach:
1. Add "Building_Area" field of long integer type to your buildings feature class (the type is integer because this field will be used in Join later)
2. Fill this field with area - calculate area (Calculate Geometry) or copy values from Shape_Area field (Field Calculator) (decimal part of numbers will be truncated but integer part should be enough to differentiate buildings)
3. Perform Spatial Join: Target Features=Buildings, Join Features=Parcels. You can remove for clarity all fields from Field Map except "BuildingID", "Building_Area", "ParcelID".
4. Perform Summary Statistics on the feature class after spatial join. Statistics Field="Building_Area" with statistics type MAX; Case Field="ParcelID" (you receive a table where you have parcelID and maximum area of a building)
5. Join attributes from the table received in step 4 to original buildings feature class where join field are "Building_Area" and "MAX_Building_Area". You should get a table like that:
[ATTACH=CONFIG]17753[/ATTACH]
6. To select the largest building in a parcel just Select by Attribute those building where "ParcelID" IS NOT NULL.
7 Replies
Honored Contributor
So what you want to do is select the largest building in each parcel, right?
by Anonymous User
Not applicable
Original User: Klaassen

Yes that is right.
MVP Notable Contributor
In modelbuilder this is how I would do it:

1. Use select by location to select all the buildings

2. Export Selection

3. Sort (Descending) exported table based upon polygon area

4. Get first row and the unique ID of the polygon

5. Select by Attribute on the original buildings layer using extracted ID.

If you use the in_memory workspace this should pretty fast.

Duncan
by Anonymous User
Not applicable
Original User: Klaassen

I fear, I have not understood you.
The extend of the polygons are very different. Exist the posibility to comparing the polygons in aech particular parcel?
I have 170000 Polygons (buildings) allotted of 120000 parcels (properties).
Honored Contributor
Maybe you can use Model Builder and iterate through the parcels, selecting the buildings for each iteration and somehow extract the largest building area in the building selection and save that in a field in the parcel layer. Later you could join the building layer with the parcel layer using that area and then mark a field in the parcel layer with the parcel number, unjoin them. This would mark the largest building in each parcel with the parcel number.

Using Model Builder I set up a temp file with a similar situation (several polygons inside larger polygons). I was able to iterate through the large polygons and select by location the smaller ones and sort the smaller selected polygons by shape area descending (put largest on top), but I didn't have time to figure out the rest of the steps.

Maybe an ArcPy script is needed.

[ATTACH=CONFIG]17769[/ATTACH]
Honored Contributor
Here's an image of my Model in Model Builder.

Here I iterate through the larger polygons (cities) select the smaller polygons (parcels) in the big polygons and sort them.

[ATTACH=CONFIG]17736[/ATTACH]
by Anonymous User
Not applicable
Original User: m.gasior

Here's an another approach:
1. Add "Building_Area" field of long integer type to your buildings feature class (the type is integer because this field will be used in Join later)
2. Fill this field with area - calculate area (Calculate Geometry) or copy values from Shape_Area field (Field Calculator) (decimal part of numbers will be truncated but integer part should be enough to differentiate buildings)
3. Perform Spatial Join: Target Features=Buildings, Join Features=Parcels. You can remove for clarity all fields from Field Map except "BuildingID", "Building_Area", "ParcelID".
4. Perform Summary Statistics on the feature class after spatial join. Statistics Field="Building_Area" with statistics type MAX; Case Field="ParcelID" (you receive a table where you have parcelID and maximum area of a building)
5. Join attributes from the table received in step 4 to original buildings feature class where join field are "Building_Area" and "MAX_Building_Area". You should get a table like that:
[ATTACH=CONFIG]17753[/ATTACH]
6. To select the largest building in a parcel just Select by Attribute those building where "ParcelID" IS NOT NULL.