Creating a custom, local RouteTask

2253
6
09-28-2012 11:54 AM
Labels (1)
KeithGemeinhart
Occasional Contributor
Greetings,

I'm trying to replicate something similar to the WPF Runtime  "Routing with Barriers Online" sample with two major modifications ...
1. I have my own network dataset (created from a feature class using ArcObjects classes)
2. I want it to run locally and not on an ArcGIS server instance. Can I exploit LocalServer for this?

First, can this be done? If so, what is the best approach? I have both the WPF runtime and ArcObjects SDK to work with.
0 Kudos
6 Replies
KevinHibma
Esri Regular Contributor
Unless I'm missing something obvious**, I think the way you'd go about this is with a geoprocessing package.
The Runtime supports Network Analysts tools which you can use to create a model and turn that into a geoprocessing package. You then consume that package in your application.

This sample here explains making a service, but you can follow these steps to make your own model and just make a runtime enabled geoprocessing package instead of the service.
http://resources.arcgis.com/en/help/main/10.1/#/Shortest_Route/00570000009q000000/

*disclaimer: I'm on the geoprocessing team, not the runtime team. However I've built geoprocessing packages and consumed them in the runtime. A pretty straight forward process. I'd just use the "Contour" in the Geoprocessing > Spatial Analysis samples as a starting point if you go this route.
0 Kudos
MiriRevivo
Occasional Contributor
Hi Keith,

In order to run a routing service locally on your machine, you will need to create a model that does what you need, package it into a geoprocessing package, and use that package from Runtime code (that will ultimately spin up a local service from the package you've created and run it on the LocalServer).

You have a walkthrough here that takes you step by step through the creation of your first routing geoprocessing package:
http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/How_to_author_and_publish_a_geo...

And here is the second part, that completes the picture and shows you how to run it from code:
http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/How_to_develop_a_point_to_point...

That should get you in the right direction,
Miri.
0 Kudos
ReneeCammarere
Occasional Contributor
I am able to create the gpk using the above mentioned link instructions.  However, when I attempted to create a gpk using my own data, I got an error message each time (General function failure ERROR 999999: Error executing function). When I researched this error, I didn't find anything helpful.  
I am using a map document that contains a Network Dataset created from a Shapefile Feature class.
The settings that I use to create the package are . . .
    Support ArcGIS Runtime enabled (other two options are disabled)
    Summary and Tags detail filled in
Is there any way to find out more info on the error?  I don't know why it's failing, but I keep changing little details and trying it again.

Thanks,
Renee
0 Kudos
jp
by
New Contributor II
I am having same issue. Works fine when packaging with Esri Data & Maps 10.1 network dataset (SDC network dataset).
Have you found a solution or fix for this ?


I am able to create the gpk using the above mentioned link instructions.  However, when I attempted to create a gpk using my own data, I got an error message each time (General function failure ERROR 999999: Error executing function). When I researched this error, I didn't find anything helpful.  
I am using a map document that contains a Network Dataset created from a Shapefile Feature class.
The settings that I use to create the package are . . .
    Support ArcGIS Runtime enabled (other two options are disabled)
    Summary and Tags detail filled in
Is there any way to find out more info on the error?  I don't know why it's failing, but I keep changing little details and trying it again.

Thanks,
Renee
0 Kudos
ReneeCammarere
Occasional Contributor
Sorry for the late reply, I am now struggling with other issues regarding this.  Anyway, I learned that the Network Dataset needs to be in a File Geodatabase, rather than just a regular folder.  Once I made that change, the geoprocessing package was created with no problem.  I don't know if this will resolve your problem, though.  Unfortunately, the error messages related to using these Arc Objects are not exactly insightful.
0 Kudos
jp
by
New Contributor II
Yes, I was able to create a gpk with a File geodatabase based network dataset. I contacted the Esri Technical support and they are looking into this bug.

Now the next step is to input parameters in ArcGIS Runtime for WPF application. The input being Network dataset, it doesn't appear in the required parameters on the LocalGeoprocessingService url page.

Thats my next issue.
0 Kudos