Skip to main content
. 2018 Jun 23;18(7):2020. doi: 10.3390/s18072020
Algorithm 1 Segment reunification strategy.
  • Require: 

    Road Network file, edges files

  • Ensure: 

    Reunified segment file

  • 1:

    edgeConnectedNoIntersection[] dictionary that stores all edges without intersections

  • 2:

    for all edge in Road Network file do

  • 3:

        edge_id store the edge id of the road network file

  • 4:

        connections[] dictionary that stores all connections for that edge id

  • 5:

        for all connection in Road Network file do

  • 6:

            connection_from store the edge id(from) of the road network file

  • 7:

            connection_to store the edge id(to) of the road network file

  • 8:

            if (connection_from=edge_id) and (connection_to notin connections) then

  • 9:

               connections[edge_id]connection_to

  • 10:

           end if

  • 11:

       end for

  • 12:

       if edge_id partition = TRUE then

  • 13:

           lenEdgeConnect length of dictionary in a specific edge id

  • 14:

           street_id code of the street

  • 15:

           for i=0 to length(connections[edge_id]) do

  • 16:

              if (lenEdgeConnect=1) and (connections[edge_id][i] partition = TRUE) and (street_id in edge_id) and (street_id in connections[edge_id][i]) then

  • 17:

                  edgeConnectedNoIntersection[edge_id]connections[edge_id][i]

  • 18:

              else

  • 19:

                  edge_id has some intersecting segments, cannot reunify

  • 20:

              end if

  • 21:

           end for

  • 22:

       else

  • 23:

           edge_id is not split, reunification is unnecessary

  • 24:

       end if

  • 25:

    end for