Spatial join without creating a new feature class

03-07-2012 12:57 PM
Status: Implemented
Labels (1)
Occasional Contributor III

We used to be able to do a "spatial join without creating a new feature class" in AV 3.x.  This would be a most useful tool for everyday use it seems without creating useless feature classes that you have to go back and delete.

Esri, can't you bring this tool back from the archives for ArcGIS 10.1.x???

I would really like to see it added to the Toolbox!

hear hear. I couldn't agree more. 
Yet another example of something that worked fine 10 years ago and never should have been 'fixed'. PLEASE bring this back. The workaround is so inefficient.
Even older and perhaps more useful.... the old AtlasGIS product (bought out by ESRI I believe and retired) had a great tool called ASSIGN DATA BY LOCATION which simply copied the values of one or more attributes in one layer to another based on a spatial relationship.  It was not even a permanent join but  it's often all you want and also allows you to copy the ID of the target layer (FIPS code, etc) to the source layer and then do a simple attribute join.  PLEASE bring back - huge time and space saver.
Esta, si, seria una muy buena herramienta
Still no solution for this?
Since, requesting this (ALMOST 2 YRS AGO), I was hoping to have more votes on it or a response from Esri by now.  And a correction on ArcGIS version needs to be updated to something other than 10.1.x, maybe 11.x.x or something.

Esri, can you respond?
Any further update on this?  We just had a need to accomplish this very task of updating an attribute in one feature class from a field in another spatially joined feature class without creating a new one to complete the field calculation.  

Was just about to post this same Idea/request. It was be extremely useful to be able to perform a simple field calculation using a temporary spatial join.

I often need to populated town names or census blocks in a point feature class. Currently it’s a multiple step process of producing an unnecessary new feature class that then needs to be inner-joined to the original desired feature class to carry out the field calculation, and lastly needing to delete the unnecessary feature class because all I wanted was that one field of attributes.

ESRI Please....Thank You

 I actually found this forum as I was researching a solution.  The last post was 2012 so please forgive me for being late to the party.  First let me say that it is a love/hate relationship I have with ArcGIS.  I started back in the ArcInfo 7.2 days when you needed a PHD just to find the command line.  They have come a long way since then and I have grown to appreciate ArcGIS.  The thing is, I had to grow and change myself along the way in order to keep pace.  Otherwise, I was just slamming my head into the screen because the latest release didn't work exactly the way I wanted iot to.

I loved Arc3.x because most anyone with a book and some time could write avenue code, to me even easire than ArcPy these days. 

Having set at the desk many years as a user and eventually migrating to a software provider role, I understand the frustration from both perspectives.  As users, we need tools to work the way we need them to work.  As a provider it is difficult to continually improve the product, retain all previous functionality and meet every users expectations. 

All that said, the whole spatial join things has been eating away at me ever since ESRI retooled from MO to AO in 2000.  I now work in a very mission critical environment, DoD, E911, USMC, etc.  The fact that you have to create a new layer each time you want to bulk transfer attributes just does not cut it. 

I mean it use to be as simple as Spatial Join-[Shape} = [Shape], right?

Now you have to either accept the fact a new layer will be created or manually perform spatial selections and manually calculate values.  That's just not acceptable.

Instead of complaining about something that doesn't seem like it will change I decided to roll my sleeves up and see if I could create a solution.  I'm not a programer, nor an expert in model builder but was able to find video walkthroughs in just a few hours.  I build a model that transfers attributes from a polygon file to a point file based on spatial relation. 

Here's my solution:
  • First interate through each record in the polygon layer. 
  • Capture an attribute from a specific field upon each iteration and store it as a variable. 
  • Tie the polygon iteration to a spatial selection of the point file. 
  • Perform a field calculation for each interation,, passing the variable we captured earlier as an in-line variable too the field calculator.

I'm completely new to this forum and I don't see where I can upload the Model and FGDB.  I'll be happy to share what I have so please advise me as to a method of sharing should be be interested.  

So I challenge everyone to roll those sleeves up, make backups of your data first, create tools, break them just so you can fix them, and get creative.  Sorry not a dig towards anyone, just my very dry attempt of humor.

Attached is an image of the model.  Feel free to contact me and I'll be happy to share the test data and code as well.  




I made several modifications to the model.  It now has several variables and model parameters

You now can specify the selecting feature class, the field you want to transfer from, the feature class and field you want to transfer to, and the relationship class.  I have the selecting feature class filtered to allow only polygons but you can change that if needed. 

Here's the Model exported as a python script.  The blog page doesn't seem to allow me to post the actual model.  If anyone has an idea on how I can share the model then please let me know and I'll be happy to share. 

# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# SP
# Created on: 2014-12-27 13:31:36.00000
#   (generated by ArcGIS/ModelBuilder)
# Usage: SP AttTrans <Feature_Class_used_for_Spatial_Selection> <From_Field> <To_Features> <To_Field> <Chose_Relationship> 
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy

# Load required toolboxes
arcpy.ImportToolbox("Model Functions")

# Script arguments
Feature_Class_used_for_Spatial_Selection = arcpy.GetParameterAsText(0)

From_Field = arcpy.GetParameterAsText(1)

To_Features = arcpy.GetParameterAsText(2)

To_Field = arcpy.GetParameterAsText(3)

Chose_Relationship = arcpy.GetParameterAsText(4)

# Local variables:
Selected_Features = To_Features
Calculated_Features = Selected_Features
Polygons_used_to_Select_other_Features = Feature_Class_used_for_Spatial_Selection
Value = Feature_Class_used_for_Spatial_Selection

# Process: Iterate Feature Selection
arcpy.IterateFeatureSelection_mb(Feature_Class_used_for_Spatial_Selection, "# #", "true")

# Process: Select Layer By Location
arcpy.SelectLayerByLocation_management(To_Features, Chose_Relationship, Polygons_used_to_Select_other_Features, "", "NEW_SELECTION")

# Process: Calculate Field
arcpy.CalculateField_management(Selected_Features, To_Field, "'%Value%'", "PYTHON", "")