<?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 Spatial Join Script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/spatial-join-script/m-p/1306599#M68191</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm new to the GIS world and am trying to create a script that creates several Spatial Joins for all of our district school zones.&amp;nbsp; I currently use Model Builder and this is what comes out when I copy and paste the last command from the history panel.&amp;nbsp; I'm trying to understand all the values of the Field Mappings and how I can make a stand-alone script that runs monthly and provides the necessary data for our District's school zoning.&amp;nbsp; Should I be storing all this in a dictionary to reference as I run the spatial join on each shape file?&amp;nbsp; I'm ultimately looking for best practices and how I can run this process monthly without any incorrect data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcpy.analysis.SpatialJoin(&lt;BR /&gt;target_features="DBO.AddressPoints20230602",&lt;BR /&gt;join_features="ProposedBoundaries",&lt;BR /&gt;out_feature_class=r"S:\Zoning2122\MyProject33\Zoning2122\MyProject33\MyProject33.gdb\DBO_SpatialJoinEL",&lt;BR /&gt;join_operation="JOIN_ONE_TO_ONE",&lt;BR /&gt;join_type="KEEP_ALL",&lt;BR /&gt;field_mapping='OBJECTID "OBJECTID" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,OBJECTID,-1,-1;Flag "Flag" true true false 10 Text 0 0,First,#,DBO.AddressPoints20230602,Flag,0,10;ESiteID "ESiteID" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,ESiteID,-1,-1;GPSFLG "GPSFLG" true true false 1 Text 0 0,First,#,DBO.AddressPoints20230602,GPSFLG,0,1;SiteType "SiteType" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,SiteType,0,2;LR "LR" true true false 1 Text 0 0,First,#,DBO.AddressPoints20230602,LR,0,1;Post_Code "Post_Code" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,Post_Code,0,5;ESN "ESN" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,ESN,-1,-1;Long "Long" true true false 8 Double 8 18,First,#,DBO.AddressPoints20230602,Long,-1,-1;Lat "Lat" true true false 8 Double 8 18,First,#,DBO.AddressPoints20230602,Lat,-1,-1;ParcelNum "ParcelNum" true true false 20 Text 0 0,First,#,DBO.AddressPoints20230602,ParcelNum,0,20;PD "PD" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,PD,0,5;PT "PT" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,PT,0,5;St_Name "St_Name" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,St_Name,0,50;St_PosTyp "St_PosTyp" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,St_PosTyp,0,5;St_PosDir "St_PosDir" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,St_PosDir,0,5;ZN "ZN" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,ZN,0,50;Add_Number "Add_Number" true true false 15 Text 0 0,First,#,DBO.AddressPoints20230602,Add_Number,0,15;HouseInt "HouseInt" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,HouseInt,-1,-1;PrimaryAdd "PrimaryAdd" true true false 100 Text 0 0,First,#,DBO.AddressPoints20230602,PrimaryAdd,0,100;AddrLocati "AddrLocati" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,AddrLocati,0,2;PrimaryNam "PrimaryNam" true true false 100 Text 0 0,First,#,DBO.AddressPoints20230602,PrimaryNam,0,100;Alias1 "Alias1" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias1,0,60;Alias2 "Alias2" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias2,0,60;Alias3 "Alias3" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias3,0,60;Alias4 "Alias4" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias4,0,60;Alias5 "Alias5" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias5,0,60;Unit "Unit" true true false 40 Text 0 0,First,#,DBO.AddressPoints20230602,Unit,0,40;County "County" true true false 154 Text 0 0,First,#,DBO.AddressPoints20230602,County,0,154;MailingCit "MailingCit" true true false 254 Text 0 0,First,#,DBO.AddressPoints20230602,MailingCit,0,254;T_MailingC "T_MailingC" true true false 254 Text 0 0,First,#,DBO.AddressPoints20230602,T_MailingC,0,254;Country "Country" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,Country,0,2;State "State" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,State,0,2;Inc_Muni "Inc_Muni" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,Inc_Muni,0,50;DateUpdate "DateUpdate" true true false 8 Date 0 0,First,#,DBO.AddressPoints20230602,DateUpdate,-1,-1;SchoolName "SchoolName" true true false 90 Text 0 0,First,#,ProposedBoundaries,SchoolName,0,90;SchoolNumb "SchoolNumb" true true false 4 Text 0 0,First,#,ProposedBoundaries,SchoolNumb,0,4;Shape_Leng "Shape_Leng" true true false 0 Double 0 0,First,#,ProposedBoundaries,Shape_Leng,-1,-1;Shape__Area "Shape__Area" false true true 0 Double 0 0,First,#,ProposedBoundaries,Shape__Area,-1,-1;Shape__Length "Shape__Length" false true true 0 Double 0 0,First,#,ProposedBoundaries,Shape__Length,-1,-1',&lt;BR /&gt;match_option="INTERSECT",&lt;BR /&gt;search_radius=None,&lt;BR /&gt;distance_field_name=""&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Thanks to anyone who can provide some insight into my endeavor and can hopefully provide insight and learning on how to make this better.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 17:09:08 GMT</pubDate>
    <dc:creator>AnthonyRodriguez1</dc:creator>
    <dc:date>2023-07-07T17:09:08Z</dc:date>
    <item>
      <title>Spatial Join Script</title>
      <link>https://community.esri.com/t5/python-questions/spatial-join-script/m-p/1306599#M68191</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm new to the GIS world and am trying to create a script that creates several Spatial Joins for all of our district school zones.&amp;nbsp; I currently use Model Builder and this is what comes out when I copy and paste the last command from the history panel.&amp;nbsp; I'm trying to understand all the values of the Field Mappings and how I can make a stand-alone script that runs monthly and provides the necessary data for our District's school zoning.&amp;nbsp; Should I be storing all this in a dictionary to reference as I run the spatial join on each shape file?&amp;nbsp; I'm ultimately looking for best practices and how I can run this process monthly without any incorrect data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcpy.analysis.SpatialJoin(&lt;BR /&gt;target_features="DBO.AddressPoints20230602",&lt;BR /&gt;join_features="ProposedBoundaries",&lt;BR /&gt;out_feature_class=r"S:\Zoning2122\MyProject33\Zoning2122\MyProject33\MyProject33.gdb\DBO_SpatialJoinEL",&lt;BR /&gt;join_operation="JOIN_ONE_TO_ONE",&lt;BR /&gt;join_type="KEEP_ALL",&lt;BR /&gt;field_mapping='OBJECTID "OBJECTID" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,OBJECTID,-1,-1;Flag "Flag" true true false 10 Text 0 0,First,#,DBO.AddressPoints20230602,Flag,0,10;ESiteID "ESiteID" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,ESiteID,-1,-1;GPSFLG "GPSFLG" true true false 1 Text 0 0,First,#,DBO.AddressPoints20230602,GPSFLG,0,1;SiteType "SiteType" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,SiteType,0,2;LR "LR" true true false 1 Text 0 0,First,#,DBO.AddressPoints20230602,LR,0,1;Post_Code "Post_Code" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,Post_Code,0,5;ESN "ESN" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,ESN,-1,-1;Long "Long" true true false 8 Double 8 18,First,#,DBO.AddressPoints20230602,Long,-1,-1;Lat "Lat" true true false 8 Double 8 18,First,#,DBO.AddressPoints20230602,Lat,-1,-1;ParcelNum "ParcelNum" true true false 20 Text 0 0,First,#,DBO.AddressPoints20230602,ParcelNum,0,20;PD "PD" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,PD,0,5;PT "PT" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,PT,0,5;St_Name "St_Name" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,St_Name,0,50;St_PosTyp "St_PosTyp" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,St_PosTyp,0,5;St_PosDir "St_PosDir" true true false 5 Text 0 0,First,#,DBO.AddressPoints20230602,St_PosDir,0,5;ZN "ZN" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,ZN,0,50;Add_Number "Add_Number" true true false 15 Text 0 0,First,#,DBO.AddressPoints20230602,Add_Number,0,15;HouseInt "HouseInt" true true false 4 Long 0 10,First,#,DBO.AddressPoints20230602,HouseInt,-1,-1;PrimaryAdd "PrimaryAdd" true true false 100 Text 0 0,First,#,DBO.AddressPoints20230602,PrimaryAdd,0,100;AddrLocati "AddrLocati" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,AddrLocati,0,2;PrimaryNam "PrimaryNam" true true false 100 Text 0 0,First,#,DBO.AddressPoints20230602,PrimaryNam,0,100;Alias1 "Alias1" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias1,0,60;Alias2 "Alias2" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias2,0,60;Alias3 "Alias3" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias3,0,60;Alias4 "Alias4" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias4,0,60;Alias5 "Alias5" true true false 60 Text 0 0,First,#,DBO.AddressPoints20230602,Alias5,0,60;Unit "Unit" true true false 40 Text 0 0,First,#,DBO.AddressPoints20230602,Unit,0,40;County "County" true true false 154 Text 0 0,First,#,DBO.AddressPoints20230602,County,0,154;MailingCit "MailingCit" true true false 254 Text 0 0,First,#,DBO.AddressPoints20230602,MailingCit,0,254;T_MailingC "T_MailingC" true true false 254 Text 0 0,First,#,DBO.AddressPoints20230602,T_MailingC,0,254;Country "Country" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,Country,0,2;State "State" true true false 2 Text 0 0,First,#,DBO.AddressPoints20230602,State,0,2;Inc_Muni "Inc_Muni" true true false 50 Text 0 0,First,#,DBO.AddressPoints20230602,Inc_Muni,0,50;DateUpdate "DateUpdate" true true false 8 Date 0 0,First,#,DBO.AddressPoints20230602,DateUpdate,-1,-1;SchoolName "SchoolName" true true false 90 Text 0 0,First,#,ProposedBoundaries,SchoolName,0,90;SchoolNumb "SchoolNumb" true true false 4 Text 0 0,First,#,ProposedBoundaries,SchoolNumb,0,4;Shape_Leng "Shape_Leng" true true false 0 Double 0 0,First,#,ProposedBoundaries,Shape_Leng,-1,-1;Shape__Area "Shape__Area" false true true 0 Double 0 0,First,#,ProposedBoundaries,Shape__Area,-1,-1;Shape__Length "Shape__Length" false true true 0 Double 0 0,First,#,ProposedBoundaries,Shape__Length,-1,-1',&lt;BR /&gt;match_option="INTERSECT",&lt;BR /&gt;search_radius=None,&lt;BR /&gt;distance_field_name=""&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Thanks to anyone who can provide some insight into my endeavor and can hopefully provide insight and learning on how to make this better.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 17:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatial-join-script/m-p/1306599#M68191</guid>
      <dc:creator>AnthonyRodriguez1</dc:creator>
      <dc:date>2023-07-07T17:09:08Z</dc:date>
    </item>
  </channel>
</rss>

