Combining multiple attributes into one field

8148
13
12-14-2017 03:00 PM
New Contributor III

Hi, I have an interesting problem. I have two separate polygon layers in ArcMap/ArcPro One layer, B, is made up of smaller polygons and contained within another layer, A. B contains an EXT attribute, which can be different, so for example layer B has three polygons completely contained by layer A, and these three polygons have different EXT attributes, say 1, 4 and 7. I would like to merge these EXT attributes into layer A, so that layer A has a field called EXT, containing 1,4,7 from the layer B.

There is nothing unique between these two layers so I cannot do a relate or table join, I can only do a join based on spatial location, or try using dissolve, merge geoprocessing tools. I've tried all of these and haven't gotten the result I want. Is this actually possible? I don't want to sum, or average or range these EXT values. Iwant to preserve them.  I want them all in a new EXT field for A, preferably separated by a space or comma.

Thanks

Reply
0 Kudos
13 Replies
MVP Esteemed Contributor

Union http://pro.arcgis.com/en/pro-app/tool-reference/analysis/union.htm

it combines the attributes into a new layer, whose table can actually be joined/related back to the original if needed.

Reply
0 Kudos
New Contributor III

Yep, I tried that...didn't work....

Reply
0 Kudos
MVP Esteemed Contributor

union will get all the attributes into a table... then you can concatenate the resultant fields together into one field.  It is the first part that needs to be done first

Esri Notable Contributor

Did you get something working, Carl?  Union gave me holes, probably not desirable.

Did you try Spatial Join with the merge rule set to Join?  Spatial Join—Help | ArcGIS Desktop 

Check this out, Attribute field mapping—ArcGIS Pro | ArcGIS Desktop  set the Merge Rule to Join and use a delimiter to separate multiple input values.

Join

A concatenation of source values. You can use a delimiter to separate multiple input values.

Would this work for you?

As with most things, there are a number of other ways to do this (like Attribute Assistant in ArcMap...)  From your description, I think this should work.

Reply
0 Kudos
New Contributor III

Hi , yes I've tried the merge with the join (concatenate) option, creating an extra field and trying to populate it with the outputs from the EXT fields, but it didn't work, like with the union option, I went from a dataset containing ~12,000 polygons to one containing ~76,000 polygons. Both options give me say 4 polygons, instead of a single one. Trying to merge them into one based on a now common attribute means I lose the data.

However, there are big topology issues with these datasets which I need to address first. If you can put me through the steps you did to get to what you have in that screenshot, that would be perfect, I can save it for later....that is exactly what I am looking for!

Reply
0 Kudos
Esri Notable Contributor

Steps carried out in ArcGIS Pro 2.0.1

1. From the Geoprocessing pane, open Spatial Join tool.

2. Target Features = your big polygon layer

   Join Features = your small polygon layer

   Join Operation = Join one to one

   Check Keep All Target Features

   For the field in the output feature class (in my case EXT_1), make sure that the Source is your small polygon layer, set the Merge Rule to Join and the delimiter you want to use.

   Match Option = Intersect

Good luck!

MVP Esteemed Contributor

Definitely the approach I would take.  The only comment I would add is that "JOIN" merge rule is only available if the field being joined is text.  If the EXT field holds numeric, the OP would first want to create a text field and copy the values over.

Occasional Contributor II

How do I use the spatial join tool to list joinging attributes using a comma as a delimiter HOWEVER, only include one instance of each value.

For example I currently get this in my join output layer:

Minerals: coal, limestone, sandstone, coal, coal, limestone, slate.

I want

Minerals: coal, limestone, sandstone, slate

Reply
0 Kudos
Esri Notable Contributor

Something you could try would be to just calculate the field after you've done your overlay to remove duplicates.

This is an attempt at what you're trying to do, but perhaps our friends who are more facile with Python Joshua Bixby‌ and Dan Patterson‌ could provide a more elegant solution.