Creating offline locator to be consumed by Runtime app

1354
5
06-29-2021 10:01 AM
JoeHershman
MVP Regular Contributor

We are trying to setup an application to use an offline locator in our Runtime app (100.7).  I have looked at the sample and it does not go into anything about actually building the locator.   We created a locator in pro, however, the output files differ from what is downloaded when using the sample.

The sample provides four files, with extensions .loc, .loc.xml, .lob, .lox.  When creating in Pro we get two file one is .loc the other .loz.  Also looking in a text editor the .loc files are not at all the same

When trying to load the locator created in pro an exception is thrown

 

Invalid response
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Esri.ArcGISRuntime.Tasks.Geocoding.LocatorTask.<CreateAsync>d__10.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at [my local code]

 

I found this article https://support.esri.com/en/technical-article/000015598.  Which discusses creating a replica for Runtime, but it is from 2017 and seems targeted at Runtime 10.x.  However, it does discuss the same types of files which are seen when running the sample application.  But the idea that we would be creating a package in ArcMap to be consumed by a Runtime 100.x application seems very illogical to me.

How does one generate a locator to be consumed by an offline Runtime application?

Thanks

Thanks,
-Joe
0 Kudos
5 Replies
JoeHershman
MVP Regular Contributor

Crickets?

No one knows how to use a locator created in Pro from Runtime?

@MichaelBranscomb 

Thanks,
-Joe
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi Joe,

It appears you used the correct geoprocessing tool in ArcGIS Pro - Create Locator (Geocoding) - because you mentioned having a .loc and .loz file. That's the new locator format supported since ArcGIS Runtime 100.5 and the only format supported from 100.12 onwards

Can you share the snippet of code where you create the LocatorTask?

Thanks 

0 Kudos
ChristaHash
Esri Contributor

@JoeHershman You're definitely using the correct format of locator. Can you give me some more information on how you created your locator? The version of runtime that you're using might not support some limited number of roles or precision types, and I'd be happy to help you determine if that might be the issue.

For instance, locators built with the Create Feature Locator tool and Parcel Role locators built with the Create Locator tool were not supported until Runtime 100.8. Additionally, locators created with a precision level of Local Extra High or Global Extra High were not supported until that release as well.

Thanks!

0 Kudos
JoeHershman
MVP Regular Contributor

Hi @ChristaHash we have been trying to create a few different locators but not with those types (we are only at 107), we are able to get the ones built in ArcMap to load although we are not getting results but the one from Pro fails when we just call LocatorTask.CreateAsync.

I did just update to 100.8 and we are getting things to load successfully and even getting results (not always correct).  So even though this uses a point address locator, it would appear to require 100.8

One thing we have tried is to take the premise data we have and reverse geocode it, at a rather hefty fee, hoping that would give us the requisite data.  However, we found that reverse geocode does not really return the data in a way that can be simply used in building a Locator.  Mainly, we don't get street names broken out in a separate field.  I have looked through the rest documentation, and it does not seem that a street name is a value that can be returned.  This seems a bit odd (and I notice Google will return, so not sure why esri would not), as this seems to me to be a crucial piece of individual information.

Initially we have Parcel data, but we did not build a locator with Parcel role, we have built a point locator.  A little discouraging that it required 100.8, when the documentation would seem to indicate that only 100.5 is required

 

 

Thanks,
-Joe
0 Kudos
ChristaHash
Esri Contributor

@JoeHershman I'm going to message you directly so that I can give you my email address and get more information about the data that you're using to create your locator, how you're mapping fields, and what roles you're using. It sounds like you're not getting the results you want even when using the locator in ArcGIS Pro, so I think maybe if we can help you with your locator problem, maybe that will just solve the runtime problem. 

0 Kudos