Select to view content in your preferred language

Spatial join - field naming - use layer source name, not TOC alias

430
0
07-31-2024 01:34 PM
Status: Open
Labels (1)
wayfaringrob
Honored Contributor

I've run into a problem when removing and re-adding a spatial join to my data. Since I'm close to finishing the project, I've got all my TOC layers renamed with "nice" names. However, it seems that when adding spatial joins, it uses these "nice" names rather than the name in the catalog/disk, which wreaks havoc on everything from popups to symbology once the join is restored.

Below: the name on disk is chiwards_2023_alderinfo. The name in TOC is Wards (Related). After removing and re-adding the join, the field names appear as Wards__Related__, destroying my symbology and popup. Also noticing an extra "chi" before some of the pop-up, which is my next mole to whack...

wayfaringrob_0-1722457814256.png

Yes, I can remove the join, rename, re add, and rename again, but it would be simpler and less prone to errors due to shifts like this if it used a more permanent key (such as the layer name on disk).

 

Update: This doesn't work either, since each successive spatial join adds some kind of index number to the end (e.g. _3). It also throws a message pointing you to a feature class in scratch.gdb that doesn't exist, at least after the tool is done running. I was thinking I could go in there and delete past runs to get the index numbering back down, but this is not the case. Not sure what the solution is here aside from transparency on how fields are named, and user control over layer name prefixes.

Poked around in the spatial join window & field mapping popout and didn't see any controls for this. No mention in the help documentation whatsoever.