HOW TO
In the migration from ArcGIS Desktop Business Analyst to ArcGIS Pro Business Analyst, the Spatial Overlay tool has been migrated to the Enrich Layer tool. While these tools provide equivalent functionality, there are differences in syntax when utilized as part of an ArcPy script. These differences include:
The names of the input variables are passed directly to the field names in the geoprocessing output, causing the arcpy.ba.spatialoverlay() and arcpy.ba.enrichlayer() tools to write different field names.
When migrating an ArcPy 2.x script to be compatible with ArcGIS Pro and ArcPy 3.x, the Spatial Overlay process must be migrated to the equivalent Enrich Layer process. This migration process requires migrating SelectedSummarizations to match the naming conventions required for the variables parameters to be equivalent with the Business Analyst Platform. Additionally, if the fields created by this process are used in an application, an additional step is needed to revert field names to the arcpy.ba.spatialoverlay() format.
Converting Spatial Overlay Selected Summarizations to Enrich Layer Variables
TSEGNAME;TOTPOP_CY;HHPOP_CY;POPDENS_CY;TOTHH_CY;MEDHINC_CY;AVGHINC_CY;PCI_CY;MEDDI_CY;MP01058h_I;MP01059h_B;MP01059h_I;MP06001a_I;
OR
TSEGNAME.2021 Dominant Tapestry Segment Name (Esri)(USA Esri 2021);TSPOP14_CY.2014 Total Population (Esri 2021)(USA Esri 2021);HHPOP_CY.2021 Household Population (Esri)(USA Esri 2021);POPDENS_CY.2021 Population Density (Pop per Square Mile) (Esri)(USA Esri 2021);TOTHH_CY.2021 Total Households (Esri)(USA Esri 2021);MEDHINC_CY.2021 Median Household Income (Esri)(USA Esri 2021);PCI_CY.2021 Per Capita Income (Esri)(USA Esri 2021);MEDDI_CY.2021 Median Disposable Income (Esri)(USA Esri 2021);MP01058h_I.2021 HH Owns Any Motorcycle: Index(USA Esri 2021);MP01059h_B.2021 HH Bought Any New Motorcycle(USA Esri 2021);MP01059h_I.2021 HH Bought Any New Motorcycle: Index(USA Esri 2021);MP06001a_I.2021 Participated in Any Public Activity Last 12 Mo: Index(USA Esri 2021)
Configuring the Enrich Layer process
Note: Because of enterprise geodatabase field name restrictions, the output of the Enrich Layer process should be created in a file geodatabase, used to stage the input for the next step.
Converting output Field Names to match Spatial Overlay naming convention
Example of the configured Enrich Layer and Feature Class to Feature Class processes
import arcpy input_fc = r"C:\Users\<userid>\Documents\ArcGIS\Default.gdb\input_polygons" enrich_fc = r"C:\Users\<userid>\Documents\ArcGIS\Default.gdb\EnrichLayeroutput" output_gdb = r"C:\Users\<userid>\Documents\ArcGIS\Default.gdb" converted_fc = "Enrichtransform" enrich_variables = "AtRisk.tsegname;Age_by_Sex_by_Race_Profile_rep.totpop_cy;populationtotals.hhpop_cy;populationtotals.popdens_cy;Age_by_Sex_by_Race_Profile_rep.tothh_cy;entertainment.x9066_i;entertainment.x9077_i;entertainment.x9077_x;entertainment.x9079_i" arcpy.ba.EnrichLayer(input_fc, enrich_fc, enrich_variables) arcpy.conversion.FeatureClassToFeatureClass(enrich_fc, output_gdb, converted_fc, '', 'ID "ID" true true false 3 Text 0 0,First,#,EnrichLayer1,ID,0,3;TSEGNAME "2021 Dom Tapestry Segment Name" true true false 8 Double 0 0,First,#,test,AtRisk_tsegname,-1,-1;TOTPOP_CY "2021 Total Population" true true false 8 Double 0 0,First,#,test,Age_by_Sex_by_Race_Profile_rep_totpop_cy,-1,-1;HHPOP_CY "2021 Household Population" true true false 8 Double 0 0,First,#,test,populationtotals_hhpop_cy,-1,-1;POPDENS_CY "2021 Population Density" true true false 8 Double 0 0,First,#,test,populationtotals_popdens_cy,-1,-1;TOTHH_CY "2021 Total Households" true true false 8 Double 0 0,First,#,test,Age_by_Sex_by_Race_Profile_rep_tothh_cy,-1,-1;MEDHINC_CY "2021 Median Household Income" true true false 8 Double 0 0,First,#,test,Health_medhinc_cy,-1,-1;AVGHINC_CY "2021 Average Household Income" true true false 8 Double 0 0,First,#,test,AtRisk_avghinc_cy,-1,-1;PCI_CY "2021 Per Capita Income" true true false 8 Double 0 0,First,#,test,householdincome_pci_cy,-1,-1;MEDDI_CY "2021 Median Disposable Income" true true false 8 Double 0 0,First,#,test,disposableincome_meddi_cy,-1,-1;MP01058h_I "2021 Index: HH Owns Any Motorcycle" true true false 8 Double 0 0,First,#,test,AutomobilesAutomotiveProducts_mp01058h_i,-1,-1;MP01059h_B "2021 HH Bought Any New Motorcycle" true true false 8 Double 0 0,First,#,test,AutomobilesAutomotiveProducts_mp01059h_b,-1,-1;MP01059h_I "2021 Index: HH Bought Any New Motorcycle" true true false 8 Double 0 0,First,#,test,AutomobilesAutomotiveProducts_mp01059h_i,-1,-1;MP06001a_I "2021 Index: Participated in Any Public Activity/12 Mo" true true false 8 Double 0 0,First,#,test,CivicActivitiesPoliticalAffiliation_mp06001a_i,-1,-1;MP06002a_I "2021 Index: Attended Public Mtg On Town/School Affairs/12 Mo" true true false 8 Double 0 0,First,#,test,CivicActivitiesPoliticalAffiliation_mp06002a_i,-1,-1')
Get help from ArcGIS experts
Download the Esri Support App