From 07db561e063c46c4700b7eccc66209cbfeb81802 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Wed, 12 Feb 2014 01:01:28 +0100 Subject: [PATCH] Small changes --- .../src/net/osmand/router/RoutingContext.java | 26 +++++++++++++++---- OsmAnd-java/src/net/osmand/util/MapUtils.java | 1 + OsmAnd/res/values-ca/strings.xml | 6 ++--- OsmAnd/res/values-fr/strings.xml | 4 +-- OsmAnd/res/values-it/strings.xml | 4 +-- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RoutingContext.java b/OsmAnd-java/src/net/osmand/router/RoutingContext.java index 42e8462932..187b30f5c0 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutingContext.java +++ b/OsmAnd-java/src/net/osmand/router/RoutingContext.java @@ -316,7 +316,7 @@ public class RoutingContext { return original; } - public void loadSubregionTile(final RoutingSubregionTile ts, boolean loadObjectsInMemory) { + public void loadSubregionTile(final RoutingSubregionTile ts, boolean loadObjectsInMemory, List toLoad) { boolean wasUnloaded = ts.isUnloaded(); int ucount = ts.getUnloadCont(); if (nativeLib == null) { @@ -326,9 +326,13 @@ public class RoutingContext { ts.setLoadedNonNative(); List res = reader.loadRouteIndexData(ts.subregion); // System.out.println(ts.subregion.shiftToData + " " + res); - for(RouteDataObject ro : res){ - if(ro != null && config.router.acceptLine(ro)) { - ts.add(ro); + if(toLoad != null) { + toLoad.addAll(res); + } else { + for(RouteDataObject ro : res){ + if(ro != null && config.router.acceptLine(ro)) { + ts.add(ro); + } } } } catch (IOException e) { @@ -336,6 +340,7 @@ public class RoutingContext { } timeToLoad += (System.nanoTime() - now); + } else { long now = System.nanoTime(); NativeRouteSearchResult ns = nativeLib.loadRouteRegion(ts.subregion, loadObjectsInMemory); @@ -387,6 +392,17 @@ public class RoutingContext { } } } + + public List loadAllSubregionTiles(BinaryMapIndexReader reader, RouteSubregion reg) throws IOException { + List list = new ArrayList(); + SearchRequest request = BinaryMapIndexReader.buildSearchRouteRequest(0, + Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null); + List subregs = reader.searchRouteIndexTree(request, Collections.singletonList(reg)); + for(RouteSubregion s : subregs) { + list.add(new RoutingSubregionTile(s)); + } + return list; + } public List loadTileHeaders(final int zoomToLoadM31, int tileX, int tileY) { SearchRequest request = BinaryMapIndexReader.buildSearchRouteRequest(tileX << zoomToLoadM31, @@ -494,7 +510,7 @@ public class RoutingContext { if (subregions != null) { for (RoutingSubregionTile ts : subregions) { if (!ts.isLoaded()) { - loadSubregionTile(ts, loadOptions == OPTION_IN_MEMORY_LOAD); + loadSubregionTile(ts, loadOptions == OPTION_IN_MEMORY_LOAD, null); } } } diff --git a/OsmAnd-java/src/net/osmand/util/MapUtils.java b/OsmAnd-java/src/net/osmand/util/MapUtils.java index eb6b22144f..b3101438a2 100644 --- a/OsmAnd-java/src/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/net/osmand/util/MapUtils.java @@ -439,6 +439,7 @@ public class MapUtils { } + public static double squareRootDist31(int x1, int y1, int x2, int y2) { // translate into meters double dy = MapUtils.convert31YToMeters(y1, y2); diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 43d5714bb6..c1c480d0f3 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -1256,7 +1256,7 @@ Avió Visiteu https://code.google.com/p/osmand/wiki/FAQ per llegir les preguntes més freqüents. Preguntes més freqüents - Ara suprimireu %1$d canvis de l'OSM. N\'esteu segur? + Ara suprimireu %1$d canvis de l\'OSM. N\'esteu segur? Suprimeix-ho tot Calcula primer la ruta Simulació amb la ruta calculada @@ -1266,9 +1266,9 @@ i o Sense escalat automàtic - Apropa't + Apropa\'t Mig - Allunya't + Allunya\'t Escalat del mapa Mapa mundial Estils del mapa diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 6afc83a61c..cbc4be9218 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1430,8 +1430,8 @@ Balise marine Chercher objet Ne plus chercher objet - Préciser la vitesse d'élocution du TTS - Vitesse d'Élocution + Préciser la vitesse d\'élocution du TTS + Vitesse d\'Élocution Nouveautés de la version 1.7: * Mise-à-jour complète du système de routage (rapide et précis) * Simulation activée dans les tunnels diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index a38170a295..06be08ac23 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -1609,7 +1609,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Barca Aereo Stile della mappa: - Scegli fra le modalità d'uso disponibili nell'applicazione + Scegli fra le modalità d\'uso disponibili nell\'applicazione Modalità applicazione Meda Cerca oggetto @@ -1618,7 +1618,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A * Simulazione attiva nei tunnel Calcolo veloce del percorso fallito (%s), rinvio al calcolo lento. - Disabilita il calcolo del percorso in due fasi per l'uso in automobile + Disabilita il calcolo del percorso in due fasi per l\'uso in automobile Disabilita il calcolo complesso del percorso Imposta la velocità della sintesi vocale (TTS) Velocità di lettura