<?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 Create Locator; Using Services as the Data Source in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004720#M24898</link>
    <description>&lt;P&gt;ArcGIS Pro 2.6&lt;/P&gt;&lt;P&gt;Yesterday I successfully created a multi-role locator using the Create Locator tool. Three of the four data sources are rest-end services.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; I've used it before but the data sources were feature classes rather than services.&amp;nbsp; At any rate, here is what I use and the ensuing error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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"&lt;/LI-CODE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Failed to execute. Parameters are not valid.
ERROR 002782: Selected Primary Table does not contain geometry.&lt;/LI-CODE&gt;&lt;P&gt;I don't care for this new code editor as it doesn't list line numbers, but I'll limp through this.&lt;/P&gt;&lt;P&gt;Notice in the field mapping portion it refers to the feature id only; does it need to be fully qualified with the entire url?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1499"&gt;@ShanaBritt&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1420"&gt;@BradNiemand&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:59:37 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2020-11-25T16:59:37Z</dc:date>
    <item>
      <title>Create Locator; Using Services as the Data Source</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004720#M24898</link>
      <description>&lt;P&gt;ArcGIS Pro 2.6&lt;/P&gt;&lt;P&gt;Yesterday I successfully created a multi-role locator using the Create Locator tool. Three of the four data sources are rest-end services.&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; I've used it before but the data sources were feature classes rather than services.&amp;nbsp; At any rate, here is what I use and the ensuing error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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"&lt;/LI-CODE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Failed to execute. Parameters are not valid.
ERROR 002782: Selected Primary Table does not contain geometry.&lt;/LI-CODE&gt;&lt;P&gt;I don't care for this new code editor as it doesn't list line numbers, but I'll limp through this.&lt;/P&gt;&lt;P&gt;Notice in the field mapping portion it refers to the feature id only; does it need to be fully qualified with the entire url?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1499"&gt;@ShanaBritt&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1420"&gt;@BradNiemand&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:59:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004720#M24898</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-11-25T16:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create Locator; Using Services as the Data Source</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004751#M24899</link>
      <description>&lt;P&gt;The &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/geocoding/create-locator.htm" target="_self"&gt;help page has a sample&lt;/A&gt;; I'll see what I need to do to get it to work for me...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 18:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004751#M24899</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-11-25T18:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create Locator; Using Services as the Data Source</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004790#M24900</link>
      <description>&lt;P&gt;Following the example towards the bottom of the help page mentioned, I am trying to create a single role street address locator with a service as the data source: (sorry for the lame code editing, but I'm at the mercy of the new geonet)&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;arcpy.SetLogHistory(False)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;outLocator = r'M:\HansenSQL\HansenGeocoding\TestLocator'&lt;BR /&gt;language = 'ENG'&lt;BR /&gt;country = 'USA'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;inTable = "https://blah/blahlah/rest/services/Transportation/MapServer/0 StreetAddress"&lt;/P&gt;&lt;P&gt;fieldMapping = "'StreetAddress.HOUSE_NUMBER_FROM_LEFT 0.FROMADDR_L';"\&lt;BR /&gt;"'StreetAddress.HOUSE_NUMBER_TO_LEFT 0.TOADDR_L';"\&lt;BR /&gt;"'StreetAddress.HOUSE_NUMBER_FROM_RIGHT 0.FROMADDR_R';"\&lt;BR /&gt;"'StreetAddress.HOUSE_NUMBER_TO_RIGHT 0.TOADDR_R';"\&lt;BR /&gt;"'StreetAddress.STREET_PREFIX_DIR 0.PREDIR';"\&lt;BR /&gt;"'StreetAddress.STREET_NAME 0.NAME';"\&lt;BR /&gt;"'StreetAddress.STREET_SUFFIX_TYPE 0.POSTTYPE';"\&lt;BR /&gt;"'StreetAddress.STREET_SUFFIX_DIR 0.POSTDIR'"&lt;/P&gt;&lt;P&gt;arcpy.geocoding.CreateLocator(country, inTable, fieldMapping, outLocator, language)&lt;/P&gt;&lt;P&gt;However, it errors out with:&lt;/P&gt;&lt;P&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 002782: Selected Primary Table does not contain geometry.&lt;BR /&gt;Failed to execute (CreateLocator).&lt;/P&gt;&lt;P&gt;I can think of two things:&lt;/P&gt;&lt;P&gt;I can get to the service via the create locator tool, but perhaps there is a security setting that does not allow me to hit it with python; I don't think that's it because in a console window I can use arcpy.ListFields(inTable) and get a list.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Creating a locator with a service as the data source simply does not work in python....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1004790#M24900</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-11-25T19:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create Locator; Using Services as the Data Source</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1006004#M24926</link>
      <description>&lt;P&gt;Joe,&lt;/P&gt;&lt;P&gt;You need to call&lt;/P&gt;&lt;P&gt;arcpy.SignInToPortal(“&lt;A href="https://machinename.domainname.com/portal" target="_blank"&gt;https://machinename.domainname.com/portal&lt;/A&gt;”, “username”, “password”)&lt;/P&gt;&lt;P&gt;and then using services as data sources should work just fine for CreateLocator using Python. The data sources need to be on the server federated with the Portal you are signing into.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your data sources are shared with everyone (public) you don’t need to call SignInToPortal() first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 21:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1006004#M24926</guid>
      <dc:creator>BradNiemand</dc:creator>
      <dc:date>2020-12-01T21:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Locator; Using Services as the Data Source</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1006299#M24932</link>
      <description>&lt;P&gt;Turns out the arcpy.SignInToPotal() call isn't needed for me.&amp;nbsp; The game changer is while the create locator tool is able to exploit a map service as a data source, arcpy cannot; arcpy wants a feature service.&lt;/P&gt;&lt;P&gt;The portal I have access to is behind a firewall and is available 'publicly' to those users logged into the network which I am.&amp;nbsp; All I had to do is change the urls to the various feature services and I'm good to go.&lt;/P&gt;&lt;P&gt;One of the data sources in my multi-role locator is on our SDE-Egdb, so it's part of inTable variable as shown below in the final code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
arcpy.env.overwriteOutput = True
arcpy.SetLogHistory(False)

outLocator = r'M:\path_to\my_locator'
language = 'ENG'
country = 'USA'

inTable = "https://www.yady_yady.org/gisfed/rest/services/Internal/FeatureServer/1 PointAddress;"\
          "https://www.yady_yady.org/gisfed/rest/services/Internal/FeatureServer/9 StreetAddress;"\
          "https://www.yady_yady.org/gisfed/rest/services/Internal/FeatureServer/3 Parcel;"\
          "\\\sharedDrive\to\connectionFile.sde\OurSde.AddressGridCoordinatePoints POI"
          
fieldMapping = "'PointAddress.HOUSE_NUMBER 1.ADDR_HN';"\
                "'PointAddress.STREET_PREFIX_DIR 1.ADDR_PD';"\
                "'PointAddress.STREET_NAME 1.ADDR_SN';"\
                "'PointAddress.STREET_SUFFIX_TYPE 1.ADDR_ST';"\
                "'PointAddress.STREET_SUFFIX_DIR 1.ADDR_SD';"\
                "'PointAddress.SUB_ADDRESS_UNIT 1.UNIT_DESIG';"\
                "'PointAddress.CITY 1.CITY';"\
                "'StreetAddress.HOUSE_NUMBER_FROM_LEFT 9.FROMADDR_L';"\
                "'StreetAddress.HOUSE_NUMBER_TO_LEFT 9.TOADDR_L';"\
                "'StreetAddress.HOUSE_NUMBER_FROM_RIGHT 9.FROMADDR_R';"\
                "'StreetAddress.HOUSE_NUMBER_TO_RIGHT 9.TOADDR_R';"\
                "'StreetAddress.STREET_PREFIX_DIR 9.PREDIR';"\
                "'StreetAddress.STREET_NAME 9.NAME';"\
                "'StreetAddress.STREET_SUFFIX_TYPE 9.POSTTYPE';"\
                "'StreetAddress.STREET_SUFFIX_DIR 9.POSTDIR';"\
                "'Parcel.PARCEL_NAME 3.parcel_id';"\
                "POI.PLACE_NAME 'OurSde.AddressGridCoordinatePoints'.Coordinates"
                
arcpy.geocoding.CreateLocator(country, inTable, fieldMapping, outLocator, language)                &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 19:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-locator-using-services-as-the-data-source/m-p/1006299#M24932</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-12-02T19:37:11Z</dc:date>
    </item>
  </channel>
</rss>

