Closest Facility Location Service for Java Maps SDK

270
1
11-20-2023 08:15 AM
JaredFaulk
New Contributor III

Greetings,

My team is using the Professional Developer Subscription and we are primarily developing using the Java Maps SDK. We are trying to get the ClosestFacility functionality to work. We can get the immediate example Closest Facility Example to work using the sample server. However, when we try to hit the same server using different points it does not work. The example is given using a "sample server" but it not apparent how to hit the "proper" server to use this location service.

 

The documentation for ClosestFacilityTask states:

"To solve closest facilities using an ArcGIS Network Analyst service hosted on ArcGIS Online or on-premises with ArcGIS for Server, create a ClosestFacilityTask by passing in the URL of the service to the ClosestFacilityTask(String) constructor. " 

 

I have two questions-- 

  1. Where can one find the Network Analyst hosted on ArcGISOnline? (Is this something we need to host ourselves? If so, could someone point me to the documentation to do so?)
  2. Does the Professional Developer license include the ClosestFacility functionality?

 

Thank you!

Jared

 

0 Kudos
1 Reply
Nicholas-Furness
Esri Regular Contributor

Hello,

The sample service has a very limited geographic extent (I'm not sure what it is precisely, but I think it's just a small area around San Diego). If your different points are outside that limited extent, you won't get results.

In answer to your questions:

  1. You can find all the documentation on the service here: https://developers.arcgis.com/documentation/mapping-apis-and-services/routing/closest-facility-routi...

    That includes the REST endpoints, as well as examples of using the service with various SDKs.
  2. Yes.

Hope that helps.

Nick.

0 Kudos