public void process ( EntityContainer entityContainer ) { Entity entity = entityContainer . getEntity ( ) ; LOGGER . finest ( "Processing entity: " + entity . toString ( ) ) ; switch ( entity . getType ( ) ) { case Node : Node node = ( Node ) entity ; if ( this . nNodes == 0 ) { LOGGER . info ( "Processing nodes..." ) ; } if ( this . configuration . isProgressLogs ( ) ) { if ( nNodes % 100000 == 0 ) { System . out . print ( "Progress: Nodes " + nfCounts . format ( nNodes ) + " \r" ) ; } } ++ this . nNodes ; if ( this . configuration . isWays ( ) ) { writeNode ( node ) ; } processEntity ( node , node . getLatitude ( ) , node . getLongitude ( ) ) ; break ; case Way : if ( this . configuration . isWays ( ) ) { Way way = ( Way ) entity ; if ( this . nWays == 0 ) { LOGGER . info ( "Processing ways..." ) ; try { // Write rest nodes this . pStmtNodesC . executeBatch ( ) ; this . pStmtNodesC . clearBatch ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( this . configuration . isProgressLogs ( ) ) { if ( nWays % 10000 == 0 ) { System . out . print ( "Progress: Ways " + nfCounts . format ( nWays ) + " \r" ) ; } } ++ this . nWays ; processWay ( way ) ; } break ; case Relation : if ( this . configuration . isGeoTags ( ) && this . configuration . isWays ( ) ) { Relation relation = ( Relation ) entity ; if ( this . nRelations == 0 ) { LOGGER . info ( "Processing relations..." ) ; this . geoTagger . commit ( ) ; } this . geoTagger . filterBoundaries ( relation ) ; if ( this . configuration . isProgressLogs ( ) ) { if ( nRelations % 10000 == 0 ) { System . out . print ( "Progress: Relations " + nfCounts . format ( nRelations ) + " \r" ) ; } } ++ this . nRelations ; } break ; default : break ; } // Hint to GC entity = null ; }
Process task .