Select to view content in your preferred language

Select field value A based on largest polygon with field value B

3858
6
01-19-2012 12:10 PM
BettyAlex
Emerging Contributor
I have a set of polygons that have been dissected into sub-polygons to reflect spatial values.  I need to select the spatial value of the largest sub-polygon to use to describe the entire polygon.  I thought Dissolve would work, but it does not always return the spatial value for the largest polygon.  Here is an example of the table: 

Name        Acres     Value
Loc1          1.0         M
Loc1          2.0         N
Loc1          0.5         P    I need to be able to assign Value N to the Loc1 polygon (dissolved on 'Name') because the largest sub-poly value is N. 

I've tried various Dissolves, Selects, etc. but cannot get a file with the correct values.  I also really can't use grid files because the area of the polygon needs to remain consistent.
0 Kudos
6 Replies
RichardFairhurst
MVP Honored Contributor
I have a set of polygons that have been dissected into sub-polygons to reflect spatial values.  I need to select the spatial value of the largest sub-polygon to use to describe the entire polygon.  I thought Dissolve would work, but it does not always return the spatial value for the largest polygon.  Here is an example of the table: 

Name        Acres     Value
Loc1          1.0         M
Loc1          2.0         N
Loc1          0.5         P    I need to be able to assign Value N to the Loc1 polygon (dissolved on 'Name') because the largest sub-poly value is N. 

I've tried various Dissolves, Selects, etc. but cannot get a file with the correct values.  I also really can't use grid files because the area of the polygon needs to remain consistent.


Do it in more than one step.  Use Summary Statistics to get the Max Acres for each Name.  Join the Summary to the original and select where ABS(Acres - Max_Acres) < .001.  Then export that set of records or resumarize it to get the Value field of the largest polygon.  Join that result to all of your original records and recalculate the Value.
TylerDaig
Deactivated User

How would you join it back to the original. It is now a standalone table?

0 Kudos
RichardFairhurst
MVP Honored Contributor

Use a standard ArcMap join on a field.  There are several ways to set it up.  For layers I often right click the layer in the Table of Contents, choose Joins and Relates, and choose Join to bring up the Join dialog.  In the Join dialog I choose the field from my layer that is related to another table, then I choose that other table and the field in that other table that matches.  Then I press OK and the fields from he Join table appear in the table view of my layer.  When you are done with the join you right click the layer, choose Joins and Relates, choose Remove Join(s), and choose Remove All.

From within a Table View a Join can be set up by expanding the Table Options button (ArcMap 10.0 and above), and then using the same menu options that are available from the Layers context menu.

The Geoprocessing tool equivalent is the Join tool and the Remove Join tool (for when you are done with the Join).

TylerDaig
Deactivated User

Thank you for the reply. I am getting off work now, so I will try to wing it again in the morning. I am using model builder and the join would fail saying that they have to be the same type. That is where I am getting the problem. It Will run for 5 minutes or so before it tells me that.

0 Kudos
RichardFairhurst
MVP Honored Contributor

You cannot choose fields that are different fields types between the two tables.  So for example, you cannot join a String field in one table to a Numeric Field in another table.  Numeric fields may only join to Numeric fields, String fields may only join to String Fields and Date Fields may only join to Date fields.  When working in the Desktop with the menu items I mentioned, the dialog only presents fields in the Join table that are the appropriate type to match the field you chose from the Target layer.

In Model Builder I assume there are ways to bypass the safeguards that a Desktop session provides and put in two fields to the Join tool that cannot be joined together.  Make sure the fields in both tables are the same type.  If they are not you can create a new text field in both tables (or in just one table if the other already has it as a Text field) and calculate the data into that new field (all data can convert to Text).

In my original post the user would have created a Summary output with the Name field as a Case field and a Summary of MAX for the Acres field.  The Join would be from the Name field in the original table to the Name field in the Summary Statistics output.

0 Kudos
BettyAlex
Emerging Contributor
Thanks for the QUICK reply! I was trying to figure out a series of steps like that, but kept hitting spots that don't work.  I'll try it first thing in the morning!

Thanks again!
0 Kudos