no waypoint sanity checks when just reading nogos
This commit is contained in:
parent
de5f70b9d9
commit
2f6309334f
2 changed files with 14 additions and 3 deletions
|
@ -105,7 +105,7 @@ public class BRouterService extends Service
|
||||||
worker.profilePath = baseDir + "/brouter/profiles2/" + smc.profile + ".brf";
|
worker.profilePath = baseDir + "/brouter/profiles2/" + smc.profile + ".brf";
|
||||||
worker.rawTrackPath = baseDir + "/brouter/modes/" + mode_key + "_rawtrack.dat";
|
worker.rawTrackPath = baseDir + "/brouter/modes/" + mode_key + "_rawtrack.dat";
|
||||||
|
|
||||||
CoordinateReader cor = CoordinateReader.obtainValidReader( baseDir, worker.segmentDir );
|
CoordinateReader cor = CoordinateReader.obtainValidReader( baseDir, worker.segmentDir, true );
|
||||||
worker.nogoList = new ArrayList<OsmNodeNamed>();
|
worker.nogoList = new ArrayList<OsmNodeNamed>();
|
||||||
// veto nogos by profiles veto list
|
// veto nogos by profiles veto list
|
||||||
for ( OsmNodeNamed nogo : cor.nogopoints )
|
for ( OsmNodeNamed nogo : cor.nogopoints )
|
||||||
|
@ -142,7 +142,7 @@ public class BRouterService extends Service
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// add nogos from waypoint database
|
// add nogos from waypoint database
|
||||||
CoordinateReader cor = CoordinateReader.obtainValidReader( baseDir, worker.segmentDir );
|
CoordinateReader cor = CoordinateReader.obtainValidReader( baseDir, worker.segmentDir, true );
|
||||||
worker.nogoList = new ArrayList<OsmNodeNamed>( cor.nogopoints );
|
worker.nogoList = new ArrayList<OsmNodeNamed>( cor.nogopoints );
|
||||||
|
|
||||||
if ( !fileEqual( profileBytes, profileFile ) )
|
if ( !fileEqual( profileBytes, profileFile ) )
|
||||||
|
|
|
@ -25,6 +25,8 @@ public abstract class CoordinateReader
|
||||||
public String rootdir;
|
public String rootdir;
|
||||||
public String tracksdir;
|
public String tracksdir;
|
||||||
|
|
||||||
|
private boolean nogosOnly;
|
||||||
|
|
||||||
private Map<String,Map<String, OsmNodeNamed>> allpointsMap;
|
private Map<String,Map<String, OsmNodeNamed>> allpointsMap;
|
||||||
public List<OsmNodeNamed> allpoints;
|
public List<OsmNodeNamed> allpoints;
|
||||||
|
|
||||||
|
@ -128,10 +130,13 @@ public abstract class CoordinateReader
|
||||||
if ( isKnown )
|
if ( isKnown )
|
||||||
{
|
{
|
||||||
if ( pointmap.put( n.name, n ) != null )
|
if ( pointmap.put( n.name, n ) != null )
|
||||||
|
{
|
||||||
|
if ( !nogosOnly )
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException( "multiple " + n.name + "-positions!" );
|
throw new IllegalArgumentException( "multiple " + n.name + "-positions!" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if ( n.name != null && n.name.startsWith( "nogo" ) )
|
else if ( n.name != null && n.name.startsWith( "nogo" ) )
|
||||||
{
|
{
|
||||||
n.isNogo = true;
|
n.isNogo = true;
|
||||||
|
@ -144,6 +149,11 @@ public abstract class CoordinateReader
|
||||||
|
|
||||||
|
|
||||||
public static CoordinateReader obtainValidReader( String basedir, String segmentDir ) throws Exception
|
public static CoordinateReader obtainValidReader( String basedir, String segmentDir ) throws Exception
|
||||||
|
{
|
||||||
|
return obtainValidReader( basedir, segmentDir, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CoordinateReader obtainValidReader( String basedir, String segmentDir, boolean nogosOnly ) throws Exception
|
||||||
{
|
{
|
||||||
CoordinateReader cor = null;
|
CoordinateReader cor = null;
|
||||||
ArrayList<CoordinateReader> rl = new ArrayList<CoordinateReader>();
|
ArrayList<CoordinateReader> rl = new ArrayList<CoordinateReader>();
|
||||||
|
@ -209,6 +219,7 @@ public abstract class CoordinateReader
|
||||||
{
|
{
|
||||||
cor = new CoordinateReaderNone();
|
cor = new CoordinateReaderNone();
|
||||||
}
|
}
|
||||||
|
cor.nogosOnly = nogosOnly;
|
||||||
cor.readFromTo();
|
cor.readFromTo();
|
||||||
return cor;
|
return cor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue