minor refactoring

This commit is contained in:
Arndt Brenschede 2019-04-17 11:33:07 +02:00
parent 126c104bb3
commit 19e434facb
18 changed files with 138 additions and 115 deletions

View file

@ -230,6 +230,13 @@ public final class NodesCache
}
}
/**
* make sure the given node is non-hollow,
* which means it contains not just the id,
* but also the actual data
*
* @return true if successfull, false if node is still hollow
*/
public boolean obtainNonHollowNode( OsmNode node )
{
if ( !node.isHollow() )
@ -255,6 +262,19 @@ public final class NodesCache
return !node.isHollow();
}
/**
* make sure all link targets of the given node are non-hollow
*/
public void expandHollowLinkTargets( OsmNode n )
{
for( OsmLink link = n.firstlink; link != null; link = link.getNext( n ) )
{
obtainNonHollowNode( link.getTarget( n ) );
}
}
private OsmFile fileForSegment( int lonDegree, int latDegree ) throws Exception
{
int lonMod5 = lonDegree % 5;