Select to view content in your preferred language

Layer name in new field after merge

7538
10
Jump to solution
09-10-2013 12:36 AM
GeorgHohberg1
Emerging Contributor
I have 50 polygons named P1 to P50 which I want to merge. In another table I have area names associated to P1 - P50. When merging the polygons I cannot find any way to keep the layer names of the origional polygons in order to assign the area names to them. Is there a way to write the layer names of the original polygons in the resulting attribute table?

Thanks for your help in advance!
0 Kudos
1 Solution

Accepted Solutions
GeorgHohberg1
Emerging Contributor
Hey jbarrette,

thanks for your reply. I was talking about 50 layers with one polygon in each.
I solved the problem myself, though. I used "parse path" in the model builder for "reading" the name of each layer and then added it as an attribute to the single polygon layers before merging them.

View solution in original post

0 Kudos
10 Replies
JeffBarrette
Esri Regular Contributor
I'm not clear on the following:

I have 50 polygons named P1 to P50 which I want to merge.

I cannot find any way to keep the layer names of the origional polygons


Does this mean that you have 50 polygon feature classes (aka layers) or is this a single feature class with 50 polygons?

Jeff
0 Kudos
GeorgHohberg1
Emerging Contributor
Hey jbarrette,

thanks for your reply. I was talking about 50 layers with one polygon in each.
I solved the problem myself, though. I used "parse path" in the model builder for "reading" the name of each layer and then added it as an attribute to the single polygon layers before merging them.
0 Kudos
JasonLi1
New Contributor

Not sure if you'll remember this after 6 years, can you explain what you've done to achieve this? I'm currently trying to do this very thing

0 Kudos
GeorgHohberg1
Emerging Contributor

Jason,

I dont't remember what I did, but I could send you the toolbox I used back then and you can figure it out yourself. In order to be able to send you a message you have to follow me, I think. Responding directly to your email did not work.

Georg

0 Kudos
JasonLi1
New Contributor

that'd be helpful, i just followed you back

0 Kudos
JohnBranum
Regular Contributor

Hi guys -

I'm also trying to do the exact same thing.  Can I get in on this?

Thanks,

Johnny

0 Kudos
KevinWyjad
New Contributor

Hi Jason, I'm also trying to do this same thing. Did you sort it out, and if so, would you mind sharing?

0 Kudos
MaxPetri
New Contributor

It's 2024, and still useful, any chance you are still in the business and you can forward the toolbox to me too?

TYIA

Max

0 Kudos
David_Kimball
Occasional Contributor

For anyone coming across this question (8 years later), this functionality is now available in the ArcGIS Pro Merge (Data Management) tool: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/merge.htm

The tool has an "Add source information to output" checkbox - if you check it, it'll add a field named MERGE_SRC to the output:

The values in the MERGE_SRC field will indicate the input dataset path or layer name that is the source of each record in the output.

When I used it, I added layers to the tool from my Map, and the values in the resulting MERGE_SRC field looked like "GroupName\LayerName" (as named in the Map's Contents list). I haven't tried it with data added to the tool directly from browsing - maybe it puts the full pathname if you do it that way.