Skip to content

Commit

Permalink
Merge branch 'osmandapp:master' into hardy_Afa
Browse files Browse the repository at this point in the history
  • Loading branch information
sonora authored Sep 2, 2024
2 parents ec91ceb + f8798f3 commit 864e01b
Show file tree
Hide file tree
Showing 16 changed files with 247 additions and 63 deletions.
20 changes: 16 additions & 4 deletions OsmAnd-java/src/main/java/net/osmand/gpx/GPXUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ private static void writeMetadata(XmlSerializer serializer, GPXFile file, IProgr
private static void writePoints(XmlSerializer serializer, GPXFile file, IProgress progress) throws IOException {
for (WptPt l : file.points) {
serializer.startTag(null, "wpt"); //$NON-NLS-1$
writeWpt(serializer, l, progress);
writeWpt(serializer, l, progress, file);
serializer.endTag(null, "wpt"); //$NON-NLS-1$
}
}
Expand All @@ -1135,7 +1135,7 @@ private static void writeRoutes(XmlSerializer serializer, GPXFile file, IProgres

for (WptPt p : route.points) {
serializer.startTag(null, "rtept"); //$NON-NLS-1$
writeWpt(serializer, p, progress);
writeWpt(serializer, p, progress, file);
serializer.endTag(null, "rtept"); //$NON-NLS-1$
}
writeExtensions(serializer, route, null);
Expand All @@ -1154,7 +1154,7 @@ private static void writeTracks(XmlSerializer serializer, GPXFile file, IProgres
writeNotNullText(serializer, "name", segment.name);
for (WptPt p : segment.points) {
serializer.startTag(null, "trkpt"); //$NON-NLS-1$
writeWpt(serializer, p, progress);
writeWpt(serializer, p, progress, file);
serializer.endTag(null, "trkpt"); //$NON-NLS-1$
}
assignRouteExtensionWriter(segment);
Expand Down Expand Up @@ -1248,7 +1248,7 @@ private static void writeExtensions(XmlSerializer serializer, Map<String, String
}
}

private static void writeWpt(XmlSerializer serializer, WptPt p, IProgress progress) throws IOException {
private static void writeWpt(XmlSerializer serializer, WptPt p, IProgress progress, GPXFile file) throws IOException {
serializer.attribute(null, "lat", LAT_LON_FORMAT.format(p.lat));
serializer.attribute(null, "lon", LAT_LON_FORMAT.format(p.lon));

Expand Down Expand Up @@ -1285,6 +1285,18 @@ private static void writeWpt(XmlSerializer serializer, WptPt p, IProgress progre
extensions.remove(PROFILE_TYPE_EXTENSION);
}
}
if (p.category != null && file.pointsGroups.get(p.category) != null) {
PointsGroup pointsGroup = file.pointsGroups.get(p.category);
if (p.getColor() == pointsGroup.color) {
extensions.remove(COLOR_NAME_EXTENSION);
}
if (p.getIconName().equals(pointsGroup.iconName)) {
extensions.remove(ICON_NAME_EXTENSION);
}
if (p.getBackgroundType().equals(pointsGroup.backgroundType)) {
extensions.remove(BACKGROUND_TYPE_EXTENSION);
}
}
assignExtensionWriter(p, extensions);
writeExtensions(serializer, null, p, null);
if (progress != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ FinalRouteSegment searchRouteInternal(final RoutingContext ctx, RouteSegmentPoin
finalSegment = new MultiFinalRouteSegment((FinalRouteSegment) segment);
}
((MultiFinalRouteSegment) finalSegment).all.add((FinalRouteSegment) segment);
TLongObjectHashMap<RouteSegment> visitedSegments = (forwardSearch ? visitedDirectSegments : visitedOppositeSegments);
if (!visitedSegments.containsKey(calculateRoutePointId(segment))) {
visitedSegments.put(calculateRoutePointId(segment), segment);
}
skipSegment = true;
} else {
finalSegment = (FinalRouteSegment) segment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public RouteSegmentResult getLastRouteRes() {
public GpxPoint(GpxPoint point) {
this.ind = point.ind;
this.loc = point.loc;
this.object = point.object;
this.cumDist = point.cumDist;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static Iterable<Object[]> data() throws IOException {

@Test(timeout = ENTRY_TIMEOUT_MS)
public void testApproximation() throws Exception {
boolean useNative = isNative() && getNativeLibPath() != null;
boolean useNative = isNative() && getNativeLibPath() != null && !entry.ignoreNative;
NativeLibrary nativeLibrary = null;
if (useNative) {
boolean old = NativeLibrary.loadOldLib(getNativeLibPath());
Expand Down Expand Up @@ -188,6 +188,7 @@ public class ApproximationEntry {
private String gpxFile;
private String obfFile;
private boolean ignore;
private boolean ignoreNative;
private List<String> types;
private List<String> profiles;
private List<Integer> minPointApproximation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ object GpxUtilities {
private fun writePoints(serializer: XmlSerializer, file: GpxFile, progress: IProgress?) {
for (l in file.getPointsList()) {
serializer.startTag(null, "wpt")
writeWpt(serializer, l, progress)
writeWpt(serializer, l, progress, file)
serializer.endTag(null, "wpt")
}
}
Expand All @@ -559,7 +559,7 @@ object GpxUtilities {
writeNotNullText(serializer, "desc", route.desc)
for (p in route.points) {
serializer.startTag(null, "rtept")
writeWpt(serializer, p, progress)
writeWpt(serializer, p, progress, file)
serializer.endTag(null, "rtept")
}
writeExtensions(serializer, route, null)
Expand All @@ -578,7 +578,7 @@ object GpxUtilities {
writeNotNullText(serializer, "name", segment.name)
for (p in segment.points) {
serializer.startTag(null, "trkpt")
writeWpt(serializer, p, progress)
writeWpt(serializer, p, progress, file)
serializer.endTag(null, "trkpt")
}
assignRouteExtensionWriter(segment)
Expand Down Expand Up @@ -679,7 +679,7 @@ object GpxUtilities {
}
}

private fun writeWpt(serializer: XmlSerializer, p: WptPt, progress: IProgress?) {
private fun writeWpt(serializer: XmlSerializer, p: WptPt, progress: IProgress?, file: GpxFile) {
serializer.attribute(null, "lat", formatLatLon(p.lat))
serializer.attribute(null, "lon", formatLatLon(p.lon))
if (!p.ele.isNaN()) {
Expand Down Expand Up @@ -712,6 +712,18 @@ object GpxUtilities {
extensions.remove(PROFILE_TYPE_EXTENSION)
}
}
if (p.category != null && file.pointsGroups[p.category] != null) {
val pointsGroup = file.pointsGroups[p.category]!!
if (p.getColor() == pointsGroup.color) {
extensions.remove(COLOR_NAME_EXTENSION)
}
if (p.getIconName() == pointsGroup.iconName) {
extensions.remove(ICON_NAME_EXTENSION)
}
if (p.getBackgroundType() == pointsGroup.backgroundType) {
extensions.remove(BACKGROUND_TYPE_EXTENSION)
}
}
assignExtensionWriter(p, extensions)
writeExtensions(serializer, null, p, null)
progress?.progress(1)
Expand Down
2 changes: 1 addition & 1 deletion OsmAnd/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,7 @@
<string name="select_distance_route_will_recalc">Επιλέξτε την απόσταση μετά την οποία η διαδρομή θα επανυπολογιστεί.</string>
<string name="recalculate_route_distance_promo">Η διαδρομή θα επανυπολογιστεί εάν η απόσταση από τη διαδρομή στην τρέχουσα θέση είναι μεγαλύτερη από την επιλεγμένη τιμή.</string>
<string name="n_items_of_z">%1$s από %2$s</string>
<string name="download_slope_maps">Πλαγιές</string>
<string name="download_slope_maps">Κλίση</string>
<string name="quick_action_terrain_descr">Ένα πλήκτρο εμφάνισης ή απόκρυψης της στρώσης εδάφους στον χάρτη.</string>
<string name="delete_description">Διαγραφή περιγραφής</string>
<string name="add_description">Προσθήκη περιγραφής</string>
Expand Down
102 changes: 99 additions & 3 deletions OsmAnd/res/values-it/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2686,7 +2686,7 @@
<string name="poi_motorcar_forestry">Accesso all\'automobile: silvicoltura</string>
<string name="poi_hgv_no">Accesso ai mezzi pesanti: no</string>
<string name="poi_hgv_agricultural">Accesso ai mezzi pesanti: agricolo</string>
<string name="poi_motorcycle_no">Accesso a motocicli: no</string>
<string name="poi_motorcycle_no">Accesso ai motocicli: no</string>
<string name="poi_horse_private">Accesso a cavallo: privato</string>
<string name="poi_horse_destination">Accesso a cavallo: destinazione</string>
<string name="poi_horse_permissive">Accesso a cavallo: permissivo</string>
Expand Down Expand Up @@ -4091,8 +4091,7 @@
<string name="poi_office_psychologist">Ufficio dello psicologo</string>
<string name="poi_office_nursing_service">Servizio infermieristico</string>
<string name="poi_music_venue">Locale con musica</string>
<string name="poi_medical_system_kampo_yes">"
\n"</string>
<string name="poi_medical_system_kampo_yes">Kampo</string>
<string name="poi_provided_for_infant_yes">Adatto per neonati: sì</string>
<string name="poi_shuffleboard">Shuffleboard</string>
<string name="poi_nuclear_explosion_salvo_second_or_later_detonation">Esplosione a salve: seconda o ultima detonazione di un test di esplosione a salve</string>
Expand All @@ -4118,4 +4117,101 @@
<string name="poi_street_cabinet_water_management">Tipo di cabina: gestione dell\'acqua</string>
<string name="poi_street_cabinet_waste">Tipo di cabina: rifiuto</string>
<string name="poi_bandy">Bandy</string>
<string name="poi_foot_permissive">Accesso pedonale: permesso</string>
<string name="poi_craft_cabinet_maker">Ebanista</string>
<string name="poi_cash_withdrawal_limit">Limite di prelievo di contanti</string>
<string name="poi_cash_withdrawal_type_self_checkout">Prelievo di contanti: cassa automatica</string>
<string name="poi_volcano_status_dormant">Dormiente</string>
<string name="poi_volcano_type_caldera">Caldera</string>
<string name="poi_seamark_water_level_below_mwl">Livello dell\'acqua: sotto il livello medio</string>
<string name="poi_health_food">Cibo sano</string>
<string name="poi_drinking_water_refill_yes">Sì;Ricarica acqua potabile;Ricarica</string>
<string name="poi_dive_centre">Centro immersioni subacquee</string>
<string name="poi_volcano_type_mud">Fango</string>
<string name="poi_volcano_type_lava_dome">Cupola di lava</string>
<string name="poi_cash_withdrawal_yes">Prelievo di contanti: sì</string>
<string name="poi_craft_bakery">Panificio</string>
<string name="poi_charcoal_pile">Carbone</string>
<string name="poi_pottery">Ceramica</string>
<string name="poi_shop_boat">Negozio di barche</string>
<string name="poi_climbing_rock_porphyry">Roccia da arrampicata: porfido</string>
<string name="poi_medical_system_sidda_yes">Sidda</string>
<string name="poi_cash_withdrawal">Prelievo di contanti</string>
<string name="poi_climbing_rock_granite">Roccia da arrampicata: granito</string>
<string name="poi_climbing_rock_limestone">Roccia da arrampicata: calcare</string>
<string name="poi_climbing_bolted_no">Ancoraggi fissi: no</string>
<string name="poi_climbing_grade_saxon_min">Percorso più facile (grado sassone)</string>
<string name="poi_climbing_grade_french_min">Percorso più facile (grado francese)</string>
<string name="poi_amusement_arcade">Sala giochi</string>
<string name="poi_outpost">Punto di consegna del negozio</string>
<string name="poi_glacier_type_remnant">Residuo</string>
<string name="poi_checkpoint_type_stamp">Punto di timbratura</string>
<string name="poi_substation_field_gathering">Raccolta sul campo</string>
<string name="poi_childcare">Assistenza all\'infanzia</string>
<string name="poi_denotation_landmark">Punto di interesse</string>
<string name="poi_rescue_box">Cassetta di pronto soccorso</string>
<string name="poi_motor_vehicle_destination">Accesso ai veicoli a motore: destinazione</string>
<string name="poi_motor_vehicle_permissive">Accesso ai veicoli a motore: permesso</string>
<string name="poi_motor_vehicle_forestry">Accesso ai veicoli a motore: forestale</string>
<string name="poi_moped_no">Accesso ai ciclomotori: no</string>
<string name="poi_pet_grooming">Toelettatura per animali domestici</string>
<string name="poi_monastery_type_convent">Tipo di monastero: convento</string>
<string name="poi_vehicle_permissive">Accesso ai veicoli: permesso</string>
<string name="poi_checkpoint_type_notebook">Quaderno</string>
<string name="poi_piste_ref">Numero di riferimento della pista</string>
<string name="poi_medical_system_unani_yes">Unani</string>
<string name="poi_climbing_multipitch_yes">Vie a più tiri: sì</string>
<string name="poi_climbing_multipitch_no">Vie a più tiri: no</string>
<string name="poi_climbing_rock_gritstone">Roccia da arrampicata: arenaria</string>
<string name="poi_climbing_rock_basalt">Roccia da arrampicata: basalto</string>
<string name="poi_climbing_rock_conglomerate">Roccia da arrampicata: conglomerato</string>
<string name="poi_shop_fireplace">Negozio di caminetti</string>
<string name="poi_coach_yes">Accesso ai pullman: sì</string>
<string name="poi_coach_no">Accesso ai pullman: no</string>
<string name="poi_seamark_water_level_dry">Livello dell\'acqua: asciutto</string>
<string name="poi_water_source_groundwater">Acqua di falda</string>
<string name="poi_climbing_bolted_yes">Ancoraggi fissi: sì</string>
<string name="poi_whitewater_rapid_name">Nome delle rapide del fiume</string>
<string name="poi_service_vehicle_muffler_yes">Silenziatore</string>
<string name="poi_appliance">Negozio di elettrodomestici</string>
<string name="poi_bath_type_foot_bath">Pediluvio</string>
<string name="poi_parking_space">Posto auto</string>
<string name="poi_volcano_number_of_eruptions">Numero di eruzioni</string>
<string name="poi_mountain_rescue">Soccorso alpino</string>
<string name="poi_seamark_water_level_covers">Livello dell\'acqua: coperto</string>
<string name="poi_seamark_water_level_awash">Livello dell\'acqua: allagato</string>
<string name="poi_seamark_water_level_floods">Livello dell\'acqua: inondazioni</string>
<string name="poi_seamark_water_level_above_mwl">Livello dell\'acqua: sopra il livello medio</string>
<string name="poi_drinking_water_refill_no">Ricarica acqua potabile: no</string>
<string name="poi_fire_hydrant_pressure_suction">Aspirazione</string>
<string name="poi_climbing_rock_quartzite">Roccia da arrampicata: quarzite</string>
<string name="poi_monastery_type_monastics">Tipo di monastero: monaci</string>
<string name="poi_cuisine_souvlaki">Souvlaki</string>
<string name="poi_climbing_grade_uiaa_min">Percorso più facile (grado UIAA)</string>
<string name="poi_water_utility">Ufficio servizi idrici</string>
<string name="poi_goods_no">Accesso ai veicoli leggeri: no</string>
<string name="poi_bicycle_permissive">Accesso alle biciclette: permesso</string>
<string name="poi_cash_withdrawal_type_checkout">Prelievo di contanti: cassa</string>
<string name="poi_fire_hydrant_type_pipe">Tubo</string>
<string name="poi_toll_gantry">Pedaggio</string>
<string name="poi_meadow_pasture">Tipo: pascolo</string>
<string name="poi_flooring">Negozio di pavimenti</string>
<string name="poi_glacier_type_tidewater">Acqua di marea</string>
<string name="poi_monastery_type_canonry">Tipologia di monastero: canonico</string>
<string name="poi_monastery_type_hermitage">Tipologia di monastero: eremo</string>
<string name="poi_volcano_type_shield">Scudo</string>
<string name="poi_volcano_type_scoria">Scoria</string>
<string name="poi_internet_access_fee_customers">Accesso a Internet: clienti</string>
<string name="poi_seamark_water_level_submerged">Livello dell\'acqua: sommerso</string>
<string name="poi_seamark_water_level_part_submerged">Livello dell\'acqua: parzialmente sommerso</string>
<string name="poi_climbing_boulder_no">Arrampicata su massi: no</string>
<string name="poi_cuisine_yakiniku">Yakiniku</string>
<string name="poi_climbing_rock_sandstone">Roccia da arrampicata: arenaria</string>
<string name="poi_glacier_type_icecap">Calotta glaciale</string>
<string name="poi_substation_valve_group">Gruppo valvola</string>
<string name="poi_hazard_additional_minefield">Pericolo: campo minato</string>
<string name="poi_hookah_lounge">Sala narghilè</string>
<string name="poi_climbing_boulder_yes">Arrampicata su massi: si</string>
<string name="poi_motorcycle_private">Accesso motociclette: privato</string>
<string name="poi_caravan_no">Accesso alle roulotte: no</string>
</resources>
2 changes: 1 addition & 1 deletion OsmAnd/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5868,7 +5868,7 @@
<string name="quick_action_previous_screen_desc">Un pulsante per tornare alla schermata precedente.</string>
<string name="quick_action_previous_screen_title">Schermata precedente</string>
<string name="quick_action_drawer_desc">Un pulsante per mostrare o nascondere il menu laterale.</string>
<string name="background_opacity">Opacità sfondo</string>
<string name="background_opacity">Opacità dello sfondo</string>
<string name="corner_radius">Raggio dell\'angolo</string>
<string name="quick_action_verb_navigate">Naviga</string>
</resources>
Loading

0 comments on commit 864e01b

Please sign in to comment.