I'm doing a spatial join between two polygon data sets (A and B). B polygons are always smaller than A polygons and there's only a small number of them. They have 2 attributes that I'd like to pass on to A polygons ('height' and 'area') if A contains B. One A polygon may contain more than one B polygon.

Let's imagine there's a case where 1 A polygon contains 5 B polygons. The 'height' and the 'area' from B that I want to pass on to A are those ones from the B polygon with the maximum 'height'. In ArcGIS Pro -> Geoprocessing I know how to pass the 'height' [Merge Rule -> Maximum]. However, I don't know how to pass also the 'area' from that very same B polygon with max 'height'.

Steps in ArcGIS Pro -> Geoprocessing (to explain what I've done)

  • Choose Target Features
  • Choose Join Features
  • Choose Output Feature Class
  • Join Operation: Join one to one
  • Untick 'Keep all target features'
  • Setting up 'Field Map of Join features'

    • Output field 1: 'Out_height'
    • Source 1: 'Height' (from B) & Merge Rule: 'Maximum'

    • Output field 2: 'Out_area'

    • Source 2: 'Shape_Area' (from B) & Merge Rule: 'Join' (what should I use otherwise if not 'join'??)
  • Match Option: Contains

What I have done in 'Output field 2' will populate 'Out_area' with the area of the A polygon (which will therefore be duplicated) instead of the area of the B polygon with max 'height (which is what I want).

  • How many features in A and in B? I don't know another option you can use in the spatial join to get the desired area of the correct polygon, but you could iterate through Select by Location and Calculate Field, either manually or in arcpy/Model Builder. Or, are these heights guaranteed to be unique between all B? (unlikely) Could you do a join later based on the height? – smiller Jul 17 '18 at 11:47
  • An 'attribute join' later based on the height would not be an option because there's a high chance the height is not unique (thousands of polygons). Not sure I understand 'you could iterate through Select by Location and Calculate Field'. – Pitrako Junior Jul 17 '18 at 11:59
  • Yeah, I didn't think the height was likely to be unique. The iterate through idea would use arcpy due to the large number of polygons in A. Select by Location for Contains B, then access the selection and use python to figure out which row has the maximum height, and return the height and area from that same row. – smiller Jul 17 '18 at 14:12
  • That would mean two loops, am I correct? One to iterate through A polygons (to Select by Location for Contains B) and then another one to iterate through the set of B polygons within each A polygon. Or did you have any other way in mind? – Pitrako Junior Jul 17 '18 at 18:29
  • Could you share a sample of your data? I have an idea, but need to confirm it before sharing. – alecsx Jul 17 '18 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.