Update warnings & settings with new routing
This commit is contained in:
parent
1370e3050d
commit
be06d96141
4 changed files with 17 additions and 5 deletions
|
@ -107,6 +107,7 @@ public class BinaryMapIndexReader {
|
||||||
codedIS = CodedInputStream.newInstance(raf);
|
codedIS = CodedInputStream.newInstance(raf);
|
||||||
codedIS.setSizeLimit(Integer.MAX_VALUE); // 2048 MB
|
codedIS.setSizeLimit(Integer.MAX_VALUE); // 2048 MB
|
||||||
version = referenceToSameFile.version;
|
version = referenceToSameFile.version;
|
||||||
|
dateCreated = referenceToSameFile.dateCreated;
|
||||||
transportAdapter = new BinaryMapTransportReaderAdapter(this);
|
transportAdapter = new BinaryMapTransportReaderAdapter(this);
|
||||||
addressAdapter = new BinaryMapAddressReaderAdapter(this);
|
addressAdapter = new BinaryMapAddressReaderAdapter(this);
|
||||||
poiAdapter = new BinaryMapPoiReaderAdapter(this);
|
poiAdapter = new BinaryMapPoiReaderAdapter(this);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -366,7 +367,12 @@ public class RoutingContext {
|
||||||
|
|
||||||
public void checkOldRoutingFiles(BinaryMapIndexReader key) {
|
public void checkOldRoutingFiles(BinaryMapIndexReader key) {
|
||||||
if(calculationMode == RouteCalculationMode.BASE && key.getDateCreated() < 1390431600000l) { // new SimpleDateFormat("dd-MM-yyyy").parse("23-01-2014").getTime()
|
if(calculationMode == RouteCalculationMode.BASE && key.getDateCreated() < 1390431600000l) { // new SimpleDateFormat("dd-MM-yyyy").parse("23-01-2014").getTime()
|
||||||
throw new RuntimeException("Update map '"+key.getRegionNames()+ "' !");
|
System.out.println(key.getDateCreated() + " " + new Date(key.getDateCreated()));
|
||||||
|
String map = "";
|
||||||
|
for (RouteRegion r : key.getRoutingIndexes()) {
|
||||||
|
map = r.getName();
|
||||||
|
}
|
||||||
|
throw new RuntimeException("Update map '"+map+ "' !");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
\n\tHardy Mueller - main parts of the project, mostly rendering, UI interaction design
|
\n\tHardy Mueller - main parts of the project, mostly rendering, UI interaction design
|
||||||
|
|
||||||
\n\nCredits to all major Contributors/Developers :
|
\n\nCredits to all major Contributors/Developers :
|
||||||
\n\tV.S. - project lead
|
\n\tVictor Shcherb - project lead
|
||||||
\n\tPavol Zibrita - first contributor and developer of some utilities
|
\n\tPavol Zibrita - first contributor and developer of some utilities
|
||||||
\n\tDusan Kazik - one of the first contributors
|
\n\tDusan Kazik - one of the first contributors
|
||||||
\n\tAndre Van Atten - project supporter, active forum participant, one of the first users.
|
\n\tAndre Van Atten - project supporter, active forum participant, one of the first users.
|
||||||
|
|
|
@ -366,7 +366,7 @@ public class RouteProvider {
|
||||||
return new RouteCalculationResult(res, null, params, null);
|
return new RouteCalculationResult(res, null, params, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected RouteCalculationResult findVectorMapsRoute(RouteCalculationParams params) throws IOException {
|
protected RouteCalculationResult findVectorMapsRoute(final RouteCalculationParams params) throws IOException {
|
||||||
BinaryMapIndexReader[] files = params.ctx.getTodoAPI().getRoutingMapFiles();
|
BinaryMapIndexReader[] files = params.ctx.getTodoAPI().getRoutingMapFiles();
|
||||||
RoutePlannerFrontEnd router = new RoutePlannerFrontEnd(false);
|
RoutePlannerFrontEnd router = new RoutePlannerFrontEnd(false);
|
||||||
OsmandSettings settings = params.ctx.getSettings();
|
OsmandSettings settings = params.ctx.getSettings();
|
||||||
|
@ -446,8 +446,13 @@ public class RouteProvider {
|
||||||
result = router.searchRoute(complexCtx, st, en, inters);
|
result = router.searchRoute(complexCtx, st, en, inters);
|
||||||
// discard ctx and replace with calculated
|
// discard ctx and replace with calculated
|
||||||
ctx = complexCtx;
|
ctx = complexCtx;
|
||||||
} catch(RuntimeException e) {
|
} catch(final RuntimeException e) {
|
||||||
params.ctx.showToastMessage(R.string.complex_route_calculation_failed, e.getMessage());
|
params.ctx.runInUIThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
params.ctx.showToastMessage(R.string.complex_route_calculation_failed, e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
result = router.searchRoute(ctx, st, en, inters);
|
result = router.searchRoute(ctx, st, en, inters);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue