0

I am making address locators in arcpy but need to set 2 properties values after the locator is created. see the image below.. the property values for "match without house number" and "match with no zones" both need to be set to value "Yes"

enter image description here

EDIT**

this cannot be accessed via Arcpy but the .loc file will contain these values. the issue is that the .loc file originally will not contain the fields to edit the values you have to manually edit them within catalog/arcmap then the .loc file will contain the values. the code below works but only after you enable these extended properties within arcmap/catalog which defeats the prupose of automating this task, I do not want to manually go into arcmap/catalog to set the values.

with open(r"Y:\pathtolocator.loc", 'r') as file :
  filedata = file.read()

# Replace the target string
filedata1 = filedata.replace("supportsEmptyHouseNumber = false", "supportsEmptyHouseNumber = true")

filedata2 = filedata1.replace("supportsOptionalZone = false", "supportsOptionalZone = true")



# Write the file out again
with open(r"Y:\pathtolocator.loc", 'w') as file:
  file.write(filedata1)
  file.write(filedata2)
  • What have you tried and what was the result? Please edit your question to include a snippet of the code you've tried – Midavalo Jan 29 '18 at 3:37
  • I updated the question – NULL.Dude Jan 29 '18 at 13:32
  • midalvo open this topic so I can answer, I found a work around – NULL.Dude Jan 29 '18 at 14:09
0

I found out that arcpy cannot access this property but the settings ARE IN A .LOC FILE IN THE SPECIFIED PATH FOR OUTPUT LOCATOR.

using the code below set the correct properties...

with open(locatorLW, 'r') as file :
  filedata = file.read()



filedata1 = "supportsEmptyHouseNumber = true \n"


filedata2 = "supportsOptionalZone = true"


# Write the file out again
with open(locatorLW, 'a') as file:
  file.write('\n')
  file.write(filedata1)
  file.write(filedata2)
  file.close()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.