Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am having difficulties creating turn restrictions in ArcObjects. I have found a way to Add a a network turn to restrictions through the INetworkForwardStarEx.AddTurnRestriction() interface. But how to I create the INetworkTurn that this method takes.

share|improve this question

3 Answers 3

INetworkTurn is a noncreatable object. You can only get it from querying an existing turn element. So if the turn you are trying to query does not yet exist, you will have to first create it.

Once you do have a turn, you will need to use INetworkQuery.QueryTurn and pass in the turn element ID as an argument.

http://resources.esri.com/help/9.3/ArcGISEngine/arcobjects/esriGeoDatabase/INetworkQuery_QueryTurn.htm

This method will return INetworkTurn for you. You can then pass this value into INetworkForwardStarEx.AddTurnRestriction()

Hope this helps.

share|improve this answer

My guess is that you have to have to embed the ID for the from and to interior or exterior edges in the arc.object this creates.

share|improve this answer

I have now identified the answer. You simply create the feature as a conventional feature in the turn featureclass:

A) Create a turn shape as a ratio of the road segments involved. Remember that the roads can be connected in different ways: FromPoint to FromPoint, FromPoint to Topoint, ToPoint to FromPoint or ToPoint to ToPoint. So be careful which segments, you create the turn-shape from.

C) Fill out all attributes. The attributes Edge1FCID and Edge2FCID holds the internal id of featureclass of the roads involved in the turn. These can be found in the table sde.GDB_ITEMS in the geodatabase. The fields Edge1Pos and Edge2Pos indicate how much of each road segments are involved in the turn. This value should match the shape created in A. Again, remember that the roads can be connected in different ways. That should be reflected in the Edge1Pos and Edge2Pos values.

C) Build the network.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.