<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Spatial Join in Model Buider in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289710#M10013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can do a spatial join by right clicking. You have to select it from the drop down. There are several processes that run prior to the spatial join. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached a copy of the script from model builder and copied below too. Right now there are lots of fields. Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Script arguments&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines_ = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if Snow_Centerlines_ == '#' or not Snow_Centerlines_:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Snow_Centerlines_ = "Snow_Centerlines" # provide a default value if unspecified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines = Snow_Centerlines_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines__2_ = Snow_Centerlines&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Removal_Area_SpatialJoi2 = Snow_Centerlines__2_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Removal_Area__2_ = "Snow_Removal_Area"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Calculate Current Time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Snow_Centerlines_, "Date_Time", "datetime.datetime.now( )", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Calculate Status to Green&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Snow_Centerlines, "Status", "\"Green\"", "PYTHON", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Spatial Join&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tempEnvironment0 = gp.qualifiedFieldNames&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.qualifiedFieldNames = "true"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SpatialJoin_analysis(Snow_Removal_Area__2_, Snow_Centerlines__2_, Snow_Removal_Area_SpatialJoi2, "JOIN_ONE_TO_ONE", "KEEP_ALL", "PERIM \"PERIM\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PERIM,-1,-1;PERIM_U_D \"PERIM_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PERIM_U_D,-1,-1;FEAT_NAME \"FEAT_NAME\" true true false 30 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,FEAT_NAME,-1,-1;PAVED_D \"PAVED_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PAVED_D,-1,-1;AREA_SIZE \"AREA_SIZE\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,AREA_SIZE,-1,-1;AREA_U_D \"AREA_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,AREA_U_D,-1,-1;INSTLN_ID \"INSTLN_ID\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,INSTLN_ID,-1,-1;SUR_USE_D \"SUR_USE_D\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,SUR_USE_D,-1,-1;PRIORITY \"PRIORITY\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PRIORITY,-1,-1;REMARKS \"REMARKS\" true true false 50 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,REMARKS,-1,-1;No_lanes \"No_lanes\" true true false 2 Short 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,No_lanes,-1,-1;Ln_Miles \"Ln_Miles\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Ln_Miles,-1,-1;length \"length\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,length,-1,-1;Road_stat \"Road_stat\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Road_stat,-1,-1;Time_Rep \"Time_Rep\" true true false 30 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Time_Rep,-1,-1;Shape_Length \"Shape_Length\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Shape_Length,-1,-1;Shape_Area \"Shape_Area\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Shape_Area,-1,-1;NUM_LANES \"NUM_LANES\" true true false 4 Long 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,NUM_LANES,-1,-1;USER_FLAG \"USER_FLAG\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,USER_FLAG,-1,-1;INSTLN_ID_1 \"INSTLN_ID\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,INSTLN_ID,-1,-1;LENGTH_U_D \"LENGTH_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,LENGTH_U_D,-1,-1;USE_TYP_D \"USE_TYP_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,USE_TYP_D,-1,-1;ROAD_NAME \"ROAD_NAME\" true true false 64 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,ROAD_NAME,-1,-1;ALT_NAME \"ALT_NAME\" true true false 64 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,ALT_NAME,-1,-1;DIRECTION \"DIRECTION\" true true false 50 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,DIRECTION,-1,-1;GG_CREATED \"GG_CREATED\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,GG_CREATED,-1,-1;GG_REVD \"GG_REVD\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,GG_REVD,-1,-1;Distance \"Distance\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Distance,-1,-1;Distance_Units \"Distance_Units\" true true false 10 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Distance_Units,-1,-1;Hierarcy \"Hierarcy\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Hierarcy,-1,-1;OneWay \"OneWay\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,OneWay,-1,-1;Speed_MPH \"Speed_MPH\" true true false 4 Long 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Speed_MPH,-1,-1;Minutes \"Minutes\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Minutes,-1,-1;SHAPE_Length_1 \"SHAPE_Length\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,SHAPE_Length,-1,-1;Status \"Status\" true true false 10 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Status,-1,-1;Date_Time \"Date_Time\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Date_Time,-1,-1", "INTERSECT", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.qualifiedFieldNames = tempEnvironment0&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jan 2014 14:51:35 GMT</pubDate>
    <dc:creator>DawnBaldridge</dc:creator>
    <dc:date>2014-01-29T14:51:35Z</dc:date>
    <item>
      <title>Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289702#M10005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to spatially join road areas with road center lines after the center line snow removal status has been updated. A spatial join between these two would capture the status of the center line and place it in the road area. I get the results I need when I right-click on the feature class and do a spatial join with attributes. When I build a model and use the spatial join from the Analysis toolbox I don't get the attributes. Is there a work a round for this in model builder? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using ArcInfo 10.0 with no service packs. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just in case....I cannot do a regular join because we have a lot of roads that currently do not have names.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input is appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 12:21:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289702#M10005</guid>
      <dc:creator>DawnBaldridge</dc:creator>
      <dc:date>2014-01-29T12:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289703#M10006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to spatially join road areas with road center lines after the center line snow removal status has been updated. A spatial join between these two would capture the status of the center line and place it in the road area. I get the results I need when I right-click on the feature class and do a spatial join with attributes. When I build a model and use the spatial join from the Analysis toolbox I don't get the attributes. Is there a work a round for this in model builder? &lt;BR /&gt;&lt;BR /&gt;I am using ArcInfo 10.0 with no service packs. &lt;BR /&gt;Just in case....I cannot do a regular join because we have a lot of roads that currently do not have names.&amp;nbsp; &lt;BR /&gt;Any input is appreciated.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no Spatial Join available through right clicking a feature class that I know of, only a standard attribute join.&amp;nbsp; What are you actually choosing when you right click?&amp;nbsp; Spatial Join always creates a new feature class.&amp;nbsp; It never modifies an existing feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you making the Model outputs permanent or getting any output?&amp;nbsp; Model Builder is no different from running the Spatial Join tool in ArcMap directly from the toolbox, except that intermediate data won't be saved and has to be changed to permanent data by right clicking the output and changing that setting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What are you joining to what?&amp;nbsp; In the first line it sounds like polygons would join to the center lines and in the next it sounds like the opposite.&amp;nbsp; The Spatial Join field map list would show what the resulting attributes would be for the Spatial Join.&amp;nbsp; What does it show?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 13:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289703#M10006</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-01-29T13:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289704#M10007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can join features by right clicking on them in the table of contents and select join. When I perform this join with attributes I get the desired results. Even when I run the spatial join tool from the toolbox I get the desired results. But not from model builder. The output data is permanent and I am joining center lines to road areas. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think this may fall under NIM076186 but have not gotten confirmation from ESRI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 13:36:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289704#M10007</guid>
      <dc:creator>DawnBaldridge</dc:creator>
      <dc:date>2014-01-29T13:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289705#M10008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dawn:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You say "When I build a model and use the spatial join from the Analysis toolbox I don't get the attributes."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide a screenshot of how this is configured as it just might be that your configuration settings are not correct for the results that you want to achieve?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 13:58:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289705#M10008</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-29T13:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289706#M10009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I attached a screen shot of the model. I was wondering if my settings were correct. Snow_Removal_Area (2) is a feature layer for data type while the center line file is a table view. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30937[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:22:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289706#M10009</guid>
      <dc:creator>DawnBaldridge</dc:creator>
      <dc:date>2014-01-29T14:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289707#M10010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can join features by right clicking on them in the table of contents and select join. When I perform this join with attributes I get the desired results. Even when I run the spatial join tool from the toolbox I get the desired results. But not from model builder. The output data is permanent and I am joining center lines to road areas. &lt;BR /&gt;I think this may fall under NIM076186 but have not gotten confirmation from ESRI.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well the right click join has nothing to do with a Spatial Join and is only a standard attribute join.&amp;nbsp; Does the model only consist of the the Spatial Join tool, or does it have several geoprocessing tools that run prior to the Spatial join?&amp;nbsp; If there are other tools that run, what are they?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does the model only contain standard toolbox tools and no user developed script tools?&amp;nbsp; User developed script tools often fail to pass field information to other tools in Model Builder resulting in failure to transfer attribute information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What output do you get?&amp;nbsp; Does it contain no fields?&amp;nbsp; Does it only contain target FC fields?&amp;nbsp; Is the Spatial Join a One To One join?&amp;nbsp; Does the field list of the tool in the model show the fields you expect or not?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 10.2 and ran the Spatial Join tool from a model with my data and got an output with the expected field list.&amp;nbsp; I kept all target features and where the search radius tolerance was too small the joined fields contained Null values, but the joined fields were still there.&amp;nbsp; Are you getting none of the join fields at all or just none of the attributes in the join fields, but the join fields themselves are still there?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289707#M10010</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-01-29T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289708#M10011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I really need to see how the Spatial Join tool is configured.&amp;nbsp; Can you get that into a screenshot?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If not, can you export as a python script and paste that into the thread?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289708#M10011</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-29T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289709#M10012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I attached a screen shot of the model. I was wondering if my settings were correct. Snow_Removal_Area (2) is a feature layer for data type while the center line file is a table view. &lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]30937[/ATTACH]&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A Table View should not be accepted at all as a Spatial Join input, but because it is a parameter perhaps the validation does not catch that error.&amp;nbsp; Only a Feature Layer should work as a Spatial Join target or join input.&amp;nbsp; Desktop would not allow you to make this error, but Model Builder cannot catch it because of the way the parameters are configured.&amp;nbsp; The input parameter should be restricted to only accept feature layers.&amp;nbsp; Feature Layers work just as well as a Table View with the Field Calculations you are doing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, because the Join input is a parameter perhaps the tool cannot set up a field list, since it has no idea what fields will be sent to it.&amp;nbsp; Fields will not be inserted at run time or by standard validation, so you would have to manually add the fields to the Spatial Join field list that are expected from the input parameter within that tool in the model.&amp;nbsp; Manual field modifications to the field list can be done for such occasions where Model Builder cannot predict the field inputs, but you can.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Desktop has no equivalent input that corresponds to a Model Builder parameter, so you could never cause this situation by running the tool in Desktop, since Desktop always requires explicitly chosen inputs prior to run time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289709#M10012</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-01-29T14:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289710#M10013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can do a spatial join by right clicking. You have to select it from the drop down. There are several processes that run prior to the spatial join. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached a copy of the script from model builder and copied below too. Right now there are lots of fields. Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Script arguments&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines_ = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if Snow_Centerlines_ == '#' or not Snow_Centerlines_:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Snow_Centerlines_ = "Snow_Centerlines" # provide a default value if unspecified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines = Snow_Centerlines_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines__2_ = Snow_Centerlines&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Removal_Area_SpatialJoi2 = Snow_Centerlines__2_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Removal_Area__2_ = "Snow_Removal_Area"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Calculate Current Time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Snow_Centerlines_, "Date_Time", "datetime.datetime.now( )", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Calculate Status to Green&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Snow_Centerlines, "Status", "\"Green\"", "PYTHON", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Spatial Join&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tempEnvironment0 = gp.qualifiedFieldNames&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.qualifiedFieldNames = "true"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.SpatialJoin_analysis(Snow_Removal_Area__2_, Snow_Centerlines__2_, Snow_Removal_Area_SpatialJoi2, "JOIN_ONE_TO_ONE", "KEEP_ALL", "PERIM \"PERIM\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PERIM,-1,-1;PERIM_U_D \"PERIM_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PERIM_U_D,-1,-1;FEAT_NAME \"FEAT_NAME\" true true false 30 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,FEAT_NAME,-1,-1;PAVED_D \"PAVED_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PAVED_D,-1,-1;AREA_SIZE \"AREA_SIZE\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,AREA_SIZE,-1,-1;AREA_U_D \"AREA_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,AREA_U_D,-1,-1;INSTLN_ID \"INSTLN_ID\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,INSTLN_ID,-1,-1;SUR_USE_D \"SUR_USE_D\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,SUR_USE_D,-1,-1;PRIORITY \"PRIORITY\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,PRIORITY,-1,-1;REMARKS \"REMARKS\" true true false 50 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,REMARKS,-1,-1;No_lanes \"No_lanes\" true true false 2 Short 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,No_lanes,-1,-1;Ln_Miles \"Ln_Miles\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Ln_Miles,-1,-1;length \"length\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,length,-1,-1;Road_stat \"Road_stat\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Road_stat,-1,-1;Time_Rep \"Time_Rep\" true true false 30 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Time_Rep,-1,-1;Shape_Length \"Shape_Length\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Shape_Length,-1,-1;Shape_Area \"Shape_Area\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Removal_Area,Shape_Area,-1,-1;NUM_LANES \"NUM_LANES\" true true false 4 Long 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,NUM_LANES,-1,-1;USER_FLAG \"USER_FLAG\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,USER_FLAG,-1,-1;INSTLN_ID_1 \"INSTLN_ID\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,INSTLN_ID,-1,-1;LENGTH_U_D \"LENGTH_U_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,LENGTH_U_D,-1,-1;USE_TYP_D \"USE_TYP_D\" true true false 16 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,USE_TYP_D,-1,-1;ROAD_NAME \"ROAD_NAME\" true true false 64 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,ROAD_NAME,-1,-1;ALT_NAME \"ALT_NAME\" true true false 64 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,ALT_NAME,-1,-1;DIRECTION \"DIRECTION\" true true false 50 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,DIRECTION,-1,-1;GG_CREATED \"GG_CREATED\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,GG_CREATED,-1,-1;GG_REVD \"GG_REVD\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,GG_REVD,-1,-1;Distance \"Distance\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Distance,-1,-1;Distance_Units \"Distance_Units\" true true false 10 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Distance_Units,-1,-1;Hierarcy \"Hierarcy\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Hierarcy,-1,-1;OneWay \"OneWay\" true true false 20 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,OneWay,-1,-1;Speed_MPH \"Speed_MPH\" true true false 4 Long 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Speed_MPH,-1,-1;Minutes \"Minutes\" true true false 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Minutes,-1,-1;SHAPE_Length_1 \"SHAPE_Length\" false true true 8 Double 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,SHAPE_Length,-1,-1;Status \"Status\" true true false 10 Text 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Status,-1,-1;Date_Time \"Date_Time\" true true false 8 Date 0 0 ,First,#,K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines,Date_Time,-1,-1", "INTERSECT", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.qualifiedFieldNames = tempEnvironment0&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289710#M10013</guid>
      <dc:creator>DawnBaldridge</dc:creator>
      <dc:date>2014-01-29T14:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289711#M10014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can see that you get Snow_Centerlines_ from user input&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Centerlines_ = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I do not see where the source of Snow_Removal_Area__2_ is defined as it seems to just be given a name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Snow_Removal_Area__2_ = "Snow_Removal_Area"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe this is where rfairhur24 is saying that the Model is getting tripped up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you might need to add the Snow_Removal_Area as a feature layer using MakeFeatureLayer_management before using this layer in the spatial join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 15:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289711#M10014</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-29T15:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289712#M10015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;BLOCKQUOTE&gt;You can do a spatial join by right clicking. You have to select it from the drop down. There are several processes that run prior to the spatial join.[/UNQUOTE]&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have never heard of such a thing for Spatial Join and certainly cannot do it from Desktop or ArcCatalog with the out of the box context menu of any layer or feature class.&amp;nbsp; The "Joins and Relates" items in the drop down of the right click menu in Desktop is just a standard Attribute Join, which can accept a Table View.&amp;nbsp; But those Joins are a completely different thing from a Spatial Join, so don't confuse them together.&amp;nbsp; The Spatial Join tool always requires all of its inputs to be spatial feature classes or layers, and should not accept a non-spatial table view for any of its input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't have to run the Make Feature Layer tool, but the input has to be a Feature Class or Feature Layer.&amp;nbsp; Also you would have to extract the path from the input parameter and replace all of the joined field hard coded paths and feature class names in the Spatial Join tool with that path and feature class name variable value, unless the input always came from that hard path and feature class name.&amp;nbsp; Any other input parameter value that did not use that exact path and feature class name for the join input should cause the tool to either fail or drop the fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So every part of the Spatial Join tool field list text would have to be modified to replace K:\\Baldridge\\Snow_Plow_Test\\Snow_test.gdb\\Snow_Centerlines with a path/feature class name variable extracted from the input.&amp;nbsp; Technically you should also include code to validate that the fields names exist in any given input.&amp;nbsp; Not sure how you would use the parameters in Model Builder to replace these hard coded values, but in the Python script it can be done.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 15:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289712#M10015</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-01-29T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289713#M10016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;rfairhur24&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Under Join Data you have a drop-down list in ArcGIS Desktop that allows you to choose "Join data from another layer based on spatial location" which I believe is a Spatial Join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 15:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289713#M10016</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-29T15:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289714#M10017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;rfairhur24&lt;BR /&gt;&lt;BR /&gt;Under Join Data you have a drop-down list in ArcGIS Desktop that allows you to choose "Join data from another layer based on spatial location" which I believe is a Spatial Join.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have taught me something new.&amp;nbsp; I vaguely recall looking at it long ago, but I never tried it before and forgot it even existed (probably because I wanted options that it does not include that the Toolbox version does include).&amp;nbsp; But you are right, that is a dumbed-down version of the Spatial Join.&amp;nbsp; The Context menu Join and Statistics versions are independently coded tools, so they can have different behaviors or bugs from the Toolbox version.&amp;nbsp; I probably will continue to use the Toolbox version, since it gives more options, especially for the summary values of the field list, and the context menu seems limited to the One To One option settings, while I use the One To Many option more often than not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, the key difference between your model and desktop is that you are using a parameter rather than a hard coded input.&amp;nbsp; That is something you cannot do through desktop and it presents complexities that require advanced Model Builder knowledge to troubleshoot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 15:55:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289714#M10017</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-01-29T15:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289715#M10018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I will work through the model and see if this is doable or if it is a bug. Thank you. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mvolz47...I'm glad you taught rfairhur24 something new cause he sure wasn't listening to me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 16:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289715#M10018</guid>
      <dc:creator>DawnBaldridge</dc:creator>
      <dc:date>2014-01-29T16:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join in Model Buider</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289716#M10019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would focus on the configuration of the Spatial Join tool in Model Builder as the export to python shows that the Snow Removal Area feature layer has not been defined in the model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also suggest using python (not that big of a learning curve), so you could have more control of the geoprocess that you are building.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 16:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-in-model-buider/m-p/289716#M10019</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-29T16:28:05Z</dc:date>
    </item>
  </channel>
</rss>

