.loc.xml files

1091
6
Jump to solution
06-06-2014 07:04 AM
raffia
by
New Contributor II
Hey guys; Friday, great mood hopefully.

So Arc creates these .loc.xml file for each locator. They basically allow you to specify common spelling of words. But am not sure how they get published on the server when publishing the geocoder service. I also tried to play a bit with those files locally, and somehow the changes don't get noticed in ArcMap when searching for stuff. Any ideas?

Thanks;
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AndyJones
New Contributor III
Thanks again Andy;

So I get all these options when creating a new style, single field, city state, zip +4 . So all these are defined inside the US addressed xml file. I change what i need inside that file. So what if I wanna make a custom one, there is no way to point the geocoder/locator to that xml?


No worries.

Make a copy of the US one, make your customizations and then put it back in the arcgis/locators folder (obviously call it something different). Those styles will then appear in the GP style choices. You can find some custom files on these forums that are used in this way - you download the .loc.xml and put it in the folder specified above, you will then see that style in the list. I hope this is clear, try downloading a custom style from this forum and running through the steps I have listed above; that should give you a good understanding of the process.

View solution in original post

0 Kudos
6 Replies
AndyJones
New Contributor III
Hey guys; Friday, great mood hopefully.

So Arc creates these .loc.xml file for each locator. They basically allow you to specify common spelling of words. But am not sure how they get published on the server when publishing the geocoder service. I also tried to play a bit with those files locally, and somehow the changes don't get noticed in ArcMap when searching for stuff. Any ideas?

Thanks;


That is a locator style you are referring to, which is used to build the locator. If you are editing these files for your own use, you will need to rebuild your address locators using these style files. When you have your locator built as you specify then you publish it as a service.

If you need some incomplete and badly written documentation check out: Customizing Locators in ArcGIS 10 (white paper)
0 Kudos
raffia
by
New Contributor II
Hi Andy,

many thanks for you reply. So those xmls are creade when we share the published service, so they go outside the original DB. So when I rebuild the geocoder, how can I make it point to the created xml file?
0 Kudos
AndyJones
New Contributor III
Hi Andy,

many thanks for you reply. So those xmls are creade when we share the published service, so they go outside the original DB. So when I rebuild the geocoder, how can I make it point to the created xml file?


The style file is just used to build the locator; all of the rules and grammar will then be contained within the address locator once it has been built.

Make sure your edited .loc.xml file is contained within Arcgis/desktop/locators, then in ArcMap when you select "new - address locator" the GP dialog appears and there you can select a style. This style is the .loc.xml contained in the location specified above, to test that your edited style is the one being used - change the line in the xml file that relates to the title - your changes should then appear in the style list in the GP tool.
0 Kudos
raffia
by
New Contributor II
Thanks again Andy;

So I get all these options when creating a new style, single field, city state, zip +4 . So all these are defined inside the US addressed xml file. I change what i need inside that file. So what if I wanna make a custom one, there is no way to point the geocoder/locator to that xml?
0 Kudos
AndyJones
New Contributor III
Thanks again Andy;

So I get all these options when creating a new style, single field, city state, zip +4 . So all these are defined inside the US addressed xml file. I change what i need inside that file. So what if I wanna make a custom one, there is no way to point the geocoder/locator to that xml?


No worries.

Make a copy of the US one, make your customizations and then put it back in the arcgis/locators folder (obviously call it something different). Those styles will then appear in the GP style choices. You can find some custom files on these forums that are used in this way - you download the .loc.xml and put it in the folder specified above, you will then see that style in the list. I hope this is clear, try downloading a custom style from this forum and running through the steps I have listed above; that should give you a good understanding of the process.

View solution in original post

0 Kudos
raffia
by
New Contributor II
Andry!! You are great. It worked very good. I figured out exactly what i needed, my basic task was to make the geocoder more friendly when searching using English characters for Arabic content names like streets and landmarks. So I was able to customize the xml and make the locator easier on the spelling. Some of the more generic changes I wanted worked good for the most part. I was able to allow users to type a double character when only one should be entered, like this:
            <entry from="aa" to="a" spell="90" cost="0.0" type="simple" bidirectional="true"/>
            <entry from="bb" to="b" spell="90" cost="0.0" type="simple" bidirectional="true"/>

.....etc

This works very good. What I couldn't figure out however is how to account for a missing character, for example entering "atameya" where it should be "katameya". I tried something like this

            <entry from="a" to="" spell="90" cost="0.0" type="simple" bidirectional="true"/>
            <entry from="a" to=" " spell="90" cost="0.0" type="simple" bidirectional="true"/>


They both didn't work, I tried looking up for a reserved sequence of characters that denote no character, but to no avail.

There is also this small issue, it a bit tricky, So there are these Arabic characters that don't have an English equivalent. For example there is this one where some people use an H character as an equivalent, and that's what our data uses, while some use the number 7 to denote that missing characters. And there are 5 other characters that sometimes get denoted with numbers. So to do this, I used

<entry from="7" to="h" spell="90" cost="0.0" type="simple" bidirectional="true"/>

This actually sometimes work and sometimes don't, and for the same exact entry. It is very weird, same data, same locator, same single field entry, sometimes you get the intended results, sometimes you don't. What's even weirder is when it stop working, it affects all other locators I created as a test. It could be like a local cache issue maybe. I also tried looking for specific entries and changing them like this

            <entry from="Mo7amed" to="Mouhamed" spell="100" cost="0.0" type="simple" bidirectional="true"/>
            <entry from="M7md" to="Mouhamed" spell="100" cost="0.0" type="simple" bidirectional="true"/>

sometimes this works, sometimes it doesn't. Actually it works at the begging, and then completely doesn't work, meaning it never works again once it stops, so I make a new locator to further test.

Thanks again man.
0 Kudos