Restrictions - how to get it to work?

1640
3
06-19-2012 05:16 AM
Highlighted
New Contributor
I've been reading and trying to understand, but I cant get it to work.

I have a road network over a large area with different attributes like 1,2 and 3 describing how good the roads are. How can I restrict my analyses so it cant use roads with attribute 2 for example?

Thanks in advance!
Tags (2)
Reply
0 Kudos
3 Replies
Highlighted
MVP Esteemed Contributor
I've been reading and trying to understand, but I cant get it to work.

I have a road network over a large area with different attributes like 1,2 and 3 describing how good the roads are. How can I restrict my analyses so it cant use roads with attribute 2 for example?

Thanks in advance!


Take a look here. It describes how to set up one-way restrictions; you can use this approach to negate travel based on your "good-road" field.

Here is a description of evaluators. Take a look at the Evaluator examples section, Assigning values to restrictions.

Finally, the PDF tutorial is here.  It pretty much covers you from beginning to end...

Hope you find this helpful-
Reply
0 Kudos
Highlighted
New Contributor III
This might help a bit. If you create a restriction evaluator, and then set the Type to "Field", you can enter an expression (the little hand holding the paper on the right) to restrict the attribute you desire. The expression is this:

restricted = False
If [RoadClass] = "2" Then
restricted = True
End If

value = restricted


Where the bracketed is whatever your road class field is called, and "2" is whatever attribute you want restricted. The value goes in the separate value box below the VB code box. After you rebuild the network dataset, you should have an option to use restrictions when routing.

Hope this also helps.

eric
Reply
0 Kudos
Highlighted
New Contributor
Thanks a ton guys!

I used the script and after lots of trial and error it seems to work!
Thanks again!

/Jonas
Reply
0 Kudos