Select to view content in your preferred language

Attributes from a layer to another layer by selection

162
4
Jump to solution
a month ago
Labels (2)
SimonLaughton
Regular Contributor

Hello all

I am unsure how to word this correctly so bare with me please!

I have two layers (See image) attached.

The layer which has its attribute table on the left side of the attached image needs to have the Post Code field populated.  The right attribute table is from my polygon layer of postcode areas.

I am after a way to identify / populate my layer using the centroid of each feature and applying the correct postcode from my postcode layer.  I dont fancy manually doing all 1187 features!

I am hoping this is a simple expression I can apply to input the correct postcodes?

 

Thank you!

0 Kudos
1 Solution

Accepted Solutions
RichardHowe
Frequent Contributor

Sure:

1. Open ArcToolbox in Arcmap

2. In Analysis Tools, and Overlay toolset you'll find "Spatial Join"

3. "Target Features" will be the layer you wish to add postcodes to. "Join features" will be your postcode layer. Output feature class will be the thing you are creating, so just pick a geodatabase to save it in, and give it a name.

4. Join operation will be "JOIN_ONE_TO_ONE" and I would leave the "Keep All Target Features" box ticked

5. The field map should generate automatically and will just be a combination of all the fields ion both layers

6. For the Match Option choose "HAVE_THEIR_CENTER_IN"

7. Run the tool. Your output will now be a feature class of the same geometry of yoru target features, but with the addition of all the fields and spatially matching values from your "Join Features" layer

8. It could be that satisfies what you;re lookign for. But in case you want to write back to your original input, if you right click your original layer in the tale of contents select "Joins and relates" and choose "Join". Your field for "1." will be "FID", choose your newly created feature class as the input for "2." and then pick "Target_FID"

9. Once the two layers are joined you should be able to start an edit session, open the attribute table, right click on the empty postcode field and choose "field calculator" and then just scroll down and double click the second postcode field in the fields list. Click OK and hey presto.

10. Right lick the layer again in the table of contents and remove the join once you;re done.

View solution in original post

4 Replies
RichardHowe
Frequent Contributor

You're looking for a spatial join

It will output a new layer, but that layer will contain an original FID field which you can use to join it back to the original data and calculate the field

0 Kudos
SimonLaughton
Regular Contributor

Thanks Richard - could you give me a little step by step if you have the time? 

0 Kudos
RichardHowe
Frequent Contributor

Sure:

1. Open ArcToolbox in Arcmap

2. In Analysis Tools, and Overlay toolset you'll find "Spatial Join"

3. "Target Features" will be the layer you wish to add postcodes to. "Join features" will be your postcode layer. Output feature class will be the thing you are creating, so just pick a geodatabase to save it in, and give it a name.

4. Join operation will be "JOIN_ONE_TO_ONE" and I would leave the "Keep All Target Features" box ticked

5. The field map should generate automatically and will just be a combination of all the fields ion both layers

6. For the Match Option choose "HAVE_THEIR_CENTER_IN"

7. Run the tool. Your output will now be a feature class of the same geometry of yoru target features, but with the addition of all the fields and spatially matching values from your "Join Features" layer

8. It could be that satisfies what you;re lookign for. But in case you want to write back to your original input, if you right click your original layer in the tale of contents select "Joins and relates" and choose "Join". Your field for "1." will be "FID", choose your newly created feature class as the input for "2." and then pick "Target_FID"

9. Once the two layers are joined you should be able to start an edit session, open the attribute table, right click on the empty postcode field and choose "field calculator" and then just scroll down and double click the second postcode field in the fields list. Click OK and hey presto.

10. Right lick the layer again in the table of contents and remove the join once you;re done.

SimonLaughton
Regular Contributor

Legend! (not an Arcmap intended pun).  Thanks mate.