<?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 Re: Access existing address locator properties with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137658#M10766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should also mention I tried the append() method to just add those lines to the .loc file but this breaks the locator. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2018 13:57:16 GMT</pubDate>
    <dc:creator>Lake_Worth_BeachAdmin</dc:creator>
    <dc:date>2018-01-29T13:57:16Z</dc:date>
    <item>
      <title>Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137655#M10763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my question is similar to this one: &lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/459758?commentID=459758#comment-459758?q=accessing%20address%20locator%20properties%20via%20arcpy" title="https://community.esri.com/message/459758?commentID=459758#comment-459758?q=accessing%20address%20locator%20properties%20via%20arcpy"&gt;https://community.esri.com/message/459758?commentID=459758#comment-459758?q=accessing%20address%20locator%20properties%2…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Desktop 10.5.1&lt;/P&gt;&lt;P&gt;I am automating the process of creating an address locator with arcpy. Everything works fine however I need to adjust the properties of the locator after its created under the "geocode options" menu I need to change the values for the "&lt;EM&gt;match without house number&lt;/EM&gt;" and "&lt;EM&gt;match with no zones&lt;/EM&gt;" both need to be set to value "&lt;STRONG&gt;Yes&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/395021_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I access this via arcpy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is&amp;nbsp; across post on stack exchange as well: &lt;A class="link-titled" href="https://gis.stackexchange.com/questions/269382/arcmap-10-5-1-address-locator-properties-via-arcpy" title="https://gis.stackexchange.com/questions/269382/arcmap-10-5-1-address-locator-properties-via-arcpy"&gt;geocoding - arcmap 10.5.1 address locator properties via arcpy - Geographic Information Systems Stack Exchange&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137655#M10763</guid>
      <dc:creator>Lake_Worth_BeachAdmin</dc:creator>
      <dc:date>2018-01-26T20:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137656#M10764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;There isn't any direct property access via ArcPy but you can do what you want by editing (in code) the .loc file component of the locator (or each .loc file in a composite locator, being careful that the locator supports house numbers and zones in the first place).&lt;/P&gt;&lt;P&gt;Edit or insert lines so that you have the below lines in the .loc file(s):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;supportsEmptyHouseNumber = true&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;supportsOptionalZone = true&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jan 2018 21:27:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137656#M10764</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2018-01-26T21:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137657#M10765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the Info Bruce, there is an issue though. the .loc file does not contain these fields originally. You have to manually enable them within arcmap/catalog then the .loc file will append those values. I tried using the code below directly after creating the locator (no errors) but it cannot replace the false with true values because they are not inside the .loc file after being created. if you create a locator open the .loc file you wil see none of the extended properties are present. if you set them inside catalog then open the .loc file you will see they are present. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;with open(r"Y:\path\to\locator.loc", 'r') as file :&lt;BR /&gt;&amp;nbsp; filedata = file.read()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Replace the target string&lt;BR /&gt;filedata1 = filedata.replace("supportsEmptyHouseNumber = false", "supportsEmptyHouseNumber = true")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filedata2 = filedata.replace("supportsOptionalZone = false", "supportsOptionalZone = true")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Write the file out again&lt;BR /&gt;with open(r"Y:\path\to\locator.loc", 'w') as file:&lt;BR /&gt;&amp;nbsp; file.write(filedata1)&lt;BR /&gt;&amp;nbsp; file.write(filedata2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 13:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137657#M10765</guid>
      <dc:creator>Lake_Worth_BeachAdmin</dc:creator>
      <dc:date>2018-01-29T13:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137658#M10766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should also mention I tried the append() method to just add those lines to the .loc file but this breaks the locator. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 13:57:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137658#M10766</guid>
      <dc:creator>Lake_Worth_BeachAdmin</dc:creator>
      <dc:date>2018-01-29T13:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137659#M10767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;another update... the append methods worked I just needed to add a extra line before adding the string values the code below did this correctly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;with open(locatorLW, 'r') as file :&lt;BR /&gt;&amp;nbsp; filedata = file.read()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filedata1 = "supportsEmptyHouseNumber = true \n"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filedata2 = "supportsOptionalZone = true"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Write the file out again&lt;BR /&gt;with open(locatorLW, 'a') as file:&lt;BR /&gt;&amp;nbsp; file.write('\n')&lt;BR /&gt;&amp;nbsp; file.write(filedata1)&lt;BR /&gt;&amp;nbsp; file.write(filedata2)&lt;BR /&gt;&amp;nbsp; file.close()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 14:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137659#M10767</guid>
      <dc:creator>Lake_Worth_BeachAdmin</dc:creator>
      <dc:date>2018-01-29T14:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Access existing address locator properties with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137660#M10768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, that should work then.&amp;nbsp; The locator isn't changed when you edit properties in the .loc file, it is quite safe to do it like you are and it will set the target properties.&amp;nbsp; If a locator is already loaded into memory though you will need to restart your session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 15:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-existing-address-locator-properties-with/m-p/137660#M10768</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2018-01-29T15:10:56Z</dc:date>
    </item>
  </channel>
</rss>

