I am trying to create a script to:
- Geocode a .CSV file using ArcGIS World Geocoding Service
- Add global IDS
- Append the new feature layer to an existing feature layer
Here is the code I have come up with by going through the various tool reference's
import arcpy
import sys
import os
arcpy.env.workspace = r"C:\Users\vmrenfor\EIRP\EIRP_Sewer_Locates\EIRP_Sewer_Locates\Dapps 2019\Dapps 2019.gdb"
address_table = r"C:\Users\vmrenfor\CSVs\CIVIC\Dapp
address_locator = "ArcGIS_World_Geocoding_Service.loc"
address_fields = "Address Address;City City;County County;State State;ZIP Postal Code"
geocode_result = "Dapp16365"
arcpy.GeocodeAddresses_geocoding(address_table, address_locator, address_fields,
geocode_result, 'STATIC')
arcpy.env.workspace = r"C:\Users\vmrenfor\EIRP\EIRP_Sewer_Locates\EIRP_Sewer_Locates\Dapps 2019\Dapps 2019.gdb"
arcpy.AddGlobalIDs_management("Dapp16365")
arcpy.env.workspace = r"https://services.arcgis.com/T2graiaSQnlmwwmp/arcgis/rest/services/2019_Taplin/FeatureServer"
arcpy.Append_management(["Dapp16365"],
"Sewer Locate Card")
But I get the following error:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geocoding.py", line 332, in GeocodeAddresses
raise e
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geocoding.py", line 329, in GeocodeAddresses
retval = convertArcObjectToPythonObject(gp.GeocodeAddresses_geocoding(*gp_fixargs((in_table, address_locator, in_address_fields, out_feature_class, out_relationship_type, country, location_type, category), True)))
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 496, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Address Locator: Dataset ArcGIS_World_Geocoding_Service.loc does not exist or is not supported
ERROR 000005: Could not open the address locator.
Failed to execute (GeocodeAddresses).
So it appears I am not properly accessing the geocoder to begin with.
Skipping ahead to the Append, I am not sure how to include matching the schema's? The tool reference guide is pretty confusing.
In the Geoprocessing tool window I have:
GlobalID GlobalID
Status USER_Sewer_Status
Address USER_Address
Work_Group USER_Work_Group
City USER_City
Gas_Constr USER_Gas_Construction_Status
.............