Small changes

This commit is contained in:
vshcherb 2014-02-12 01:01:28 +01:00
parent bd819555dd
commit 07db561e06
5 changed files with 29 additions and 12 deletions

View file

@ -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<RouteDataObject> toLoad) {
boolean wasUnloaded = ts.isUnloaded();
int ucount = ts.getUnloadCont();
if (nativeLib == null) {
@ -326,9 +326,13 @@ public class RoutingContext {
ts.setLoadedNonNative();
List<RouteDataObject> 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<RoutingSubregionTile> loadAllSubregionTiles(BinaryMapIndexReader reader, RouteSubregion reg) throws IOException {
List<RoutingSubregionTile> list = new ArrayList<RoutingContext.RoutingSubregionTile>();
SearchRequest<RouteDataObject> request = BinaryMapIndexReader.buildSearchRouteRequest(0,
Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null);
List<RouteSubregion> subregs = reader.searchRouteIndexTree(request, Collections.singletonList(reg));
for(RouteSubregion s : subregs) {
list.add(new RoutingSubregionTile(s));
}
return list;
}
public List<RoutingSubregionTile> loadTileHeaders(final int zoomToLoadM31, int tileX, int tileY) {
SearchRequest<RouteDataObject> 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);
}
}
}

View file

@ -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);

View file

@ -1256,7 +1256,7 @@
<string name="app_mode_aircraft">Avió</string>
<string name="tip_faq_t">Visiteu https://code.google.com/p/osmand/wiki/FAQ per llegir les preguntes més freqüents.</string>
<string name="tip_faq">Preguntes més freqüents</string>
<string name="local_osm_changes_delete_all_confirm">Ara suprimireu %1$d canvis de l'OSM. N\'esteu segur?</string>
<string name="local_osm_changes_delete_all_confirm">Ara suprimireu %1$d canvis de l\'OSM. N\'esteu segur?</string>
<string name="local_osm_changes_delete_all">Suprimeix-ho tot</string>
<string name="animate_routing_route_not_calculated">Calcula primer la ruta</string>
<string name="animate_routing_route">Simulació amb la ruta calculada </string>
@ -1266,9 +1266,9 @@
<string name="default_and">i</string>
<string name="default_or">o</string>
<string name="auto_zoom_none">Sense escalat automàtic</string>
<string name="auto_zoom_close">Apropa't</string>
<string name="auto_zoom_close">Apropa\'t</string>
<string name="auto_zoom_far">Mig</string>
<string name="auto_zoom_farthest">Allunya't</string>
<string name="auto_zoom_farthest">Allunya\'t</string>
<string name="map_magnifier">Escalat del mapa</string>
<string name="base_world_map">Mapa mundial</string>
<string name="tip_map_styles">Estils del mapa</string>

View file

@ -1430,8 +1430,8 @@
<string name="amenity_type_seamark">Balise marine</string>
<string name="osmodroid_seek">Chercher objet</string>
<string name="osmodroid_unseek">Ne plus chercher objet</string>
<string name="speech_rate_descr">Préciser la vitesse d'élocution du TTS</string>
<string name="speech_rate">Vitesse d'Élocution</string>
<string name="speech_rate_descr">Préciser la vitesse d\'élocution du TTS</string>
<string name="speech_rate">Vitesse d\'Élocution</string>
<string name="tip_recent_changes_1_7_t">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

View file

@ -1609,7 +1609,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="app_mode_boat">Barca</string>
<string name="app_mode_aircraft">Aereo</string>
<string name="map_widget_map_rendering">Stile della mappa:</string>
<string name="app_modes_choose_descr">Scegli fra le modalità d'uso disponibili nell'applicazione</string>
<string name="app_modes_choose_descr">Scegli fra le modalità d\'uso disponibili nell\'applicazione</string>
<string name="app_modes_choose">Modalità applicazione</string>
<string name="amenity_type_seamark">Meda</string>
<string name="osmodroid_seek">Cerca oggetto</string>
@ -1618,7 +1618,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
* Simulazione attiva nei tunnel
</string>
<string name="complex_route_calculation_failed">Calcolo veloce del percorso fallito (%s), rinvio al calcolo lento.</string>
<string name="disable_complex_routing_descr">Disabilita il calcolo del percorso in due fasi per l'uso in automobile</string>
<string name="disable_complex_routing_descr">Disabilita il calcolo del percorso in due fasi per l\'uso in automobile</string>
<string name="disable_complex_routing">Disabilita il calcolo complesso del percorso</string>
<string name="speech_rate_descr">Imposta la velocità della sintesi vocale (TTS)</string>
<string name="speech_rate">Velocità di lettura</string>