Network Analyst beginner's question

666
5
03-26-2011 10:08 PM
Highlighted
New Contributor
Hello,

Why am I getting an error 'Route has a non-null CostPerUnitDistance value even though there is no distance attribute' even if I set the CostPerUnitDistance value to null?

Thanks.
Tags (2)
Reply
0 Kudos
5 Replies
Highlighted
New Contributor III
How exactly are you setting this field value to null? It works fine for me in ArcMap. If you are doing this programmatically, what programming language is this in and how are you doing it (i.e., can you show the specific lines of code)?
Reply
0 Kudos
Highlighted
New Contributor
Hi,

Thanks for your reply.

I was doing it in Java. And I actually made a mistake of setting the value to null,  instead of not setting it at all. When I commented the below line, it did work. But this is just to make it work without the CostPerUnitDistance and MaxTotalDistance. I still don't know how to  setup a distance attribute.Do you know how to setup a distance attribute if I am using the SDC Street dataset provided by ESRI?

//featureBuffer.setValue(indexOfCostPerUnitDistance, null);

Thanks
Reply
0 Kudos
Highlighted
New Contributor III
Setting up a distance attribute is the same programming pattern, regardless of the underlying network dataset type.

Here is a link to some sample code for creating/manipulating VRP analysis layers, including setting of the distance attribute, etc. Sorry, it is not in Java, but the .NET programming patterns are generally the same, so you should hopefully be able to easily make the translation to Java.

In general, you must set the distance attribute for VRP by specifying it as an accumulated cost attribute using INASolverSettings.AccumulateAttributeNames.
Reply
0 Kudos
Highlighted
New Contributor
i want to find service area for some facilities,  for that following things are required;
1) how to add different walking speed on various types of roads, such as minor road and major roads?
2) how define left and right turn feature class in attribute table.?(e.g. to take left turn require 10 seconds and for right turn 40 seconds.)
3) how to define restrictions, such as highways and railways should not allow to pedestrian walking.

please help me.....
Reply
0 Kudos
Highlighted
Esri Regular Contributor
Take a look at the network analyst tutorial dataset on Paris which has pedestrian times set.
You may have to install the data from the appropriate DVD.

The tutorial exercise 2 will help with this dataset:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Exercise_2_Creating_a_multimodal_netwo...

Jay Sandhu
Reply
0 Kudos