Changeset 27952 in osm


Ignore:
Timestamp:
2012-02-27T14:49:04+01:00 (12 years ago)
Author:
franpd
Message:

added one-way support

Location:
applications/editors/josm/plugins/routing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routing/build.xml

    r27852 r27952  
    2626-->
    2727<project name="routing" default="dist" basedir=".">
    28     <property name="commit.message" value="fixed NPE at startup"/>
     28    <property name="commit.message" value="added one-way support in roundabouts"/>
    2929    <property name="plugin.main.version" value="4980"/>
    3030    <!-- Define some properties -->
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java

    r26121 r27952  
    185185           
    186186                                String oneway_val = way.get("oneway");   /*   get (oneway=?) tag for this way.   */
     187                                String junction_val = way.get("junction");   /*   get (junction=?) tag for this way.   */
    187188           
    188189                                from = nodes.get(0);                   /*   1st node A  */
     
    198199                                   
    199200                                    //this is where we link the vertices
    200                                                 if (oneway_val == null || oneway_val == "false" || oneway_val == "no" || oneway_val == "0") {
    201                                                 //Case 1 (bi-way): oneway=false OR oneway=unset OR oneway=0 OR oneway=no
     201                                                if (oneway_val == null && junction_val == "roundabout") {
     202                                    //Case (roundabout): oneway=implicit yes
     203                                                  addEdgeNormalOneway(way, from, to);
     204                                               
     205                                                } else if (oneway_val == null || oneway_val == "false" || oneway_val == "no" || oneway_val == "0") {
     206                                                //Case (bi-way): oneway=false OR oneway=unset OR oneway=0 OR oneway=no
    202207                                                  addEdgeBidirectional(way, from, to);
    203208                                                 
    204209                                                } else if (oneway_val == "-1") {
    205                                                 //Case 2 (oneway reverse): oneway=-1
     210                                                //Case (oneway reverse): oneway=-1
    206211                                                  addEdgeReverseOneway(way, from, to);
    207212                                               
    208213                                                } else if (oneway_val == "1" || oneway_val == "yes" || oneway_val == "true") {
    209               //Case 3 (oneway normal): oneway=yes OR 1 OR true
     214                                                //Case (oneway normal): oneway=yes OR 1 OR true
    210215                                                  addEdgeNormalOneway(way, from, to);                           
    211216                               
Note: See TracChangeset for help on using the changeset viewer.