POST
|
Hi Roland, The route tool available in ArcGIS Desktop 10 uses the legacy routing service by default which as you noticed will be retried at the end of 2013. However if you can (or already have) Service Pack 5 for ArcGIS Desktop 10 and have a valid ArcGIS Online Organization subscription or a trial, you can connect to the new routing service from the Find Route tool and continue using the tool even after 2013. You can find more information about how to connect the route tool to the new service in the help topic. The find route tool does not provide a way to script or customize it in order to do any kind of batch processing. The routing functionality available via the directions tool in arcgis.com also provides a way to generate routes based on the new route service. But again the directions tool is more designed as an end user tool and cannot be easily used for batch processing. Currently the only way is to use the REST API for the routing service and write a tool using any programming language that supports making REST requests (Python is a valid option) on your own to complete your workflow. In the next release of ArcGIS Online (to be released around Thanksgiving), there will be a new geoprocessing tool available as part of your ArcGIS Online Subscription that will provide an easy way to perform such batch route processing tasks or easily script them using Python. The new route geoprocessing tool will be available as part of logistics services that you can access from ArcMap Hope this helps Deelesh Mandloi
... View more
10-01-2013
08:47 PM
|
0
|
0
|
164
|
POST
|
Mark, Add Locations geoprocessing tool is a generic tool that can be used to load features to any sublayers within a network analysis layer. So it is the right tool to load Demand Points into the location-allocation layer. In your model after you use the MakeLocationAllocationLayer tool you need to connect the output layer as input to AddLocations tool. Then you will see the sublayer parameter populated with all the sublayers from the location-allocation layer. Now you can select Demand Points to load your features into demand points. You also need another AddLocations tool in your model to load your Facilities and finally you need the Solve tool. Check the attached screenshot. Hope this helps...
... View more
01-30-2012
09:19 AM
|
0
|
0
|
258
|
POST
|
We were able to reproduce the issue and have identified it as a known problem. We are working to fix the issue. I will provide more details as to which ArcGIS 10 service pack will resolve this issue once we have a fix for it. Thanks for reporting this and for your patience. Deelesh Mandloi
... View more
11-16-2011
10:47 AM
|
0
|
0
|
992
|
POST
|
Hi Brian, Your model looks correct. The issues that you are seeing are because you are trying to solve a large problem and the ArcGIS process is running out of memory. It might help if you run this with ArcGIS 10 on a 64 Bit OS. That way the model can consume upto 3 GB of RAM if availabe. Other options are to solve smaller problems. For example instead of solving 43 branch locations at once try solving with only 5 branch locations at one time and repeat. You can eventually combine the output polygons from multiple runs into a single feature class using the Merge tool. You can use the new Iterators that Model Builder supports at ArcGIS 10 such as Iterate Feature Selection to repeat the same model. As you will running the same model multiple times, in your model you should also delete the Network Analyst Layer that is output from the Solve tool using Delete tool. The layer should be deleted only after you have executed copy features. This can be achieved using precondition in your model. Hope this helps Deelesh
... View more
09-16-2011
10:20 AM
|
0
|
0
|
219
|
POST
|
Hi Andres, What you want to accomplish is possible in ArcGIS 10 (and even 9.3) but with some additional python code. A script tool�??s GUI can be further programmed using a ToolValidator class. This class can perform actions such as populating values of a parameter based on value from another parameter or enabling/disabling a parameter based on other parameters. More info about the ToolValidator class is available in the help There was also a recent blog post on the geoprocessing blog explaining how to use ToolValidator class For your case, In your script tool, You need to define a network dataset parameter of type network dataset layer and a second parameter called Impedance of type string. Then you can use the attached tool validator code to automatically populate the values for Impedance value parameter based on the network dataset. I am attaching the toolbox containing this sample code. class ToolValidator:
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
import arcpy as ARC
self.arcpy = ARC
self.paramsIndex = {'networkDataset':0,
'impedance': 1}
self.params = arcpy.GetParameterInfo()
#Get the parameter objects that will be modified
self.networkParam = self.params[self.paramsIndex['networkDataset']]
self.impedanceParam = self.params[self.paramsIndex['impedance']]
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
return
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parmater
has been changed."""
if self.networkParam.altered:
if self.networkParam.value and not self.networkParam.hasBeenValidated:
#Check if the NDS exits
try:
self.getNetworkProps(self.networkParam.value)
except:
self.resetNetworkProps()
return
else:
self.resetNetworkProps()
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def getNetworkProps(self,network):
'''Update the parameter values based on th network dataset'''
desc = self.arcpy.Describe(network)
defaultCostAttr = ""
costAttributes = []
count = 0
#Build a list of cost attributes and get the default cost attribute
attributes = desc.attributes
for attribute in attributes:
usageType = attribute.usageType
name = attribute.name
useByDefault = attribute.useByDefault
if usageType == "Cost":
#Check if the cost attribute has to be used by default.
if useByDefault:
defaultCostAttr = name
costAttributes.append(name)
#Set the lists for cost attribute
self.impedanceParam.filter.list = costAttributes
#Set the default value for the cost attribute
if not self.impedanceParam.altered:
if defaultCostAttr == "" and costAttributes:
#if there is no default use the first one in the list
defaultCostAttr = costAttributes[0]
self.impedanceParam.value = defaultCostAttr
return
def resetNetworkProps(self):
"""Resets the network dataset derived parameters to nothing"""
self.impedanceParam.filter.list = []
self.impedanceParam.value = ""
return
Hope this helps. Deelesh
... View more
08-30-2011
05:07 PM
|
0
|
0
|
292
|
POST
|
Gert, [INDENT]As a first step you need to prepare your data so that it can be used to build a Network Dataset. Once you have a Network Dataset, you can perform routing or any other network analysis.[/INDENT] [INDENT]Your have to carefully analyze the street data and then do the necessary edits to ensure that the street centerlines have correct connectivity information that is required for building network datasets. While there is no single magic tool that will take your data and correct all errors in it, you can do this in a semi-automated way. The first step is to ensure that the lines connect end to end. If this is not the caase, you can run the Integrate geoprocessing tool. This will combine all the line ends if they are within the specified tolerance. You might have to try different values to determine the tolerance that works best for your data.[/INDENT] [INDENT]After integrate, you should build a topology from your street centerlines and set the necessary rules. This should further clean up your data.[/INDENT] [INDENT]Once the topology is correct, you can create a new network dataset. There are various options that you can use when creating a network dataset. The help topic has additional pointers to related topics.[/INDENT] [INDENT]Note even after you have edited the data to have the necessary connectivity, you will still need some attributes on streets centerlines such as Oneway street information as well as speed limits to model travel time. This is required to set up network attributes that are used during analysis.[/INDENT] [INDENT]If all this sounds too daunting, you can start with a free network dataset provided on Esri Data and Maps DVD that comes with ArcGIS. You can find it within the Streetmap_na\data folder on the DVD. This is a prebuilt readonly network dataset for whole of US and Canada. You can add the "Streets" network dataset to ArcMap from within this folder, enable the Network Analyst Extension and start performing network analysis. The data is about 5 years old, but it provides a good starting point.[/INDENT] [INDENT]I will also recommend to have a look at the technical workshop about creating network datasets presented at the Esri User conference. This should provide you with concepts necessary to build a good network dataset. [/INDENT] Hope this helps Deelesh Mandloi
... View more
08-16-2011
02:18 PM
|
0
|
0
|
755
|
POST
|
Jordan, You can pass in any unique ID field from your input shapefiles to the stops sublayer within a Route network analyst layer. In order to achieve this, before loading your shapefile points as stops, create a new field, for example, "UniqueID", on the Stops sublayer in the Route Network Analyst layer. Now when you add shapefile points as stops using the Load Locations command, you will see a new property called "UniqueID" (or whatever you named the new field) in the Location Analysis Properties section. In this control for the UniqueID property you can now select a field from your input shapefile. Henceforth you can use a join to transfer attributes back and forth between stops sublayer and your input shapefile using the UniqueID field as the key field. Hope this helps.
... View more
04-13-2011
05:36 PM
|
0
|
0
|
154
|
POST
|
Nick, With ArcGIS 10 (and earlier versions), the traversal result can be accessed only via ArcObjects. However, you can use a trick to add the traversal result as feature layers in ArcMap and then use the feature layers in Model Builder with any geoprocessing tools that work with feature layers. For this to work, In ArcMap, create a new VBA macro and copy this VBA code in the macro body. Public Sub AddNATraversalResultToArcMap()
Dim pMxDoc As IMxDocument
Dim pNetworkAnalystExtension As INetworkAnalystExtension
Dim pNALayer As INALayer
Dim pFLayer As IFeatureLayer
Dim pTraversalResultQuery As INATraversalResultQuery
Dim pNATraversalResultEdit As INATraversalResultEdit
Set pMxDoc = ThisDocument
Set pNetworkAnalystExtension = Application.FindExtensionByName("Network Analyst")
Set pNALayer = pNetworkAnalystExtension.NAWindow.ActiveAnalysis
Set pTraversalResultQuery = pNALayer.Context.Result
Set pNATraversalResultEdit = pTraversalResultQuery
'Infer Geometry
pNATraversalResultEdit.InferGeometry "", Nothing, New CancelTracker
'Get the Edges and add as a layer
Set pFLayer = New FeatureLayer
Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETEdge)
pFLayer.Name = pFLayer.FeatureClass.AliasName
pMxDoc.FocusMap.AddLayer pFLayer
'Get the Junctions and add as a layer
Set pFLayer = New FeatureLayer
Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETJunction)
pFLayer.Name = pFLayer.FeatureClass.AliasName
pMxDoc.FocusMap.AddLayer pFLayer
End Sub
Solve the Closest Facility layer and then run the macro. This will add two layers "Edges" and "Junctions" to ArcMap. The layer represents the edges and junctions traversed while finding routes. Move these two layers below the Closest Facility layer in Table of Contents (TOC). This will ensure that the traversal layers are not broken when you reopen the map document. Save the map document. The traversal layers can be used in Model builder with any gp tools. Every time the Closest Facility layer is solved, the traversal layers are updated. Some caveats to keep in mind The traversal layers are associated only with the existing closest facility layer. Any time you create a new layer, you need to remove the existing traversal layers and rerun the macro to create new layers. In your GP model, you need to re-use the same closest facility layer. Since there is no way to edit properties of existing closest facility layers using GP(a tool or via python), you cannot change any analysis properties (such as number of facilities to find) in your model. However, You can change them from layer properties in ArcMap. Any time the solve fails to find a solution, the traversal layers are removed from the TOC. So you need to rerun the macro to add the traversal layers after a successful solve. As the traversal layers are just available in the TOC, you have to run the GP model from inside the map document containing the traversal layers. And hopefully some good news, at 10.1, the network analyst toolbox will have a new GP tool that takes a network analysis layer and saves the traversal layers as feature classes on disk avoiding all these issues. Hope this helps Deelesh
... View more
03-29-2011
07:36 PM
|
0
|
0
|
194
|
POST
|
Jorg, Looking at the details about the bug report that you mentioned, this issue has been fixed in version 10.0. So If possible, upgrade the ArcGIS version and try it. Other possible workarounds if you cannot upgrade your software version are 1) Process smaller chunks of data (as you have been doing) 2) The Spatial Join or Intersect tool can also perform similar operations as Select Layer by Location. So try to complete your workflow using these two tools. Hope this helps. Deelesh
... View more
02-22-2011
08:27 AM
|
0
|
0
|
595
|
POST
|
Jorg, The first step is to run the Check Geometry tool on the routes feature class and see if it reports any error. If there are errors, run Repair Geometry tool to correct them. Then try running the Select by Location tool. Hope this helps Deelesh
... View more
02-18-2011
07:58 AM
|
0
|
0
|
595
|
POST
|
Melissa, ArcGIS 10 does not support creating network datasets using Model Builder or python scripts. However using the ArcObjects API in .NET or Java you can certainly automate the creation of network datasets. These .NET code samples show how to programatically create network datasets. Hope this helps Deelesh
... View more
01-07-2011
08:04 AM
|
0
|
0
|
667
|
POST
|
We just added two new tools on the geoprocessing resource center that process street data from Tele Atlas or NAVTEQ and create a network dataset. The tools work with ArcGIS 10. Try out the Process MultiNet Street Data tool and let me know if it works for you. Deelesh
... View more
10-18-2010
08:39 AM
|
0
|
0
|
738
|
POST
|
Jukka, I don't get any errors when trying to run the tool with the school allocation dataset. Which version of ArcGIS you are using, 9.3 or 10.0? In order for me to reproduce the problem can you send me the origin and destination feature classes from your dataset? I also need the network dataset that you are using. If the size of the dataset is large, you can upload the zip file to the Esri ftp site ftp://ftp.esri.com/ You need to login as " anonymous " and use your e-mail address as the password. Navigate to the /pub/incoming directory and copy the zip file in a new directory. Let me know once you have uploaded the data. Deelesh
... View more
10-11-2010
04:47 PM
|
0
|
0
|
257
|
POST
|
Jukka, It looks like the tool is failing because of invalid expression while trying to calculate CostAtOrigin field on OD Lines. Can you replace the OptimumAllocation.py file in your C:\Data\Tools\AllocationTools\Scripts with the attached one and run the Allocation Tool (it will still fail though :()? The tool will generate a .lyr file in the same folder as the .py file. Can you attach the .lyr file in your reply?. Looking at this layer file will help me to figure out why the tool fails for your case. Regards Deelesh
... View more
10-06-2010
05:42 PM
|
0
|
0
|
257
|
POST
|
Alexandre, To achieve your work flow you need to make use of the QueryJunction method on the INetworkQuery interface. This functionality is not exposed via python. So in order to make this functionality available via python you have some options. Write a Console application in either .NET (using C# or VB.NET) or Java that takes in a path to the network dataset and performs this computation. You can then call this standalone application from your python script. The console application will run in a separate process as compared to your python script. Write a custom geoprocessing (GP) tool in either .NET language or Java that takes in a network dataset and performs the computation. You can then call this custom GP tool from your python script. The benefit of writing a custom GP tool is that the tool will behave like any other GP tools and it will also run in the same process as your python script. However you will have to ensure that the custom GP tool is installed on the machine before you can call it. Refer to the documentation about writing custom GP tools in .NET or writing custom GP tools in Java. Option #1 is relatively easy to develop but Option#2 will give you more geoprocessing like experience in your python script. Hope this helps Deelesh
... View more
10-05-2010
03:42 PM
|
0
|
0
|
224
|
Title | Kudos | Posted |
---|---|---|
1 | 07-08-2010 09:38 PM | |
1 | 05-16-2019 02:16 PM | |
1 | 12-13-2018 11:54 AM | |
1 | 02-11-2020 10:03 AM | |
1 | 12-18-2018 02:58 PM |
Online Status |
Offline
|
Date Last Visited |
02-27-2023
07:05 AM
|