Hi,
I have an error while trying to automatize the creation of an address locator. Any idea what can be wrong in my code below?
I only use 1 data table as reference so why this error?
I am using arcpy v10.6
<SPAN class="keyword token">import</SPAN> arcpy
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> <SPAN class="string token">"C:\\Script\\Connexions\\connection.sde\\MyDataSet"</SPAN>
configs <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"IN_ADDRESS_LOCATOR_STYLE"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"General-Single Field"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"IN_REFERENCE_DATA"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"ReferenceDataFC 'Primary Table'"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"IN_FIELD_MAP"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"'Feature ID' ObjectID VISIBLE NONE;'*KeyField' addresse VISIBLE NONE"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"OUT_ADDRESS_LOCATOR"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"C:\\Script\\Output\\MyLocator"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"CONFIG_KEYWORD"</SPAN><SPAN class="punctuation token">:</SPAN> None
<SPAN class="string token">"ENABLE_SUGGESTIONS"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"ENABLED"</SPAN>
<SPAN class="punctuation token">}</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CreateAddressLocator_geocoding<SPAN class="punctuation token">(</SPAN>
in_address_locator_style <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"IN_ADDRESS_LOCATOR_STYLE"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
in_reference_data <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"IN_REFERENCE_DATA"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
in_field_map <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"IN_FIELD_MAP"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
out_address_locator <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"LOC"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
config_keyword <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"CONFIG_KEYWORD"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
enable_suggestions <SPAN class="operator token">=</SPAN> configs<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"ENABLE_SUGGESTIONS"</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I have noticed that if I write "General - Single Field" instead of "General-Single Field" for the in_address_locator_style parameter I got the ERROR 000039: Not enough reference data tables for this style.
This is very confusing...