map access layer cleanup

This commit is contained in:
Arndt 2015-09-12 16:12:24 +02:00
parent 2cec35f3cc
commit f8dee5b7d1
7 changed files with 163 additions and 150 deletions

View file

@ -109,7 +109,7 @@ final class OsmPath implements OsmLinkHolder
private void addAddionalPenalty(OsmTrack refTrack, boolean detailMode, OsmPath origin, OsmLink link, RoutingContext rc )
{
if ( link.descriptionBitmap == null ) throw new IllegalArgumentException( "null description for class: " + link.getClass() );
if ( link.descriptionBitmap == null ) throw new IllegalArgumentException( "null description for: " + link );
boolean recordTransferNodes = detailMode || rc.countTraffic;
boolean recordMessageData = detailMode;

View file

@ -381,7 +381,7 @@ public class RoutingEngine extends Thread
{
continue;
}
expandHollowLinkTargets( n, false );
expandHollowLinkTargets( n );
OsmLink startLink = new OsmLink();
startLink.targetNode = n;
OsmPath startPath = new OsmPath( startLink );
@ -418,30 +418,12 @@ public class RoutingEngine extends Thread
}
// expand hollow link targets and resolve reverse links
private void expandHollowLinkTargets( OsmNode n, boolean failOnReverseNotFound )
private void expandHollowLinkTargets( OsmNode n )
{
for( OsmLink link = n.firstlink; link != null; link = link.next )
{
if ( ! nodesCache.obtainNonHollowNode( link.targetNode ) )
{
continue;
}
if ( link.counterLinkWritten )
{
OsmLink rlink = link.targetNode.getReverseLink( n.getILon(), n.getILat() );
if ( rlink == null )
{
if ( failOnReverseNotFound ) throw new RuntimeException( "reverse link not found!" );
}
else
{
link.descriptionBitmap = rlink.descriptionBitmap;
link.firsttransferBytes = rlink.firsttransferBytes;
}
}
nodesCache.obtainNonHollowNode( link.targetNode );
}
n.wasProcessed = true;
}
private OsmTrack searchTrack( MatchedWaypoint startWp, MatchedWaypoint endWp, OsmTrack nearbyTrack, OsmTrack refTrack )
@ -541,7 +523,7 @@ public class RoutingEngine extends Thread
{
return null;
}
expandHollowLinkTargets( start, true );
expandHollowLinkTargets( start );
return start;
}
@ -804,10 +786,7 @@ public class RoutingEngine extends Thread
continue;
}
if ( !currentNode.wasProcessed )
{
expandHollowLinkTargets( currentNode, true );
}
expandHollowLinkTargets( currentNode );
if ( sourceNode != null )
{