preprocessor speedup using more memory

This commit is contained in:
Arndt Brenschede 2019-09-24 08:32:18 +02:00
parent 76e4ef8cab
commit ba34488447
10 changed files with 236 additions and 69 deletions

View file

@ -31,14 +31,25 @@ public class WayCutter extends MapCreatorBase
public void process( File nodeTilesIn, File wayFileIn, File wayTilesOut ) throws Exception
{
this.outTileDir = wayTilesOut;
init( wayTilesOut );
// *** read all nodes into tileIndexMap
tileIndexMap = Boolean.getBoolean( "useDenseMaps" ) ? new DenseLongMap() : new TinyDenseLongMap();
new NodeIterator( this, false ).processDir( nodeTilesIn, ".tlf" );
// *** finally process the way-file, cutting into pieces
new WayIterator( this, true ).processFile( wayFileIn );
finish();
}
public void init( File wayTilesOut ) throws Exception
{
this.outTileDir = wayTilesOut;
// *** read all nodes into tileIndexMap
tileIndexMap = Boolean.getBoolean( "useDenseMaps" ) ? new DenseLongMap() : new TinyDenseLongMap();
}
public void finish() throws Exception
{
closeTileOutStreams();
}