Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] Improve search/display/click for variety of Travel Routes (wikivoyage, gpx, activities, etc) #21346

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion OsmAnd-java/src/main/java/net/osmand/NativeLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static net.osmand.IndexConstants.GPX_FILE_EXT;
import static net.osmand.IndexConstants.GPX_GZ_FILE_EXT;
import static net.osmand.data.Amenity.ROUTE_ID;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -696,7 +697,7 @@ public List<String> getOriginalNames() {

public String getRouteID() {
for (Map.Entry<String, String> entry : getTags().entrySet()) {
if ("route_id".equals(entry.getKey())) {
if (ROUTE_ID.equals(entry.getKey())) {
return entry.getValue();
}
}
Expand Down
22 changes: 22 additions & 0 deletions OsmAnd-java/src/main/java/net/osmand/data/Amenity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import static net.osmand.gpx.GPXUtilities.AMENITY_PREFIX;
import static net.osmand.gpx.GPXUtilities.OSM_PREFIX;
import static net.osmand.osm.MapPoiTypes.ROUTES_PREFIX;
import static net.osmand.osm.MapPoiTypes.ROUTE_ARTICLE;
import static net.osmand.osm.MapPoiTypes.ROUTE_ARTICLE_POINT;
import static net.osmand.osm.MapPoiTypes.ROUTE_TRACK;

import net.osmand.Location;
import net.osmand.binary.BinaryMapIndexReader.TagValuePair;
Expand Down Expand Up @@ -447,6 +451,20 @@ public String getRouteId() {
return getAdditionalInfo(ROUTE_ID);
}

public String getGpxFileName(String lang) {
final String gpxFileName = lang != null ? getName(lang) : getEnName(true);
if (!Algorithms.isEmpty(gpxFileName)) {
return gpxFileName;
}
if (!Algorithms.isEmpty(getRouteId())) {
return getRouteId();
}
if (!Algorithms.isEmpty(getSubType())) {
return getType().getKeyName() + " " + getSubType();
}
return getType().getKeyName();
}

public String getStrictTagContent(String tag, String lang) {
if (lang != null) {
String translateName = getAdditionalInfo(tag + ":" + lang);
Expand Down Expand Up @@ -549,6 +567,10 @@ public boolean isPrivateAccess() {
return PRIVATE_VALUE.equals(getTagContent(ACCESS_PRIVATE_TAG));
}

public boolean isRouteTrack() {
return subType != null && (subType.equals(ROUTE_TRACK) || subType.startsWith(ROUTES_PREFIX));
}

public JSONObject toJSON() {
JSONObject json = super.toJSON();
json.put("subType", subType);
Expand Down
3 changes: 2 additions & 1 deletion OsmAnd-java/src/main/java/net/osmand/osm/MapPoiTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public class MapPoiTypes {
public static final String ROUTE_ARTICLE = "route_article";
public static final String ROUTE_ARTICLE_POINT = "route_article_point";
public static final String CATEGORY = "category";
public static final String ROUTE_TRACK = "route_track";
public static final String ROUTE_TRACK = "route_track"; // routes:route_track (no activity)
public static final String ROUTES_PREFIX = "routes_"; // routes:routes_xxx (activity type)
public static final String ROUTE_TRACK_POINT = "route_track_point";

private PoiTranslator poiTranslator = null;
Expand Down
9 changes: 5 additions & 4 deletions OsmAnd-java/src/main/java/net/osmand/search/SearchUICore.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package net.osmand.search;

import static net.osmand.data.Amenity.ROUTE_ID;
import static net.osmand.osm.MapPoiTypes.ROUTES_PREFIX;
import static net.osmand.osm.MapPoiTypes.ROUTE_TRACK;

import net.osmand.CallbackWithObject;
import net.osmand.Collator;
import net.osmand.PlatformUtil;
Expand Down Expand Up @@ -289,11 +293,8 @@ public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|| (subType1.startsWith("route_hiking_") && subType1.endsWith("n_poi"))) {
similarityRadius = 50000;
}
final String ROUTE_ID = "route_id";
final String ROUTE_TRACK = "route_track";
final String ROUTE_TYPE_PREFIX = "activities_";
if (Algorithms.stringsEqual(a1.getAdditionalInfo(ROUTE_ID), a2.getAdditionalInfo(ROUTE_ID))
&& (subType1.startsWith(ROUTE_TYPE_PREFIX) || subType1.equals(ROUTE_TRACK))) {
&& (subType1.startsWith(ROUTES_PREFIX) || subType1.equals(ROUTE_TRACK))) {
similarityRadius = 50000;
}
}
Expand Down
22 changes: 11 additions & 11 deletions OsmAnd/res/values-b+sr+Latn/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4884,17 +4884,17 @@
<string name="poi_route_article_point">Tačke na putovanjima</string>
<string name="poi_route_track">Druge rute</string>
<string name="poi_route_track_point">Tačke drugih ruta</string>
<string name="poi_activities_bicycle">Bicikl</string>
<string name="poi_activities_trekking">Pešačenje</string>
<string name="poi_activities_running">Trčanje</string>
<string name="poi_activities_pedestrian">Hodanje</string>
<string name="poi_activities_kayak">Sportovi na vodi</string>
<string name="poi_activities_skiing">Zimski sportovi</string>
<string name="poi_activities_inline_skates">Koturaljke</string>
<string name="poi_activities_horse">Jahanje konja</string>
<string name="poi_activities_snowmobile">Motorne sanke</string>
<string name="poi_activities_fitness">Staze za trčanje</string>
<string name="poi_activities_mountain_bike">Brdski biciklizam</string>
<string name="poi_routes_bicycle">Bicikl</string>
<string name="poi_routes_trekking">Pešačenje</string>
<string name="poi_routes_running">Trčanje</string>
<string name="poi_routes_pedestrian">Hodanje</string>
<string name="poi_routes_kayak">Sportovi na vodi</string>
<string name="poi_routes_skiing">Zimski sportovi</string>
<string name="poi_routes_inline_skates">Koturaljke</string>
<string name="poi_routes_horse">Jahanje konja</string>
<string name="poi_routes_snowmobile">Motorne sanke</string>
<string name="poi_routes_fitness">Staze za trčanje</string>
<string name="poi_routes_mountain_bike">Brdski biciklizam</string>
<string name="poi_name_etymology">Etimologija imena</string>
<string name="poi_name_left">Naziv leve strane</string>
<string name="poi_name_right">Naziv desne strane</string>
Expand Down
22 changes: 11 additions & 11 deletions OsmAnd/res/values-cs/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4884,15 +4884,15 @@
<string name="poi_route_article_point">Body na cestách</string>
<string name="poi_route_track">Další trasy</string>
<string name="poi_route_track_point">Další body trasy</string>
<string name="poi_activities_bicycle">Kolo</string>
<string name="poi_activities_trekking">Pěší turistika</string>
<string name="poi_activities_running">Běh</string>
<string name="poi_activities_pedestrian">Chůze</string>
<string name="poi_activities_kayak">Vodní sporty</string>
<string name="poi_activities_horse">Jízda na koni</string>
<string name="poi_activities_skiing">Zimní sporty</string>
<string name="poi_activities_snowmobile">Sněžný skútr</string>
<string name="poi_activities_fitness">Fitness stezky</string>
<string name="poi_activities_inline_skates">Inline brusle</string>
<string name="poi_activities_mountain_bike">Horská cyklistika</string>
<string name="poi_routes_bicycle">Kolo</string>
<string name="poi_routes_trekking">Pěší turistika</string>
<string name="poi_routes_running">Běh</string>
<string name="poi_routes_pedestrian">Chůze</string>
<string name="poi_routes_kayak">Vodní sporty</string>
<string name="poi_routes_horse">Jízda na koni</string>
<string name="poi_routes_skiing">Zimní sporty</string>
<string name="poi_routes_snowmobile">Sněžný skútr</string>
<string name="poi_routes_fitness">Fitness stezky</string>
<string name="poi_routes_inline_skates">Inline brusle</string>
<string name="poi_routes_mountain_bike">Horská cyklistika</string>
</resources>
22 changes: 11 additions & 11 deletions OsmAnd/res/values-de/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4881,20 +4881,20 @@
<string name="poi_osmand_foot_prohibited_tunnel">Tunnel für Fußgänger verboten</string>
<string name="poi_osmand_bicycle_prohibited_tunnel">Tunnel für Radfahrer verboten</string>
<string name="poi_route_article_point">Reisepunkte</string>
<string name="poi_activities_kayak">Wassersport</string>
<string name="poi_activities_pedestrian">Gehen</string>
<string name="poi_activities_horse">Reiten</string>
<string name="poi_routes_kayak">Wassersport</string>
<string name="poi_routes_pedestrian">Gehen</string>
<string name="poi_routes_horse">Reiten</string>
<string name="poi_route_article">Reiseartikel</string>
<string name="poi_route_track">Andere Routen</string>
<string name="poi_route_track_point">Weitere Routenpunkte</string>
<string name="poi_activities_bicycle">Fahrrad</string>
<string name="poi_activities_trekking">Wandern</string>
<string name="poi_activities_running">Laufen</string>
<string name="poi_activities_skiing">Wintersport</string>
<string name="poi_activities_snowmobile">Schneemobil</string>
<string name="poi_activities_fitness">Fitness-Parcour</string>
<string name="poi_activities_inline_skates">Inline-Skate</string>
<string name="poi_activities_mountain_bike">Mountainbiken</string>
<string name="poi_routes_bicycle">Fahrrad</string>
<string name="poi_routes_trekking">Wandern</string>
<string name="poi_routes_running">Laufen</string>
<string name="poi_routes_skiing">Wintersport</string>
<string name="poi_routes_snowmobile">Schneemobil</string>
<string name="poi_routes_fitness">Fitness-Parcour</string>
<string name="poi_routes_inline_skates">Inline-Skate</string>
<string name="poi_routes_mountain_bike">Mountainbiken</string>
<string name="poi_name_etymology">Namensetymologie</string>
<string name="poi_name_left">Name der linken Seite</string>
<string name="poi_name_right">Name der rechten Seite</string>
Expand Down
22 changes: 11 additions & 11 deletions OsmAnd/res/values-eo/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4880,17 +4880,17 @@
<string name="poi_route_article_point">Vojaĝaj punktoj</string>
<string name="poi_route_track">Aliaj kursoj</string>
<string name="poi_route_track_point">Aliaj kursoj: punktoj</string>
<string name="poi_activities_bicycle">Biciklado</string>
<string name="poi_activities_trekking">Marŝado</string>
<string name="poi_activities_running">Kurado</string>
<string name="poi_activities_pedestrian">Irado</string>
<string name="poi_activities_kayak">Akvaj sportoj</string>
<string name="poi_activities_horse">Ĉevalrajdado</string>
<string name="poi_activities_skiing">Vintraj sportoj</string>
<string name="poi_activities_snowmobile">Motorsledado</string>
<string name="poi_activities_fitness">Vojetoj de sportiloj</string>
<string name="poi_activities_inline_skates">Rulglitado</string>
<string name="poi_activities_mountain_bike">Montbiciklado</string>
<string name="poi_routes_bicycle">Biciklado</string>
<string name="poi_routes_trekking">Marŝado</string>
<string name="poi_routes_running">Kurado</string>
<string name="poi_routes_pedestrian">Irado</string>
<string name="poi_routes_kayak">Akvaj sportoj</string>
<string name="poi_routes_horse">Ĉevalrajdado</string>
<string name="poi_routes_skiing">Vintraj sportoj</string>
<string name="poi_routes_snowmobile">Motorsledado</string>
<string name="poi_routes_fitness">Vojetoj de sportiloj</string>
<string name="poi_routes_inline_skates">Rulglitado</string>
<string name="poi_routes_mountain_bike">Montbiciklado</string>
<string name="poi_payment_parco_yes">Parco</string>
<string name="poi_payment_parco_no">Parco malakceptata</string>
<string name="poi_payment_parkster_yes">Parkster</string>
Expand Down
22 changes: 11 additions & 11 deletions OsmAnd/res/values-es-rAR/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4884,15 +4884,15 @@
<string name="poi_route_article_point">Puntos turísticos</string>
<string name="poi_route_track">Otras rutas</string>
<string name="poi_route_track_point">Otros puntos de ruta</string>
<string name="poi_activities_bicycle">Bicicleta</string>
<string name="poi_activities_trekking">Senderismo</string>
<string name="poi_activities_running">Correr</string>
<string name="poi_activities_pedestrian">Peatón</string>
<string name="poi_activities_kayak">Deportes acuáticos</string>
<string name="poi_activities_horse">Equitación</string>
<string name="poi_activities_skiing">Deportes de invierno</string>
<string name="poi_activities_snowmobile">Motonieve</string>
<string name="poi_activities_fitness">Circuitos aeróbicos</string>
<string name="poi_activities_inline_skates">Patines en línea</string>
<string name="poi_activities_mountain_bike">Ciclismo de montaña</string>
<string name="poi_routes_bicycle">Bicicleta</string>
<string name="poi_routes_trekking">Senderismo</string>
<string name="poi_routes_running">Correr</string>
<string name="poi_routes_pedestrian">Peatón</string>
<string name="poi_routes_kayak">Deportes acuáticos</string>
<string name="poi_routes_horse">Equitación</string>
<string name="poi_routes_skiing">Deportes de invierno</string>
<string name="poi_routes_snowmobile">Motonieve</string>
<string name="poi_routes_fitness">Circuitos aeróbicos</string>
<string name="poi_routes_inline_skates">Patines en línea</string>
<string name="poi_routes_mountain_bike">Ciclismo de montaña</string>
</resources>
22 changes: 11 additions & 11 deletions OsmAnd/res/values-es-rUS/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4979,15 +4979,15 @@
<string name="poi_route_article_point">Puntos turísticos</string>
<string name="poi_route_track">Otras rutas</string>
<string name="poi_route_track_point">Otros puntos de ruta</string>
<string name="poi_activities_bicycle">Bicicleta</string>
<string name="poi_activities_trekking">Senderismo</string>
<string name="poi_activities_running">Correr</string>
<string name="poi_activities_pedestrian">Peatón</string>
<string name="poi_activities_kayak">Deportes acuáticos</string>
<string name="poi_activities_horse">Equitación</string>
<string name="poi_activities_skiing">Deportes de invierno</string>
<string name="poi_activities_snowmobile">Motonieve</string>
<string name="poi_activities_fitness">Circuitos aeróbicos</string>
<string name="poi_activities_inline_skates">Patines en línea</string>
<string name="poi_activities_mountain_bike">Ciclismo de montaña</string>
<string name="poi_routes_bicycle">Bicicleta</string>
<string name="poi_routes_trekking">Senderismo</string>
<string name="poi_routes_running">Correr</string>
<string name="poi_routes_pedestrian">Peatón</string>
<string name="poi_routes_kayak">Deportes acuáticos</string>
<string name="poi_routes_horse">Equitación</string>
<string name="poi_routes_skiing">Deportes de invierno</string>
<string name="poi_routes_snowmobile">Motonieve</string>
<string name="poi_routes_fitness">Circuitos aeróbicos</string>
<string name="poi_routes_inline_skates">Patines en línea</string>
<string name="poi_routes_mountain_bike">Ciclismo de montaña</string>
</resources>
22 changes: 11 additions & 11 deletions OsmAnd/res/values-es/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4880,21 +4880,21 @@
<string name="poi_payment_parco_yes">Parco</string>
<string name="poi_osmand_foot_prohibited_tunnel">Túnel prohibido para peatones</string>
<string name="poi_osmand_bicycle_prohibited_tunnel">Túnel prohibido para ciclistas</string>
<string name="poi_activities_bicycle">Bicicleta</string>
<string name="poi_activities_trekking">Senderismo</string>
<string name="poi_activities_running">Correr</string>
<string name="poi_activities_pedestrian">Peatonal</string>
<string name="poi_activities_kayak">Deportes acuáticos</string>
<string name="poi_activities_horse">Equitación</string>
<string name="poi_activities_snowmobile">Motonieve</string>
<string name="poi_activities_fitness">Circuitos aeróbicos</string>
<string name="poi_activities_inline_skates">Patines en línea</string>
<string name="poi_activities_mountain_bike">Bicicleta de montaña</string>
<string name="poi_routes_bicycle">Bicicleta</string>
<string name="poi_routes_trekking">Senderismo</string>
<string name="poi_routes_running">Correr</string>
<string name="poi_routes_pedestrian">Peatonal</string>
<string name="poi_routes_kayak">Deportes acuáticos</string>
<string name="poi_routes_horse">Equitación</string>
<string name="poi_routes_snowmobile">Motonieve</string>
<string name="poi_routes_fitness">Circuitos aeróbicos</string>
<string name="poi_routes_inline_skates">Patines en línea</string>
<string name="poi_routes_mountain_bike">Bicicleta de montaña</string>
<string name="poi_route_article">Artículos de viajes</string>
<string name="poi_route_article_point">Puntos del viaje</string>
<string name="poi_route_track">Otras rutas</string>
<string name="poi_route_track_point">Otros puntos de la ruta</string>
<string name="poi_activities_skiing">Deportes de invierno</string>
<string name="poi_routes_skiing">Deportes de invierno</string>
<string name="poi_name_left">Nombre en el lado izquierdo</string>
<string name="poi_name_etymology">Etimología del nombre</string>
<string name="poi_name_right">Nombre en el lado derecho</string>
Expand Down
22 changes: 11 additions & 11 deletions OsmAnd/res/values-et/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4872,19 +4872,19 @@
<string name="poi_cycle_network">Rattateede võrgustik</string>
<string name="poi_padus_category_designation">Kategooria: määramine</string>
<string name="poi_padus_category_easement">Kategooria: servituut</string>
<string name="poi_activities_kayak">Veespordialad</string>
<string name="poi_activities_pedestrian">Kõndimine</string>
<string name="poi_activities_running">Jooksmine</string>
<string name="poi_activities_trekking">Matkamine</string>
<string name="poi_activities_bicycle">Rattasõit</string>
<string name="poi_routes_kayak">Veespordialad</string>
<string name="poi_routes_pedestrian">Kõndimine</string>
<string name="poi_routes_running">Jooksmine</string>
<string name="poi_routes_trekking">Matkamine</string>
<string name="poi_routes_bicycle">Rattasõit</string>
<string name="poi_route_track_point">Muud teekonnapunktid</string>
<string name="poi_route_track">Muud teekonnad</string>
<string name="poi_activities_skiing">Talispordialad</string>
<string name="poi_activities_horse">Ratsutamine</string>
<string name="poi_activities_inline_skates">Rulluisutamine üherealiste uiskudega</string>
<string name="poi_activities_fitness">Terviserajad</string>
<string name="poi_activities_snowmobile">Mootorsaanisõit</string>
<string name="poi_activities_mountain_bike">Mägirattasõit</string>
<string name="poi_routes_skiing">Talispordialad</string>
<string name="poi_routes_horse">Ratsutamine</string>
<string name="poi_routes_inline_skates">Rulluisutamine üherealiste uiskudega</string>
<string name="poi_routes_fitness">Terviserajad</string>
<string name="poi_routes_snowmobile">Mootorsaanisõit</string>
<string name="poi_routes_mountain_bike">Mägirattasõit</string>
<string name="poi_payment_parkster_no">Parksteri teenus pole kasutatav</string>
<string name="poi_payment_parkster_yes">Parkster</string>
<string name="poi_payment_parco_no">Parco teenus pole kasutatav</string>
Expand Down
18 changes: 9 additions & 9 deletions OsmAnd/res/values-hu/phrases.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4880,14 +4880,14 @@
<string name="poi_payment_parco_no">Parcót nem fogad el</string>
<string name="poi_payment_parkster_yes">Parkster</string>
<string name="poi_payment_parkster_no">Parkstert nem fogad el</string>
<string name="poi_activities_kayak">Vízi sportok</string>
<string name="poi_activities_horse">Lovaglás</string>
<string name="poi_activities_skiing">Téli sportok</string>
<string name="poi_activities_snowmobile">Hójáró</string>
<string name="poi_activities_mountain_bike">Hegyi kerékpározás</string>
<string name="poi_routes_kayak">Vízi sportok</string>
<string name="poi_routes_horse">Lovaglás</string>
<string name="poi_routes_skiing">Téli sportok</string>
<string name="poi_routes_snowmobile">Hójáró</string>
<string name="poi_routes_mountain_bike">Hegyi kerékpározás</string>
<string name="poi_route_track">Egyéb útvonalak</string>
<string name="poi_activities_bicycle">Kerékpározás</string>
<string name="poi_activities_running">Futás</string>
<string name="poi_activities_pedestrian">Gyaloglás</string>
<string name="poi_activities_trekking">Túrázás</string>
<string name="poi_routes_bicycle">Kerékpározás</string>
<string name="poi_routes_running">Futás</string>
<string name="poi_routes_pedestrian">Gyaloglás</string>
<string name="poi_routes_trekking">Túrázás</string>
</resources>
Loading
Loading