diff --git a/brouter-codec/pom.xml b/brouter-codec/pom.xml index ccf8518..ef7b883 100644 --- a/brouter-codec/pom.xml +++ b/brouter-codec/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-codec diff --git a/brouter-core/pom.xml b/brouter-core/pom.xml index 8a486b2..8df526e 100644 --- a/brouter-core/pom.xml +++ b/brouter-core/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-core diff --git a/brouter-core/src/main/java/btools/router/OsmTrack.java b/brouter-core/src/main/java/btools/router/OsmTrack.java index e8a2242..917ef53 100644 --- a/brouter-core/src/main/java/btools/router/OsmTrack.java +++ b/brouter-core/src/main/java/btools/router/OsmTrack.java @@ -253,7 +253,7 @@ public final class OsmTrack sb.append( " xmlns=\"http://www.topografix.com/GPX/1/1\" \n" ); sb.append( " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" ); sb.append( " xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\" \n" ); - sb.append( " creator=\"BRouter-1.2\" version=\"1.1\">\n" ); + sb.append( " creator=\"BRouter-1.3\" version=\"1.1\">\n" ); sb.append( " \n" ); sb.append(" ").append(name).append("\n"); sb.append( " \n" ); diff --git a/brouter-core/src/main/java/btools/router/RoutingEngine.java b/brouter-core/src/main/java/btools/router/RoutingEngine.java index 8ad6398..b2d56d7 100644 --- a/brouter-core/src/main/java/btools/router/RoutingEngine.java +++ b/brouter-core/src/main/java/btools/router/RoutingEngine.java @@ -223,8 +223,8 @@ public class RoutingEngine extends Thread } catch( Error e) { - String hint = cleanOnOOM(); - errorMessage = e.toString() + hint; + cleanOnOOM(); + errorMessage = e.toString(); logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage ); logThrowable( e ); } @@ -268,8 +268,8 @@ public class RoutingEngine extends Thread } catch( Error e) { - String hint = cleanOnOOM(); - errorMessage = e.toString() + hint; + cleanOnOOM(); + errorMessage = e.toString(); logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage ); logThrowable( e ); } @@ -291,12 +291,10 @@ public class RoutingEngine extends Thread } } - public String cleanOnOOM() + public void cleanOnOOM() { - boolean oom_carsubset_hint = nodesCache == null ? false : nodesCache.oom_carsubset_hint; nodesMap = null; terminate(); - return oom_carsubset_hint ? "\nPlease use 'carsubset' maps for long-distance car-routing" : ""; } diff --git a/brouter-expressions/pom.xml b/brouter-expressions/pom.xml index 86d2ac9..d0901f9 100644 --- a/brouter-expressions/pom.xml +++ b/brouter-expressions/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-expressions diff --git a/brouter-map-creator/pom.xml b/brouter-map-creator/pom.xml index 9be4c89..ea033ca 100644 --- a/brouter-map-creator/pom.xml +++ b/brouter-map-creator/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-map-creator diff --git a/brouter-mapaccess/pom.xml b/brouter-mapaccess/pom.xml index 0ff9336..ab3c28b 100644 --- a/brouter-mapaccess/pom.xml +++ b/brouter-mapaccess/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-mapaccess diff --git a/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java b/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java index b4ee2fa..725bb34 100644 --- a/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java +++ b/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java @@ -39,7 +39,6 @@ public final class NodesCache public WaypointMatcher waypointMatcher; - public boolean oom_carsubset_hint = false; public boolean first_file_access_failed = false; public String first_file_access_name; @@ -67,7 +66,6 @@ public final class NodesCache { fileCache = oldCache.fileCache; dataBuffers = oldCache.dataBuffers; - oom_carsubset_hint = oldCache.oom_carsubset_hint; secondarySegmentsDir = oldCache.secondarySegmentsDir; // re-use old, virgin caches @@ -91,23 +89,6 @@ public final class NodesCache } } - private File getFileFromSegmentDir( String filename ) - { - if ( forceSecondaryData ) - { - return new File( secondarySegmentsDir, filename ); - } - - File f = new File( segmentDir, filename ); - if ( secondarySegmentsDir != null && !f.exists() ) - { - File f2 = new File( secondarySegmentsDir, filename ); - if ( f2.exists() ) - return f2; - } - return f; - } - // if the cache sum exceeded a threshold, // clean all ghosts and enable garbage collection private void checkEnableCacheCleaning() @@ -260,19 +241,32 @@ public final class NodesCache if ( !fileCache.containsKey( filenameBase ) ) { File f = null; - if ( carMode ) + if ( !forceSecondaryData ) { - File carFile = getFileFromSegmentDir( "carsubset/" + filenameBase + ".cd5" ); - if ( carFile.exists() ) - f = carFile; + File primary = new File( segmentDir, filenameBase + ".rd5" ); + if ( primary .exists() ) + { + f = primary; + } } if ( f == null ) { - File fullFile = getFileFromSegmentDir( filenameBase + ".rd5" ); - if ( fullFile.exists() ) - f = fullFile; - if ( carMode && f != null ) - oom_carsubset_hint = true; + if ( carMode ) // look for carsubset-files only in secondary (primaries are now good for car-mode) + { + File carFile = new File( secondarySegmentsDir, "carsubset/" + filenameBase + ".cd5" ); + if ( carFile.exists() ) + { + f = carFile; + } + } + if ( f == null ) + { + File secondary = new File( secondarySegmentsDir, filenameBase + ".rd5" ); + if ( secondary.exists() ) + { + f = secondary; + } + } } if ( f != null ) { diff --git a/brouter-mem-router/pom.xml b/brouter-mem-router/pom.xml index 0fdb021..5a4b726 100644 --- a/brouter-mem-router/pom.xml +++ b/brouter-mem-router/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-mem-router diff --git a/brouter-routing-app/AndroidManifest.xml b/brouter-routing-app/AndroidManifest.xml index 5fcb313..e00558f 100644 --- a/brouter-routing-app/AndroidManifest.xml +++ b/brouter-routing-app/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="7" + android:versionName="1.3" package="btools.routingapp"> org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-routing-app diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerView.java b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerView.java index 3aa88ec..9627568 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerView.java @@ -195,9 +195,9 @@ public class BInstallerView extends View { clearTileSelection( MASK_INSTALLED_RD5 | MASK_CURRENT_RD5 ); - scanExistingFiles( new File( baseDir + "/brouter/segments3" ) ); + scanExistingFiles( new File( baseDir + "/brouter/segments4" ) ); - File secondary = RoutingHelper.getSecondarySegmentDir( baseDir + "/brouter/segments3" ); + File secondary = RoutingHelper.getSecondarySegmentDir( baseDir + "/brouter/segments4" ); if ( secondary != null ) { scanExistingFiles( secondary ); @@ -597,7 +597,7 @@ float tx, ty; input = connection.getInputStream(); int slidx = surl.lastIndexOf( "segments4/" ); - fname = baseDir + "/brouter/segments3/" + surl.substring( slidx+10 ); + fname = baseDir + "/brouter/segments4/" + surl.substring( slidx+10 ); tmp_file = new File( fname + "_tmp" ); output = new FileOutputStream( tmp_file ); diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterService.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterService.java index 40f4fd4..c667fb6 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterService.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterService.java @@ -57,7 +57,7 @@ public class BRouterService extends Service { String modesFile = baseDir + "/brouter/modes/serviceconfig.dat"; br = new BufferedReader( new FileReader (modesFile ) ); - worker.segmentDir = baseDir + "/brouter/segments3"; + worker.segmentDir = baseDir + "/brouter/segments4"; for(;;) { String line = br.readLine(); diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index f34bb42..af76db6 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -147,9 +147,8 @@ public class BRouterView extends View // create missing directories assertDirectoryExists( "project directory", basedir + "/brouter", null ); - segmentDir = basedir + "/brouter/segments3"; - assertDirectoryExists( "data directory", segmentDir, "segments3.zip" ); - assertDirectoryExists( "carsubset directory", segmentDir + "/carsubset", null ); + segmentDir = basedir + "/brouter/segments4"; + assertDirectoryExists( "data directory", segmentDir, "segments4.zip" ); profileDir = basedir + "/brouter/profiles2"; assertDirectoryExists( "profile directory", profileDir, "profiles2.zip" ); modesDir = basedir + "/brouter/modes"; @@ -501,11 +500,10 @@ private long startTime = 0L; catch( Throwable t ) { // on out of mem, try to stop the show - String hint = ""; - if ( cr != null ) hint = cr.cleanOnOOM(); + if ( cr != null ) cr.cleanOnOOM(); cr = null; try { Thread.sleep( 2000 ); } catch( InterruptedException ie ) {} - ((BRouterActivity)getContext()).showErrorMessage( t.toString() + hint ); + ((BRouterActivity)getContext()).showErrorMessage( t.toString() ); waitingForSelection = true; } } @@ -535,7 +533,7 @@ private long startTime = 0L; } else { - String result = "version = BRouter-1.2\n" + String result = "version = BRouter-1.3\n" + "distance = " + cr.getDistance()/1000. + " km\n" + "filtered ascend = " + cr.getAscend() + " m\n" + "plain ascend = " + cr.getPlainAscend(); diff --git a/brouter-server/pom.xml b/brouter-server/pom.xml index 14ae037..bfaaa30 100644 --- a/brouter-server/pom.xml +++ b/brouter-server/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-server diff --git a/brouter-server/src/main/java/btools/server/BRouter.java b/brouter-server/src/main/java/btools/server/BRouter.java index 87bb2d4..e013ba1 100644 --- a/brouter-server/src/main/java/btools/server/BRouter.java +++ b/brouter-server/src/main/java/btools/server/BRouter.java @@ -88,7 +88,7 @@ public class BRouter } System.exit(0); } - System.out.println("BRouter 1.2 / 04042015 / abrensch"); + System.out.println("BRouter 1.3 / 18102015 / abrensch"); if ( args.length < 6 ) { System.out.println("Find routes in an OSM map"); diff --git a/brouter-server/src/main/java/btools/server/RouteServer.java b/brouter-server/src/main/java/btools/server/RouteServer.java index 01abf05..173bcad 100644 --- a/brouter-server/src/main/java/btools/server/RouteServer.java +++ b/brouter-server/src/main/java/btools/server/RouteServer.java @@ -138,7 +138,7 @@ public class RouteServer extends Thread public static void main(String[] args) throws Exception { - System.out.println("BRouter 1.2 / 07022015"); + System.out.println("BRouter 1.3 / 18102015"); if ( args.length != 5 ) { System.out.println("serve BRouter protocol"); diff --git a/brouter-util/pom.xml b/brouter-util/pom.xml index 67982f0..c005b4d 100644 --- a/brouter-util/pom.xml +++ b/brouter-util/pom.xml @@ -5,7 +5,7 @@ org.btools brouter - 1.2 + 1.3 ../pom.xml brouter-util diff --git a/pom.xml b/pom.xml index fbdb11e..ec9299a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.btools brouter - 1.2 + 1.3 pom http://brouter.de/brouter/ brouter