Class SnakeRoadNetworkWalk


  • public class SnakeRoadNetworkWalk
    extends java.lang.Object
    Keeps track of the network walk results for the SnakeRoadCheck
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SnakeRoadNetworkWalk​(org.openstreetmap.atlas.geography.atlas.items.Edge edge, org.openstreetmap.atlas.utilities.scalars.Angle threshold)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addDirectConnections​(java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> edges)  
      protected void checkIfEdgeHeadingDifferenceExceedsThreshold​(org.openstreetmap.atlas.geography.atlas.items.Edge incoming, org.openstreetmap.atlas.geography.atlas.items.Edge outgoing)
      Checks if the difference in heading between the incoming and outgoing Edges exceeds the threshold
      protected void clearOneLayerRemovedConnections()  
      protected void filterFalsePositives()
      We filter false positives for two cases.
      protected java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> getConnectedMasterEdgeOfTheSameWay​(org.openstreetmap.atlas.geography.atlas.items.Edge edge)
      Returns all connected master, non-visited Edges that are a continuation of the same OSM way
      protected java.util.Queue<org.openstreetmap.atlas.geography.atlas.items.Edge> getDirectConnections()  
      protected long getGreatestEncounteredValence()  
      protected java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> getOneLayerRemovedConnections()  
      protected java.util.TreeSet<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> getVisitedEdges()  
      protected boolean isSnakeRoad()  
      protected void populateOneLayerRemovedConnections​(java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> edges)  
      protected void visitEdge​(org.openstreetmap.atlas.geography.atlas.items.Edge comingFrom, org.openstreetmap.atlas.geography.atlas.items.Edge comingTo)
      Adds the given Edge to the visited set and updates the greatest valence value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SnakeRoadNetworkWalk

        protected SnakeRoadNetworkWalk​(org.openstreetmap.atlas.geography.atlas.items.Edge edge,
                                       org.openstreetmap.atlas.utilities.scalars.Angle threshold)
    • Method Detail

      • addDirectConnections

        protected void addDirectConnections​(java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> edges)
      • checkIfEdgeHeadingDifferenceExceedsThreshold

        protected void checkIfEdgeHeadingDifferenceExceedsThreshold​(org.openstreetmap.atlas.geography.atlas.items.Edge incoming,
                                                                    org.openstreetmap.atlas.geography.atlas.items.Edge outgoing)
        Checks if the difference in heading between the incoming and outgoing Edges exceeds the threshold
        Parameters:
        incoming - The incoming Edge
        outgoing - The outgoing Edge
      • clearOneLayerRemovedConnections

        protected void clearOneLayerRemovedConnections()
      • filterFalsePositives

        protected void filterFalsePositives()
        We filter false positives for two cases. 1) If the network walk has yielded a snake road with a name, we check all of the connected roads to see if that name is shared across any of them. If it is, highly likely that the snake road is a false positive, and we remove the snake road designation. An example is when we flag a portion of highway that behaves as a snake road. 2) We do the same for ref tags to avoid flagging section of highway that exhibit snake road behavior.
      • getConnectedMasterEdgeOfTheSameWay

        protected java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> getConnectedMasterEdgeOfTheSameWay​(org.openstreetmap.atlas.geography.atlas.items.Edge edge)
        Returns all connected master, non-visited Edges that are a continuation of the same OSM way
        Parameters:
        edge - the Edge from which we're seeking connections
        Returns:
        a set of Edges
      • getDirectConnections

        protected java.util.Queue<org.openstreetmap.atlas.geography.atlas.items.Edge> getDirectConnections()
      • getGreatestEncounteredValence

        protected long getGreatestEncounteredValence()
      • getOneLayerRemovedConnections

        protected java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> getOneLayerRemovedConnections()
      • getVisitedEdges

        protected java.util.TreeSet<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> getVisitedEdges()
      • isSnakeRoad

        protected boolean isSnakeRoad()
      • populateOneLayerRemovedConnections

        protected void populateOneLayerRemovedConnections​(java.util.Set<org.openstreetmap.atlas.geography.atlas.items.Edge> edges)
      • visitEdge

        protected void visitEdge​(org.openstreetmap.atlas.geography.atlas.items.Edge comingFrom,
                                 org.openstreetmap.atlas.geography.atlas.items.Edge comingTo)
        Adds the given Edge to the visited set and updates the greatest valence value
        Parameters:
        comingFrom - the Edge we are coming from
        comingTo - the Edge we are coming to