merge master->suspectscanner

This commit is contained in:
Arndt Brenschede 2018-09-15 15:50:57 +02:00
commit 448b1db2a2
4 changed files with 29 additions and 4 deletions

View file

@ -248,7 +248,7 @@ abstract class OsmPath implements OsmLinkHolder
boolean isStartpoint = lon0 == -1 && lat0 == -1;
// check turn restrictions (n detail mode (=final pass) no TR to not mess up voice hints)
if ( nsection == 0 && !isStartpoint )
if ( nsection == 0 && rc.considerTurnRestrictions && !detailMode&& !isStartpoint )
{
boolean hasAnyPositive = false;
boolean hasPositive = false;

View file

@ -421,14 +421,25 @@ public final class OsmTrack
if ( turnInstructionMode == 2 ) // locus style
{
float lastRteTime = 0.f;
for( VoiceHint hint: voiceHints.list )
{
sb.append( " <wpt lon=\"" ).append( formatILon( hint.ilon ) ).append( "\" lat=\"" )
.append( formatILat( hint.ilat ) ).append( "\">" )
.append( hint.selev == Short.MIN_VALUE ? "" : "<ele>" + (hint.selev / 4.) + "</ele>" )
.append( "<name>" ).append( hint.getMessageString() ).append( "</name>" )
.append( "<extensions><locus:rteDistance>" ).append( "" + hint.distanceToNext ).append( "</locus:rteDistance>" )
.append( "<locus:rtePointAction>" ).append( "" + hint.getLocusAction() ).append( "</locus:rtePointAction></extensions>" )
.append( "<extensions><locus:rteDistance>" ).append( "" + hint.distanceToNext ).append( "</locus:rteDistance>" );
float rteTime = hint.getTime();
if ( rteTime != lastRteTime ) // add timing only if available
{
double t = rteTime - lastRteTime;
double speed = hint.distanceToNext / t;
sb.append( "<locus:rteTime>" ).append( "" + t ).append( "</locus:rteTime>" )
.append( "<locus:rteSpeed>" ).append( "" + speed ).append( "</locus:rteSpeed>" );
lastRteTime = rteTime;
}
sb.append( "<locus:rtePointAction>" ).append( "" + hint.getLocusAction() ).append( "</locus:rtePointAction></extensions>" )
.append( "</wpt>\n" );
}
}

View file

@ -36,6 +36,11 @@ public class VoiceHint
double distanceToNext;
int indexInTrack;
public float getTime()
{
return goodWay == null ? 0.f : goodWay.time;
}
float angle;
boolean turnAngleConsumed;
boolean needsRealTurn;

View file

@ -185,8 +185,17 @@ public class SuspectManager extends Thread
double dlon = ( ilon - 180000000 ) / 1000000.;
double dlat = ( ilat - 90000000 ) / 1000000.;
String profile = "car-eco";
File configFile = new File( "configs/" + country + ".cfg" );
if ( configFile.exists() )
{
BufferedReader br = new BufferedReader( new FileReader( configFile ) );
profile = br.readLine();
br.close();
}
String url1 = "http://brouter.de/brouter-web/#zoom=18&lat=" + dlat + "&lon=" + dlon
+ "&layer=OpenStreetMap&lonlats=" + dlon + "," + dlat + "&profile=car-eco-de";
+ "&layer=OpenStreetMap&lonlats=" + dlon + "," + dlat + "&profile=" + profile;
// String url1 = "http://localhost:8080/brouter-web/#map=18/" + dlat + "/"
// + dlon + "/Mapsforge Tile Server&lonlats=" + dlon + "," + dlat;