Issues with CreateGeocodeSDDraft

583
2
02-03-2014 05:33 AM
GranSalzwedel
New Contributor
I cannot get the arcpy.CreateGeocodeSDDraft function to work. I have ArcGIS Server 10.2 installed and have the locator path set to the folder containing the geodatabase which has locators in it. Has anyone had any success with this code? Below is my current code:

locator_path = "C:/data/GEODATABASE"
sddraft_file = "C:/data/GeoCoding.sddraft"
sd_file = "C:/data/GeoCoding.sd"
service_name = "test"
summary = "Address locator for " + service_name
tags = "address, locator, geocode"
gis_server_connection_file = "C:/data/" + serverName + ".ags"
             
              analyze_messages  = arcpy.CreateGeocodeSDDraft(locator_path, sddraft_file, service_name,
connection_file_path=gis_server_connection_file,
summary=summary, tags=tags)
Tags (2)
0 Kudos
2 Replies
GranSalzwedel
New Contributor
THIS ESRI!           .
0 Kudos
LucasDanzinger
Esri Frequent Contributor
Your code works for me in the Python window.

>>> locator_path = r"E:\GIS_Data\Runtime_Content\Source\SanFrancisco.gdb\SanFranciscoLocator_DualRange"
>>> sddraft_file = r"C:\Temp\Geocoding.sddraft"
>>> sd_file = r"C:\Temp\Geocoding.sd"
>>> service_name = "test"
>>> summary = "Address Locator for " + service_name
>>> tags = "address,locator,geocode"
>>> gis_server_connection_file = r"C:\Users\luca6804\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\arcgis on sds2-appgrp_6080 (admin)"
>>> analyze_messages = arcpy.CreateGeocodeSDDraft(locator_path, sddraft_file, service_name, connection_file_path=gis_server_connection_file, summary=summary, tags=tags)


Have you tried pointing the locator_path variable to an actual locator and not just the folder that contains the locators? The help specifies the following for this parameter: A string that represents the catalog path to the address locator. Valid formats for the address locator are locator files (.loc) in a file folder or locators in a geodatabase.

If that doesn't do it, can you pleas share the error you are receiving?
0 Kudos