Restrictions - how to get it to work?

1850
3
06-19-2012 05:16 AM
JonasJonzen
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)
0 Kudos
3 Replies
JoeBorgione
MVP Emeritus
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-
That should just about do it....
0 Kudos
EricStipe
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
0 Kudos
JonasJonzen
New Contributor
Thanks a ton guys!

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

/Jonas
0 Kudos