ArcGIS Pro 2.6
Yesterday I successfully created a multi-role locator using the Create Locator tool. Three of the four data sources are rest-end services.
I would like to automate the task in a python script and things aren't quite working for me and I'm not sure why. The history of the tool is my source for the parameters. I've used it before but the data sources were feature classes rather than services. At any rate, here is what I use and the ensuing error:
countryCode = 'USA'
addressPrimary = r'https://path/to/rest/services/Reference/MapServer/5'
centerlinesPrimary = r'https://path/to/rest/services/Transportation/MapServer/0'
parcelsPrimary = r'https://path/tos/rest/services/Land/MapServer/1'
poiPrimary = r'\\SDE\Connection\To\Our.sde\owner.AddressGridCoordinatePoints'
#primaryReferenceData = "{} PointAddress;{} StreetAddress;{} POI".format(addressPrimary,centerlinesPrimary,
#parcelsPrimary)
primaryReferenceData = f'{addressPrimary} PointAddress;{centerlinesPrimary} StreetAddress;{parcelsPrimary} Parcel;{poiPrimary} POI'
outLocator = r'M:\HansenSQL\HansenGeocodingTestMultiRole'
fieldMapping = "'PointAddress.HOUSE_NUMBER 5.ADDR_HN';"\
"'PointAddress.STREET_PREFIX_DIR 5.ADDR_PD';"\
"'PointAddress.STREET_NAME 5.ADDR_SN';"\
"'PointAddress.STREET_SUFFIX_TYPE 5.ADDR_ST';"\
"'PointAddress.STREET_SUFFIX_DIR 5.ADDR_SD';"\
"'PointAddress.SUB_ADDRESS_UNIT 5.UNIT_DESIG';"\
"'PointAddress.CITY 5.CITY';"\
"'StreetAddress.HOUSE_NUMBER_FROM_LEFT 0.FROMADDR_L';"\
"'StreetAddress.HOUSE_NUMBER_TO_LEFT 0.TOADDR_L';"\
"'StreetAddress.HOUSE_NUMBER_FROM_RIGHT 0.FROMADDR_R';"\
"'StreetAddress.HOUSE_NUMBER_TO_RIGHT 0.TOADDR_R';"\
"'StreetAddress.STREET_PREFIX_DIR 0.PREDIR';"\
"'StreetAddress.STREET_NAME 0.NAME';"\
"'StreetAddress.STREET_SUFFIX_TYPE 0.POSTTYPE';"\
"'StreetAddress.STREET_SUFFIX_DIR 0.POSTDIR';"\
"'Parcel.PARCEL_NAME 1.parcel_id';"\
"POI.PLACE_NAME 'owner.AddressGridCoordinatePoints'.Coordinates"Error:
Failed to execute. Parameters are not valid.
ERROR 002782: Selected Primary Table does not contain geometry.
I don't care for this new code editor as it doesn't list line numbers, but I'll limp through this.
Notice in the field mapping portion it refers to the feature id only; does it need to be fully qualified with the entire url?
@ShanaBritt
@BradNiemand