Select to view content in your preferred language

Create a local transportation network dataset for a RouteTask

958
4
Jump to solution
12-30-2022 03:21 PM
maglourenco1
Occasional Contributor

Greetings,

I currently have an ArcGIS Pro project and created a Network Dataset with the Polyline features.

I already can generate routes in ArcGIS Pro and use other Network Analyst tools.

I'm currently developing an ArcGIS Android app using the SDK for Android (Java) and need a .geodatabase and .tn files to use RouteTask offline.

I have no idea how to convert my Network Dataset in ArcGIS Pro to those needed files, please guide me on how to do it.

Cheers (and have a wonderful 2023!)

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Hello, and happy new year!

You need to package your network dataset in a Mobile Map Package containing the map with the network dataset. With ArcMap you used to be able to export a network dataset for Runtime SDK use, but with Pro we moved to a map package approach since more often than not you'll want to use the network dataset with a map or maps (but don't worry, you don't have to use/display the map if your workflow doesn't require it - in that case the MMPK and Map are just delivery mechanisms for the network dataset).

Load the MobileMapPackage, use the Maps property to read and load the ArcGISMap, and then read the TransportationNetworkDataset(s) from the map. You can then create a RouteTask from each TransportationNetworkDataset.

Hope that helps!

View solution in original post

4 Replies
Nicholas-Furness
Esri Regular Contributor

Hello, and happy new year!

You need to package your network dataset in a Mobile Map Package containing the map with the network dataset. With ArcMap you used to be able to export a network dataset for Runtime SDK use, but with Pro we moved to a map package approach since more often than not you'll want to use the network dataset with a map or maps (but don't worry, you don't have to use/display the map if your workflow doesn't require it - in that case the MMPK and Map are just delivery mechanisms for the network dataset).

Load the MobileMapPackage, use the Maps property to read and load the ArcGISMap, and then read the TransportationNetworkDataset(s) from the map. You can then create a RouteTask from each TransportationNetworkDataset.

Hope that helps!

maglourenco1
Occasional Contributor

Hi Nicholas, thank you so much for your help!

I actually asked something like this a while ago still in the ArcMap days. At that time, you needed a .geodatabase and .tn file. I assume that with the Mobile Map Package it is already included correct?

 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi,

The Mobile Map Package is best considered as a black box. You don't need to worry about exactly how the network dataset is packaged up in there (though I expect that some form of geodatabase and .tn file is in there somewhere 😀). The key part really is knowing how to load it into a RouteTask.

But in short, yes, if the Pro Map has a transportation network, then it'll be included in the Mobile Map Package as part of the support data for the packaged map. You can find a little more information here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-mobile-map-package.ht...

maglourenco1
Occasional Contributor

Thank you very much for the thoroughly explanation!

Indeed that seems like a cleaner solution comparing to loading a .geodatabase and a .tn file in the device, will be testing that solution!

Cheers

0 Kudos