|
POST
|
Answering question 1: There is no drop-down menu to select the directions language. You can select the language in the Directions geoprocessing tool, or you can set the directions language for a Vehicle Routing Problem layer using the following code in the python window: # Get the current ArcGIS Pro project
proj = arcpy.mp.ArcGISProject("current")
# Get the current map
mapObj = proj.listMaps()[0]
# Find the Vehicle Routing Problem layer in the map
# You might need to change the layer name string below if your layer's name is different.
vrpLayerObj = mapObj.listLayers("Vehicle Routing Problem")[0]
# Get the layer's solver properties
solverProps = arcpy.na.GetSolverProperties(vrpLayerObj)
# Set the directions language to Portugal Portuguese
solverProps.streetDirectionsProperties.language = "pt-PT" You do not need to install a language pack to get directions in Portuguese. All directions languages are available all the time, even without language packs. (This is new - ArcMap and older versions of ArcGIS Pro required a language pack installation to get directions in non-English languages.) Answering question 2 We did not change the Solve Vehicle Routing Problem tool between ArcGIS Pro 2.5 and 2.6. Can you further explain your question? Answering question 3 I am going to ask a colleague to help you with this question.
... View more
08-27-2020
12:37 PM
|
0
|
6
|
3296
|
|
POST
|
There is no ribbon or Directions pane setting for directions language at this time. However, you can run the Directions geoprocessing tool and select the desired language in that tool. If that doesn't give you what you want, there is a way to set the VRP layer's directions language via python. Let me know if you want to learn about it.
... View more
08-26-2020
09:36 AM
|
0
|
10
|
3296
|
|
POST
|
Spikes like that are a common artifact of the polygon generation algorithm in ArcMap. We have implemented a new and improved polygon generation algorithm that makes the Service Area polygons look more bubbly or cloudy and less spikey. You can access the new algorithm in one of two ways: 1) In ArcMap, open the properties of your network dataset. On the Optimizations tab, turn on the box for the Service Area Index. You might need to re-build your network dataset after this, but I can't remember. Future Service Areas using this network should use the newer algorithm. 2) Use ArcGIS Pro instead of ArcMap. ArcGIS Pro Service Areas always use the new algorithm.
... View more
08-26-2020
08:08 AM
|
0
|
8
|
4571
|
|
POST
|
As described in the documentation for the Route solver object, you need to use an NAClassFieldMappings object, which is made up of NAClassFieldMap objects. That documentation contains several examples.
... View more
08-20-2020
12:44 PM
|
0
|
1
|
1640
|
|
POST
|
It needs to be a list of the string names of the attributes you want to accumulate. route.accumulateAttributeNames = ["VehicleTrack", "VehicleWheel"]
... View more
08-17-2020
01:39 PM
|
1
|
1
|
1418
|
|
POST
|
That's because travelMode = travelModes("OnRoad") is a syntax error. You need to use square brackets to retrieve an item in a dictionary. travelMode = travelModes["OnRoad"]
... View more
08-12-2020
10:27 AM
|
1
|
1
|
3212
|
|
POST
|
I'm still not entirely sure what your workflow is, but if you're using saveAsLayerFile() and then adding the saved .lyr file to the map and looking at the travel mode, it's possible the travel mode name displayed will be incorrect or inconsistent. That's because .lyr files are the old ArcMap layers that do not have a concept of travel mode. I believe the settings should be consistent, but the name might be off. I'm not really sure. This is why I suggest that you use the older MakeLayer, Add Locations, Solve workflow n your script. The nax solver objects just really aren't designed to work with layers.
... View more
08-12-2020
09:54 AM
|
0
|
3
|
3212
|
|
POST
|
The brackets are added automatically to the name. You don't need to do anything with those. # Get all existing travel modes from the network dataset
travel_modes = arcpy.nax.GetTravelModes(network)
# Get the existing "Driving Time" travel mode to use as a template
existing_tm = travel_modes["Driving Time"]
# Construct a new TravelMode object from the existing travel mode
new_travel_mode = arcpy.nax.TravelMode(existing_tm)
# Update the new travel mode's impedance
new_travel_mode.impedance = "MyImpedance"
# Use the new travel mode object when constructing a OD Cost Matrix object
arcpy.nax.OriginDestinationCostMatrix(network)
od_object.travelMode = new_travel_mode
... View more
08-12-2020
09:51 AM
|
0
|
0
|
3212
|
|
POST
|
Just set the accumulateAttributeNames property of the Route object, the same way you would set the travel mode. The complete list of properties can be found here: Route—ArcGIS Pro | Documentation
... View more
08-12-2020
09:38 AM
|
1
|
1
|
1328
|
|
POST
|
I can't really follow your workflow from your description, but I suggest you follow the last code sample on this page: TravelMode—ArcGIS Pro | Documentation Rather than editing the travel mode retrieved from the network directly, try instantiating an entirely new travel mode using the network's travel mode as a template. Then change the impedance for the new travel mode and see if that works.
... View more
08-12-2020
07:58 AM
|
1
|
2
|
3212
|
|
POST
|
No, the accumulate attributes are independent from the travel mode.
... View more
08-12-2020
07:53 AM
|
0
|
3
|
1328
|
|
POST
|
It looks like this agency just decided to explicitly turn on service using the calendar_dates.txt file for specific dates rather than including a regular service defined in calendar.txt. To successfully run the BetterBusBuffers tools, you should use a specific YYYYMMDD date for the input date instead of a weekday.
... View more
08-11-2020
09:46 AM
|
0
|
0
|
1638
|
|
POST
|
Try something like this: layer_path = "D:\myDir\Route.lyr"
result.saveAsLayerFile(layer_path)
arcpy.SetParameterAsText(5, layer_path) I'm not 100% sure if that will work. There are a couple of things to be aware of with regards to the nax solver objects as saveAsLayerFile. First, the saved layer file is a .lyr file in the old ArcMap style, not a .lyrx in the Pro style. If you try to use .lyrx in the output path, it will fail. You must use .lyr. Since the output file is a .lyr file, I don't know if it will actually work with SetParameter() or SetParameterAsText() because that might be expecting a Pro-style layer file or layer object. As I said, the intention of these saved layer files from the nax solver objects is for debugging, not for what you're currently doing. Another thing you could try is reconstituting the layer file as a Pro-style layer object after you've saved it out. layer_path = "D:\myDir\Route.lyr"
result.saveAsLayerFile(layer_path)
layer_object = arcpy.mp.LayerFile(layer_path).listLayers()[0]
arcpy.SetParameter(5, layer_object) I don't know if that will work either, though.
... View more
08-11-2020
08:11 AM
|
1
|
1
|
2651
|
|
POST
|
I'm guessing from your questions that you are writing a python script tool that you intend to run as a geoprocessing tool within ArcGIS Pro. Is this correct? If this is the case, then the proper way to add the output network analysis layer to the map is not to use the mapping module to add it explicitly but to simply add an output parameter to the script tool. Let me explain further. First, when setting up your tool parameters in the tool dialog, create an output parameter. Set the type to Network Analysis Layer. Make a note of the index for this parameter. You can also set up a symbology layer for this parameter. By specifying a symbology layer here, it will automatically apply this layer's symbology to the derived output when it adds it to the map. When you run the tool, it should automatically add the layer to the map. If you don't want the users of your tool to specify the path to the output .lyr file, but instead you want to handle that internally, you can make the parameter definition of type "Derived". In the script, once you have your output layer path, assign the layer to that parameter using arcpy.SetParameter(). Note: if your ultimate goal is to create fully-functioning network analysis layers as the output of your tool, the arcpy.nax module might not be the right choice. It might be better to use the classic Make Route Analysis Layer, Add Locations, Solve workflow. The saveAsLayerFile() method for the nax solver objects is primarily meant for debugging.
... View more
08-10-2020
04:15 PM
|
0
|
3
|
2651
|
|
POST
|
Yeah, the layer itself exists only in the map, but its data is sitting in the geodatabase grouped into a feature dataset. You can save the layer as a layer file using the Save To Layer File tool if you want to re-use it later, but you have to be careful to keep the analysis database and the network dataset with the same relative paths to the .lyrx file or else it will be broken. You can also save the layer as a layer package. Both the analysis data (the stuff from the feature dataset) and the network dataset will be packaged into the layer package. This guarantees that you'll have everything, but you risk proliferating copies of your network dataset. That's not good if your network is large.
... View more
08-06-2020
01:33 PM
|
0
|
0
|
2238
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 06-12-2026 01:53 PM | |
| 1 | 04-21-2026 08:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|