1.3 preparation

This commit is contained in:
Arndt Brenschede 2015-10-15 19:12:05 +02:00
parent 20212963ba
commit 112d04979b
21 changed files with 51 additions and 61 deletions

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-codec</artifactId> <artifactId>brouter-codec</artifactId>

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-core</artifactId> <artifactId>brouter-core</artifactId>

View file

@ -253,7 +253,7 @@ public final class OsmTrack
sb.append( " xmlns=\"http://www.topografix.com/GPX/1/1\" \n" ); 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( " 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( " 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( " <trk>\n" ); sb.append( " <trk>\n" );
sb.append(" <name>").append(name).append("</name>\n"); sb.append(" <name>").append(name).append("</name>\n");
sb.append( " <trkseg>\n" ); sb.append( " <trkseg>\n" );

View file

@ -223,8 +223,8 @@ public class RoutingEngine extends Thread
} }
catch( Error e) catch( Error e)
{ {
String hint = cleanOnOOM(); cleanOnOOM();
errorMessage = e.toString() + hint; errorMessage = e.toString();
logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage ); logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage );
logThrowable( e ); logThrowable( e );
} }
@ -268,8 +268,8 @@ public class RoutingEngine extends Thread
} }
catch( Error e) catch( Error e)
{ {
String hint = cleanOnOOM(); cleanOnOOM();
errorMessage = e.toString() + hint; errorMessage = e.toString();
logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage ); logInfo( "Error (linksProcessed=" + linksProcessed + ": " + errorMessage );
logThrowable( e ); 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; nodesMap = null;
terminate(); terminate();
return oom_carsubset_hint ? "\nPlease use 'carsubset' maps for long-distance car-routing" : "";
} }

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-expressions</artifactId> <artifactId>brouter-expressions</artifactId>

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-map-creator</artifactId> <artifactId>brouter-map-creator</artifactId>

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-mapaccess</artifactId> <artifactId>brouter-mapaccess</artifactId>

View file

@ -39,7 +39,6 @@ public final class NodesCache
public WaypointMatcher waypointMatcher; public WaypointMatcher waypointMatcher;
public boolean oom_carsubset_hint = false;
public boolean first_file_access_failed = false; public boolean first_file_access_failed = false;
public String first_file_access_name; public String first_file_access_name;
@ -67,7 +66,6 @@ public final class NodesCache
{ {
fileCache = oldCache.fileCache; fileCache = oldCache.fileCache;
dataBuffers = oldCache.dataBuffers; dataBuffers = oldCache.dataBuffers;
oom_carsubset_hint = oldCache.oom_carsubset_hint;
secondarySegmentsDir = oldCache.secondarySegmentsDir; secondarySegmentsDir = oldCache.secondarySegmentsDir;
// re-use old, virgin caches // 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, // if the cache sum exceeded a threshold,
// clean all ghosts and enable garbage collection // clean all ghosts and enable garbage collection
private void checkEnableCacheCleaning() private void checkEnableCacheCleaning()
@ -260,19 +241,32 @@ public final class NodesCache
if ( !fileCache.containsKey( filenameBase ) ) if ( !fileCache.containsKey( filenameBase ) )
{ {
File f = null; File f = null;
if ( carMode ) if ( !forceSecondaryData )
{ {
File carFile = getFileFromSegmentDir( "carsubset/" + filenameBase + ".cd5" ); File primary = new File( segmentDir, filenameBase + ".rd5" );
if ( carFile.exists() ) if ( primary .exists() )
f = carFile; {
f = primary;
}
} }
if ( f == null ) if ( f == null )
{ {
File fullFile = getFileFromSegmentDir( filenameBase + ".rd5" ); if ( carMode ) // look for carsubset-files only in secondary (primaries are now good for car-mode)
if ( fullFile.exists() ) {
f = fullFile; File carFile = new File( secondarySegmentsDir, "carsubset/" + filenameBase + ".cd5" );
if ( carMode && f != null ) if ( carFile.exists() )
oom_carsubset_hint = true; {
f = carFile;
}
}
if ( f == null )
{
File secondary = new File( secondarySegmentsDir, filenameBase + ".rd5" );
if ( secondary.exists() )
{
f = secondary;
}
}
} }
if ( f != null ) if ( f != null )
{ {

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-mem-router</artifactId> <artifactId>brouter-mem-router</artifactId>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="6" android:versionCode="7"
android:versionName="1.2" package="btools.routingapp"> android:versionName="1.3" package="btools.routingapp">
<application android:icon="@drawable/icon" android:label="@string/app_name"> <application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".BRouterActivity" <activity android:name=".BRouterActivity"
android:label="@string/app_name" android:label="@string/app_name"

Binary file not shown.

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-routing-app</artifactId> <artifactId>brouter-routing-app</artifactId>

View file

@ -195,9 +195,9 @@ public class BInstallerView extends View
{ {
clearTileSelection( MASK_INSTALLED_RD5 | MASK_CURRENT_RD5 ); 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 ) if ( secondary != null )
{ {
scanExistingFiles( secondary ); scanExistingFiles( secondary );
@ -597,7 +597,7 @@ float tx, ty;
input = connection.getInputStream(); input = connection.getInputStream();
int slidx = surl.lastIndexOf( "segments4/" ); 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" ); tmp_file = new File( fname + "_tmp" );
output = new FileOutputStream( tmp_file ); output = new FileOutputStream( tmp_file );

View file

@ -57,7 +57,7 @@ public class BRouterService extends Service
{ {
String modesFile = baseDir + "/brouter/modes/serviceconfig.dat"; String modesFile = baseDir + "/brouter/modes/serviceconfig.dat";
br = new BufferedReader( new FileReader (modesFile ) ); br = new BufferedReader( new FileReader (modesFile ) );
worker.segmentDir = baseDir + "/brouter/segments3"; worker.segmentDir = baseDir + "/brouter/segments4";
for(;;) for(;;)
{ {
String line = br.readLine(); String line = br.readLine();

View file

@ -147,9 +147,8 @@ public class BRouterView extends View
// create missing directories // create missing directories
assertDirectoryExists( "project directory", basedir + "/brouter", null ); assertDirectoryExists( "project directory", basedir + "/brouter", null );
segmentDir = basedir + "/brouter/segments3"; segmentDir = basedir + "/brouter/segments4";
assertDirectoryExists( "data directory", segmentDir, "segments3.zip" ); assertDirectoryExists( "data directory", segmentDir, "segments4.zip" );
assertDirectoryExists( "carsubset directory", segmentDir + "/carsubset", null );
profileDir = basedir + "/brouter/profiles2"; profileDir = basedir + "/brouter/profiles2";
assertDirectoryExists( "profile directory", profileDir, "profiles2.zip" ); assertDirectoryExists( "profile directory", profileDir, "profiles2.zip" );
modesDir = basedir + "/brouter/modes"; modesDir = basedir + "/brouter/modes";
@ -501,11 +500,10 @@ private long startTime = 0L;
catch( Throwable t ) catch( Throwable t )
{ {
// on out of mem, try to stop the show // on out of mem, try to stop the show
String hint = ""; if ( cr != null ) cr.cleanOnOOM();
if ( cr != null ) hint = cr.cleanOnOOM();
cr = null; cr = null;
try { Thread.sleep( 2000 ); } catch( InterruptedException ie ) {} try { Thread.sleep( 2000 ); } catch( InterruptedException ie ) {}
((BRouterActivity)getContext()).showErrorMessage( t.toString() + hint ); ((BRouterActivity)getContext()).showErrorMessage( t.toString() );
waitingForSelection = true; waitingForSelection = true;
} }
} }
@ -535,7 +533,7 @@ private long startTime = 0L;
} }
else else
{ {
String result = "version = BRouter-1.2\n" String result = "version = BRouter-1.3\n"
+ "distance = " + cr.getDistance()/1000. + " km\n" + "distance = " + cr.getDistance()/1000. + " km\n"
+ "filtered ascend = " + cr.getAscend() + " m\n" + "filtered ascend = " + cr.getAscend() + " m\n"
+ "plain ascend = " + cr.getPlainAscend(); + "plain ascend = " + cr.getPlainAscend();

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-server</artifactId> <artifactId>brouter-server</artifactId>

View file

@ -88,7 +88,7 @@ public class BRouter
} }
System.exit(0); System.exit(0);
} }
System.out.println("BRouter 1.2 / 04042015 / abrensch"); System.out.println("BRouter 1.3 / 18102015 / abrensch");
if ( args.length < 6 ) if ( args.length < 6 )
{ {
System.out.println("Find routes in an OSM map"); System.out.println("Find routes in an OSM map");

View file

@ -138,7 +138,7 @@ public class RouteServer extends Thread
public static void main(String[] args) throws Exception 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 ) if ( args.length != 5 )
{ {
System.out.println("serve BRouter protocol"); System.out.println("serve BRouter protocol");

View file

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>brouter-util</artifactId> <artifactId>brouter-util</artifactId>

View file

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.btools</groupId> <groupId>org.btools</groupId>
<artifactId>brouter</artifactId> <artifactId>brouter</artifactId>
<version>1.2</version> <version>1.3</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<url>http://brouter.de/brouter/</url> <url>http://brouter.de/brouter/</url>
<name>brouter</name> <name>brouter</name>