Adding a cost for crossing a junction defined by a field

691
13
10-12-2011 08:38 AM
Highlighted
New Contributor
I have built a custom cost evaluator in my network data. One aspect of it relates to edges and I have no problem with that.

I would now like to complicate it and add a component of the cost linked to junctions. If, in the evaluators window, for that attribute and in the line that corresponds to junctions (the 3rd one) I add a constant value for junctions, I have the behaviour I want.

However, rather than a constant I would like this cost to be the value of a field which I plan to add to my junctions table (the table associated with the layer whose name ends with ND_junctions).  The "Field" type of evaluator is not available for the junction. Therefore I have tried going round this with the "VB script" type of evaluator but I failed miserably.

Could you let me know how I would set the cost for junctions to be field "F" in my table xxx_ND_junctions?

Thank you
Tags (2)
Reply
0 Kudos
13 Replies
Highlighted
MVP Esteemed Contributor
I have built a custom cost evaluator in my network data. One aspect of it relates to edges and I have no problem with that.

I would now like to complicate it and add a component of the cost linked to junctions. If, in the evaluators window, for that attribute and in the line that corresponds to junctions (the 3rd one) I add a constant value for junctions, I have the behaviour I want.

However, rather than a constant I would like this cost to be the value of a field which I plan to add to my junctions table (the table associated with the layer whose name ends with ND_junctions).  The "Field" type of evaluator is not available for the junction. Therefore I have tried going round this with the "VB script" type of evaluator but I failed miserably.

Could you let me know how I would set the cost for junctions to be field "F" in my table xxx_ND_junctions?

Thank you


Couldn't you do the same thing with a turn feature class?  Even a 'straight' turn can be modeled that way...
Reply
0 Kudos
Highlighted
New Contributor
Hi Joe and thanks for your reply,

Couldn't you do the same thing with a turn feature class?  Even a 'straight' turn can be modeled that way...


I have no experience whatsoever of working with turn feature classes and from what I just checked on the documentation it doesn't seem that straightforward to me. Can you tell me a bit more what it would entail? Do you really think that it is simpler than finding the proper way to have a function in the evaluator that connects to a field?

Thanks
Reply
0 Kudos
Highlighted
MVP Esteemed Contributor
Hi Joe and thanks for your reply,



I have no experience whatsoever of working with turn feature classes and from what I just checked on the documentation it doesn't seem that straightforward to me. Can you tell me a bit more what it would entail? Do you really think that it is simpler than finding the proper way to have a function in the evaluator that connects to a field?

Thanks


You're right, they aren't that straight forward, but once you figure them out, they work very well.  Basically, you are creating a set of lines that you assign an impedance to.  There isn't enough space here nor do I have the time to describe the process fully; there are several online resources though available.  Use your favorite search engine on 'creating turn features' and see what you find.  There are several posts to this forum on the subject as well; here's one.

Friend and Colleague Mike Price at ESRi has written several excellent articles in ArcUser magazine as well: here's one. And another.

Hope this helps-
Reply
0 Kudos
Highlighted
Esri Regular Contributor
The system junctions that are created by the build of a network dataset cannot be modified. What you can do is create your own junction point feature class and add fields to it and make it part of the network. One way to "reuse" the existing junctions is to make a copy of the system junctions (use GP tool Copy Features), edit this new point feature class as you need to by adding fields, etc. Now bring up the properties of your network dataset and add the new point feature class as a source and rebuild the network. Now the system junction feature class will have no records as all the junctions have been supplied from your new point feature class.

Just remember if you edit the streets, the system junctions may start getting some features for the new intersections.

Jay Sandhu
Reply
0 Kudos
Highlighted
New Contributor
Hi Jay and thanks for your reply,

... Now bring up the properties of your network dataset and add the new point feature class as a source and rebuild the network. Now the system junction feature class will have no records as all the junctions have been supplied from your new point feature class.
Jay Sandhu


I tried to follow your instructions but hit the following problem. When I invoke the properties of the network dataset, the "add" button (in the sources tab) is disabled (and so is the remove button).
So I haven't managed to add my new feature class. Can you see a reason why it is disabled?

Thanks
Reply
0 Kudos
Highlighted
Esri Regular Contributor
Most likely the data is in use and thus you are being prevented to change it or could be read only.
Perhaps, close all your ArcGIS applications (like arcmap), then Start ArcCatalog and see if you can
alter the schema.

Regards,
Jay Sandhu
Reply
0 Kudos
Highlighted
New Contributor
Most likely the data is in use and thus you are being prevented to change it or could be read only.
Perhaps, close all your ArcGIS applications (like arcmap), then Start ArcCatalog and see if you can
alter the schema.

Regards,
Jay Sandhu


Thanks Jay but that didn't work either. I can change the file in some respects (like changing the evaluators) but adding sources is not possible. Weird. I also regenerated a new network dataset from scratch and the problem persists. If you have any suggestion of things I can try, thanks for letting me know.

Guillaume
Reply
0 Kudos
Highlighted
Esri Regular Contributor
What is the source of your features for the network dataset? Is it a shape file? In that case you will have to put your data in a file geodatabase. For shape files, you can only make a network dataset from one line feature class.

Jay Sandhu
Reply
0 Kudos
Highlighted
New Contributor
What is the source of your features for the network dataset? Is it a shape file? In that case you will have to put your data in a file geodatabase. For shape files, you can only make a network dataset from one line feature class.

Jay Sandhu


Hi Jay,
The source of my features is a shape file which explains the limitation.

I have exported my roads shape file into a geodatabase (an access-backed one) but it seems that one problem calls another for beginners: the "new network dataset" is not there anymore when I right-click on the features in the geodatabase. I must have done sthg wrong in the export?
Is there anything I must be careful about?

Thanks again,

Guillaume
Reply
0 Kudos