Hi,
I refer to this code below;
1. if a link is bidirectional: this is already how the gama model works by default to allow movement in both directions. Is it no ? If yes, then why does the code have to create again 2 roads of opposite direction ?
2. if a link is one way: it is important to know in which direction is it one way. I do not understand why the code below reverses the direction of a road ? how does it know the 'real' world direction ? Is it standard that in OSM the oneway is always marked in the opposite direction of the digitized direction.
3. what about using this code with a shapefile, we then have to be careful with real world directions?
Please could you explain on these.
regards,
Sriramaa
-----------------\\\\\\\--------------------------------
init {
create road from: road_file with:[direction::int(read("DIRECTION"))] {
switch direction {
match 0 {color <- rgb("green");}
match 1 {color <- rgb("red");
//inversion of the road geometry
shape <- polyline(reverse(shape.points));
}
match 2 {color <- rgb("blue");
//bidirectional: creation of the inverse road
create road {
shape <- polyline(reverse(myself.shape.points));
direction <- 2;
color <- rgb("blue");
}
}
}
}
-----------------\\\\\\\--------------------------------