diff --git a/app/src/main/java/es/tatvil/elfarodelperegrino/CaminoData.java b/app/src/main/java/es/tatvil/elfarodelperegrino/CaminoData.java index cd893b5..8ca7df8 100644 --- a/app/src/main/java/es/tatvil/elfarodelperegrino/CaminoData.java +++ b/app/src/main/java/es/tatvil/elfarodelperegrino/CaminoData.java @@ -10,6 +10,22 @@ import java.util.List; public class CaminoData { + private static List fullTrackCache = null; + + public static List getFullTrack(Context context) { + if (fullTrackCache == null) { + try { + InputStream is = context.getResources().openRawResource(R.raw.camino_frances); + fullTrackCache = GPXParser.parse(is); + is.close(); + } catch (Exception e) { + e.printStackTrace(); + fullTrackCache = new ArrayList<>(); + } + } + return fullTrackCache; + } + private static String loadJSONFromRaw(Context context, int resourceId) { try { InputStream is = context.getResources().openRawResource(resourceId); @@ -139,4 +155,141 @@ public class CaminoData { } return lista; } + + public static List getEtapasPlanificadas(Context context, double maxDist) { + List etapas = new ArrayList<>(); + String json = loadJSONFromRaw(context, R.raw.caminofrances); + List track = getFullTrack(context); + + if (json == null || track.isEmpty()) return etapas; + + try { + JSONArray pueblos = new JSONArray(json); + int etapaNum = 1; + int currentPuebloIndex = 0; + + while (currentPuebloIndex < pueblos.length() - 1) { + JSONObject inicioPueblo = pueblos.getJSONObject(currentPuebloIndex); + double distAcumulada = 0; + int desnivelPos = 0; + int desnivelNeg = 0; + List perfil = new ArrayList<>(); + + int lastAlbergueIndex = -1; + double distAtLastAlbergue = 0; + int posAtLastAlbergue = 0; + int negAtLastAlbergue = 0; + List perfilAtLastAlbergue = new ArrayList<>(); + + int searchPuebloIndex = currentPuebloIndex + 1; + + while (searchPuebloIndex < pueblos.length()) { + JSONObject pPrev = pueblos.getJSONObject(searchPuebloIndex - 1); + JSONObject pCurr = pueblos.getJSONObject(searchPuebloIndex); + + // Calculamos la distancia y desnivel entre estos dos pueblos usando el GPX + SegmentInfo segment = getSegmentInfo(track, + pPrev.getDouble("lat"), pPrev.getDouble("lng"), + pCurr.getDouble("lat"), pCurr.getDouble("lng")); + + distAcumulada += segment.distancia; + desnivelPos += segment.desnivelPos; + desnivelNeg += segment.desnivelNeg; + perfil.addAll(segment.altitudes); + + if (pCurr.optBoolean("tiene_albergue", true)) { + lastAlbergueIndex = searchPuebloIndex; + distAtLastAlbergue = distAcumulada; + posAtLastAlbergue = desnivelPos; + negAtLastAlbergue = desnivelNeg; + perfilAtLastAlbergue = new ArrayList<>(perfil); + } + + if (distAcumulada > maxDist && lastAlbergueIndex != -1) { + break; + } + searchPuebloIndex++; + } + + int endPuebloIndex = (lastAlbergueIndex != -1) ? lastAlbergueIndex : (pueblos.length() - 1); + JSONObject finPueblo = pueblos.getJSONObject(endPuebloIndex); + + double dTotal = lastAlbergueIndex != -1 ? distAtLastAlbergue : distAcumulada; + int pTotal = lastAlbergueIndex != -1 ? posAtLastAlbergue : desnivelPos; + + int dificultad = 1; + if (dTotal > 25 || pTotal > 600) dificultad = 3; + else if (dTotal > 18 || pTotal > 300) dificultad = 2; + + Etapa e = new Etapa( + "Etapa " + etapaNum++, + inicioPueblo.getString("nombre"), + finPueblo.getString("nombre"), + inicioPueblo.getString("nombre") + " - " + finPueblo.getString("nombre"), + "Francés", + Math.round(dTotal * 10.0) / 10.0, + dificultad, "Camino planificado con GPX.", "Ruta de alta precisión", + finPueblo.getDouble("lat"), + finPueblo.getDouble("lng") + ); + e.setDesnivelPositivo(pTotal); + e.setDesnivelNegativo(lastAlbergueIndex != -1 ? negAtLastAlbergue : desnivelNeg); + e.setPerfilElevacion(lastAlbergueIndex != -1 ? perfilAtLastAlbergue : perfil); + + etapas.add(e); + currentPuebloIndex = endPuebloIndex; + if (currentPuebloIndex >= pueblos.length() - 1) break; + } + } catch (Exception e) { + e.printStackTrace(); + } + return etapas; + } + + private static class SegmentInfo { + double distancia = 0; + int desnivelPos = 0; + int desnivelNeg = 0; + List altitudes = new ArrayList<>(); + } + + private static SegmentInfo getSegmentInfo(List track, double lat1, double lon1, double lat2, double lon2) { + SegmentInfo info = new SegmentInfo(); + int startIdx = findNearestIndex(track, lat1, lon1); + int endIdx = findNearestIndex(track, lat2, lon2); + + if (startIdx > endIdx) { int temp = startIdx; startIdx = endIdx; endIdx = temp; } + + for (int i = startIdx; i < endIdx; i++) { + GPXParser.PuntoGPS p1 = track.get(i); + GPXParser.PuntoGPS p2 = track.get(i + 1); + info.distancia += calcularDistancia(p1.lat, p1.lng, p2.lat, p2.lng); + + int diff = (int)(p2.alt - p1.alt); + if (diff > 0) info.desnivelPos += diff; + else info.desnivelNeg += Math.abs(diff); + + if (i % 10 == 0) info.altitudes.add((int)p1.alt); // Muestreo para no saturar el gráfico + } + return info; + } + + private static int findNearestIndex(List track, double lat, double lon) { + int nearest = 0; + double minDist = Double.MAX_VALUE; + for (int i = 0; i < track.size(); i++) { + double d = calcularDistancia(lat, lon, track.get(i).lat, track.get(i).lng); + if (d < minDist) { + minDist = d; + nearest = i; + } + } + return nearest; + } + + private static double calcularDistancia(double lat1, double lon1, double lat2, double lon2) { + float[] results = new float[1]; + android.location.Location.distanceBetween(lat1, lon1, lat2, lon2, results); + return results[0] / 1000.0; + } } diff --git a/app/src/main/java/es/tatvil/elfarodelperegrino/Etapa.java b/app/src/main/java/es/tatvil/elfarodelperegrino/Etapa.java index 651fa48..267af34 100644 --- a/app/src/main/java/es/tatvil/elfarodelperegrino/Etapa.java +++ b/app/src/main/java/es/tatvil/elfarodelperegrino/Etapa.java @@ -35,10 +35,14 @@ public class Etapa implements Serializable { this.latitud = latitud; this.longitud = longitud; this.imagenUrl = "https://picsum.photos/seed/" + nombre.replace(" ", "") + "/800/400"; - // Valores por defecto para el ejemplo - this.desnivelPositivo = (int) (distancia * 15); - this.desnivelNegativo = (int) (distancia * 12); - this.perfilElevacion = generarPerfilMock(distancia); + // Valores por defecto + this.desnivelPositivo = 0; + this.desnivelNegativo = 0; + this.perfilElevacion = new ArrayList<>(); + } + + public void setPerfilElevacion(List perfil) { + this.perfilElevacion = perfil; } private List generarPerfilMock(double dist) { diff --git a/app/src/main/java/es/tatvil/elfarodelperegrino/EtapaAdapter.java b/app/src/main/java/es/tatvil/elfarodelperegrino/EtapaAdapter.java index ecd0597..d5097b2 100644 --- a/app/src/main/java/es/tatvil/elfarodelperegrino/EtapaAdapter.java +++ b/app/src/main/java/es/tatvil/elfarodelperegrino/EtapaAdapter.java @@ -34,6 +34,19 @@ public class EtapaAdapter extends RecyclerView.Adapter adapterCaminos = new ArrayAdapter<>(this, - android.R.layout.simple_spinner_item, opcionesCaminos); - adapterCaminos.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_item, opcionesCaminos); + adapterCaminos.setDropDownViewResource(R.layout.spinner_item); spinnerCaminos.setAdapter(adapterCaminos); // 5. Configuración del Spinner para distancia máxima Spinner spinnerDistancia = findViewById(R.id.spinnerDistancia); String[] opcionesDistancia = {"Sin límite", "15 km", "20 km", "25 km"}; ArrayAdapter adapterDistancia = new ArrayAdapter<>(this, - android.R.layout.simple_spinner_item, opcionesDistancia); - adapterDistancia.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + R.layout.spinner_item, opcionesDistancia); + adapterDistancia.setDropDownViewResource(R.layout.spinner_item); spinnerDistancia.setAdapter(adapterDistancia); AdapterView.OnItemSelectedListener listener = new AdapterView.OnItemSelectedListener() { @@ -80,13 +80,22 @@ public class EtapasActivity extends AppCompatActivity { } private void actualizarListaEtapas(String camino, double maxDistancia, RecyclerView recyclerView) { - List todas = CaminoData.getEtapasPorCamino(this, camino); - List filtradas = new ArrayList<>(); - for (Etapa e : todas) { - if (e.getDistancia() <= maxDistancia) { - filtradas.add(e); + List filtradas; + + if (camino.equalsIgnoreCase("Francés") && maxDistancia < 1000) { + // Si es el Camino Francés y hay un límite de distancia, usamos el planificador dinámico + filtradas = CaminoData.getEtapasPlanificadas(this, maxDistancia); + } else { + // Para otros casos o sin límite, usamos las etapas predefinidas + List todas = CaminoData.getEtapasPorCamino(this, camino); + filtradas = new ArrayList<>(); + for (Etapa e : todas) { + if (e.getDistancia() <= maxDistancia) { + filtradas.add(e); + } } } + EtapaAdapter adapter = new EtapaAdapter(filtradas); recyclerView.setAdapter(adapter); } diff --git a/app/src/main/java/es/tatvil/elfarodelperegrino/GPXParser.java b/app/src/main/java/es/tatvil/elfarodelperegrino/GPXParser.java new file mode 100644 index 0000000..fc9fa19 --- /dev/null +++ b/app/src/main/java/es/tatvil/elfarodelperegrino/GPXParser.java @@ -0,0 +1,45 @@ +package es.tatvil.elfarodelperegrino; + +import android.util.Xml; +import org.xmlpull.v1.XmlPullParser; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +public class GPXParser { + public static class PuntoGPS { + public double lat, lng, alt; + + public PuntoGPS(double lat, double lng, double alt) { + this.lat = lat; + this.lng = lng; + this.alt = alt; + } + } + + public static List parse(InputStream in) throws Exception { + List puntos = new ArrayList<>(); + XmlPullParser parser = Xml.newPullParser(); + parser.setInput(in, null); + + int eventType = parser.getEventType(); + PuntoGPS puntoActual = null; + + while (eventType != XmlPullParser.END_DOCUMENT) { + String tag = parser.getName(); + if (eventType == XmlPullParser.START_TAG) { + if ("trkpt".equalsIgnoreCase(tag)) { + double lat = Double.parseDouble(parser.getAttributeValue(null, "lat")); + double lon = Double.parseDouble(parser.getAttributeValue(null, "lon")); + puntoActual = new PuntoGPS(lat, lon, 0); + } else if ("ele".equalsIgnoreCase(tag) && puntoActual != null) { + puntoActual.alt = Double.parseDouble(parser.nextText()); + } + } else if (eventType == XmlPullParser.END_TAG && "trkpt".equalsIgnoreCase(tag)) { + if (puntoActual != null) puntos.add(puntoActual); + } + eventType = parser.next(); + } + return puntos; + } +} diff --git a/app/src/main/res/drawable/spinner_background.xml b/app/src/main/res/drawable/spinner_background.xml new file mode 100644 index 0000000..d45e660 --- /dev/null +++ b/app/src/main/res/drawable/spinner_background.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_etapas.xml b/app/src/main/res/layout/activity_etapas.xml index ee13c5f..12acc6b 100644 --- a/app/src/main/res/layout/activity_etapas.xml +++ b/app/src/main/res/layout/activity_etapas.xml @@ -12,38 +12,44 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:padding="8dp" + android:padding="12dp" + android:background="@color/spiritual_black" app:layout_constraintTop_toTopOf="parent"> + android:textColor="@color/spiritual_text_dim" + android:textSize="12sp" + android:textStyle="bold" + android:layout_marginStart="8dp" + android:layout_marginBottom="4dp"/> + android:layout_height="48dp" + android:layout_marginBottom="12dp" + android:background="@drawable/spinner_background" + android:popupBackground="@color/spiritual_surface" /> + android:textColor="@color/spiritual_text_dim" + android:textSize="12sp" + android:textStyle="bold" + android:layout_marginStart="8dp" + android:layout_marginBottom="4dp"/> + android:layout_height="48dp" + android:background="@drawable/spinner_background" + android:popupBackground="@color/spiritual_surface" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/spinner_item.xml b/app/src/main/res/layout/spinner_item.xml new file mode 100644 index 0000000..f9c9c2f --- /dev/null +++ b/app/src/main/res/layout/spinner_item.xml @@ -0,0 +1,9 @@ + + diff --git a/app/src/main/res/raw/CaminoDelNorte.txt b/app/src/main/res/raw/CaminoDelNorte.txt deleted file mode 100644 index 045e1d3..0000000 --- a/app/src/main/res/raw/CaminoDelNorte.txt +++ /dev/null @@ -1,29 +0,0 @@ -​Roncesvalle -​Burguete -​Zubiri -​Pamplona -​Puente la Reina -​Estella -​Viana -​Logroño -​Navarrete -​Nájera -​Santo Domingo de la Calzada -​Burgos -​Castrojeriz -​Frómista -​Carrión de los Condes -​Sahagún -​León -​Hospital de Órbigo -​Astorga -​Ponferrada -​Villafranca del Bierzo -​O Cebreiro -​Triacastela -​Sarria -​Portomarín -​Palas de Rei -​Melide -​Arzúa -​Santiago de Compostela \ No newline at end of file diff --git a/app/src/main/res/raw/camino-frances.json b/app/src/main/res/raw/camino-frances.json deleted file mode 100644 index 9f075d2..0000000 --- a/app/src/main/res/raw/camino-frances.json +++ /dev/null @@ -1,597 +0,0 @@ -[ - { - "nombre": "Saint-Jean-Pied-de-Port", - "lat": 43.1636, - "lng": -1.2394 - }, - { - "nombre": "Huntto", - "lat": 43.1345, - "lng": -1.2461 - }, - { - "nombre": "Orisson", - "lat": 43.1234, - "lng": -1.2642 - }, - { - "nombre": "Roncesvalles", - "lat": 43.0092, - "lng": -1.3194 - }, - { - "nombre": "Burguete", - "lat": 42.9891, - "lng": -1.3341 - }, - { - "nombre": "Espinal", - "lat": 42.9774, - "lng": -1.3735 - }, - { - "nombre": "Viscarret", - "lat": 42.9492, - "lng": -1.4111 - }, - { - "nombre": "Lintzoáin", - "lat": 42.9413, - "lng": -1.4285 - }, - { - "nombre": "Zubiri", - "lat": 42.9298, - "lng": -1.5042 - }, - { - "nombre": "Larrasoaña", - "lat": 42.9094, - "lng": -1.5235 - }, - { - "nombre": "Akerreta", - "lat": 42.8986, - "lng": -1.5264 - }, - { - "nombre": "Zuriáin", - "lat": 42.8794, - "lng": -1.5542 - }, - { - "nombre": "Irotz", - "lat": 42.8712, - "lng": -1.5678 - }, - { - "nombre": "Zabaldika", - "lat": 42.8634, - "lng": -1.5794 - }, - { - "nombre": "Trinidad de Arre", - "lat": 42.8425, - "lng": -1.6136 - }, - { - "nombre": "Pamplona", - "lat": 42.8125, - "lng": -1.6458 - }, - { - "nombre": "Cizur Menor", - "lat": 42.7936, - "lng": -1.6741 - }, - { - "nombre": "Zariquiegui", - "lat": 42.7478, - "lng": -1.7164 - }, - { - "nombre": "Uterga", - "lat": 42.7142, - "lng": -1.7584 - }, - { - "nombre": "Muruzábal", - "lat": 42.6931, - "lng": -1.7652 - }, - { - "nombre": "Obanos", - "lat": 42.6806, - "lng": -1.7856 - }, - { - "nombre": "Puente la Reina", - "lat": 42.6719, - "lng": -1.8156 - }, - { - "nombre": "Mañeru", - "lat": 42.6661, - "lng": -1.8672 - }, - { - "nombre": "Cirauqui", - "lat": 42.6736, - "lng": -1.8986 - }, - { - "nombre": "Lorca", - "lat": 42.6725, - "lng": -1.9794 - }, - { - "nombre": "Villatuerta", - "lat": 42.6592, - "lng": -2.0306 - }, - { - "nombre": "Estella", - "lat": 42.6717, - "lng": -2.0306 - }, - { - "nombre": "Ayegui", - "lat": 42.6558, - "lng": -2.0461 - }, - { - "nombre": "Azqueta", - "lat": 42.6394, - "lng": -2.1125 - }, - { - "nombre": "Villamayor de Monjardín", - "lat": 42.6286, - "lng": -2.1386 - }, - { - "nombre": "Los Arcos", - "lat": 42.5694, - "lng": -2.1917 - }, - { - "nombre": "Sansol", - "lat": 42.5564, - "lng": -2.2614 - }, - { - "nombre": "Torres del Río", - "lat": 42.5519, - "lng": -2.2725 - }, - { - "nombre": "Viana", - "lat": 42.5153, - "lng": -2.3719 - }, - { - "nombre": "Logroño", - "lat": 42.4627, - "lng": -2.4447 - }, - { - "nombre": "Navarrete", - "lat": 42.4286, - "lng": -2.5622 - }, - { - "nombre": "Nájera", - "lat": 42.4161, - "lng": -2.7319 - }, - { - "nombre": "Azofra", - "lat": 42.4239, - "lng": -2.7917 - }, - { - "nombre": "Cirueña", - "lat": 42.4114, - "lng": -2.8942 - }, - { - "nombre": "Santo Domingo de la Calzada", - "lat": 42.4406, - "lng": -2.9531 - }, - { - "nombre": "Grañón", - "lat": 42.4503, - "lng": -3.0286 - }, - { - "nombre": "Redecilla del Camino", - "lat": 42.4386, - "lng": -3.0642 - }, - { - "nombre": "Viloria de Rioja", - "lat": 42.4244, - "lng": -3.1022 - }, - { - "nombre": "Belorado", - "lat": 42.4203, - "lng": -3.1903 - }, - { - "nombre": "Tosantos", - "lat": 42.4136, - "lng": -3.2458 - }, - { - "nombre": "Villafranca Montes de Oca", - "lat": 42.3875, - "lng": -3.3106 - }, - { - "nombre": "San Juan de Ortega", - "lat": 42.3789, - "lng": -3.4358 - }, - { - "nombre": "Agés", - "lat": 42.3742, - "lng": -3.4794 - }, - { - "nombre": "Atapuerca", - "lat": 42.3778, - "lng": -3.5097 - }, - { - "nombre": "Burgos", - "lat": 42.3439, - "lng": -3.6969 - }, - { - "nombre": "Tardajos", - "lat": 42.3475, - "lng": -3.8186 - }, - { - "nombre": "Rabé de las Calzadas", - "lat": 42.3403, - "lng": -3.8344 - }, - { - "nombre": "Hornillos del Camino", - "lat": 42.3394, - "lng": -3.9264 - }, - { - "nombre": "Hontanas", - "lat": 42.3117, - "lng": -4.0453 - }, - { - "nombre": "Castrojeriz", - "lat": 42.2881, - "lng": -4.1378 - }, - { - "nombre": "Itero de la Vega", - "lat": 42.2861, - "lng": -4.2542 - }, - { - "nombre": "Boadilla del Camino", - "lat": 42.2592, - "lng": -4.3494 - }, - { - "nombre": "Frómista", - "lat": 42.2683, - "lng": -4.4069 - }, - { - "nombre": "Población de Campos", - "lat": 42.2708, - "lng": -4.4467 - }, - { - "nombre": "Villarmentero de Campos", - "lat": 42.2858, - "lng": -4.5103 - }, - { - "nombre": "Villalcázar de Sirga", - "lat": 42.3164, - "lng": -4.5425 - }, - { - "nombre": "Carrión de los Condes", - "lat": 42.3392, - "lng": -4.6061 - }, - { - "nombre": "Calzadilla de la Cueza", - "lat": 42.3592, - "lng": -4.8386 - }, - { - "nombre": "Lédigos", - "lat": 42.3556, - "lng": -4.9192 - }, - { - "nombre": "Terradillos de los Templarios", - "lat": 42.3533, - "lng": -4.9567 - }, - { - "nombre": "Moratinos", - "lat": 42.3578, - "lng": -4.9911 - }, - { - "nombre": "San Nicolás del Real Camino", - "lat": 42.3614, - "lng": -5.0211 - }, - { - "nombre": "Sahagún", - "lat": 42.3719, - "lng": -5.0286 - }, - { - "nombre": "Bercianos del Real Camino", - "lat": 42.3875, - "lng": -5.1464 - }, - { - "nombre": "El Burgo Ranero", - "lat": 42.4239, - "lng": -5.2217 - }, - { - "nombre": "Reliegos", - "lat": 42.4847, - "lng": -5.3517 - }, - { - "nombre": "Mansilla de las Mulas", - "lat": 42.5036, - "lng": -5.4158 - }, - { - "nombre": "León", - "lat": 42.5989, - "lng": -5.5672 - }, - { - "nombre": "Virgen del Camino", - "lat": 42.5786, - "lng": -5.6417 - }, - { - "nombre": "Villadangos del Páramo", - "lat": 42.5169, - "lng": -5.7667 - }, - { - "nombre": "San Martín del Camino", - "lat": 42.4939, - "lng": -5.8119 - }, - { - "nombre": "Hospital de Órbigo", - "lat": 42.4631, - "lng": -5.8825 - }, - { - "nombre": "Santibáñez de Valdeiglesias", - "lat": 42.4647, - "lng": -5.9239 - }, - { - "nombre": "Astorga", - "lat": 42.4578, - "lng": -6.0567 - }, - { - "nombre": "Murias de Rechivaldo", - "lat": 42.4608, - "lng": -6.1039 - }, - { - "nombre": "Santa Catalina de Somoza", - "lat": 42.4553, - "lng": -6.1583 - }, - { - "nombre": "El Ganso", - "lat": 42.4517, - "lng": -6.2081 - }, - { - "nombre": "Rabanal del Camino", - "lat": 42.4808, - "lng": -6.2831 - }, - { - "nombre": "Foncebadón", - "lat": 42.4947, - "lng": -6.3422 - }, - { - "nombre": "Acebo", - "lat": 42.5097, - "lng": -6.4172 - }, - { - "nombre": "Molinaseca", - "lat": 42.5375, - "lng": -6.5203 - }, - { - "nombre": "Ponferrada", - "lat": 42.5458, - "lng": -6.5911 - }, - { - "nombre": "Camponaraya", - "lat": 42.5811, - "lng": -6.6703 - }, - { - "nombre": "Cacabelos", - "lat": 42.5997, - "lng": -6.7264 - }, - { - "nombre": "Villafranca del Bierzo", - "lat": 42.6075, - "lng": -6.8111 - }, - { - "nombre": "Trabadelo", - "lat": 42.6503, - "lng": -6.8858 - }, - { - "nombre": "La Portela de Valcarce", - "lat": 42.6681, - "lng": -6.9467 - }, - { - "nombre": "Vega de Valcarce", - "lat": 42.6644, - "lng": -6.9478 - }, - { - "nombre": "Las Herrerías", - "lat": 42.6931, - "lng": -7.0039 - }, - { - "nombre": "La Faba", - "lat": 42.7003, - "lng": -7.0286 - }, - { - "nombre": "O Cebreiro", - "lat": 42.7081, - "lng": -7.0436 - }, - { - "nombre": "Liñares", - "lat": 42.7161, - "lng": -7.0864 - }, - { - "nombre": "Hospital da Condesa", - "lat": 42.7214, - "lng": -7.1122 - }, - { - "nombre": "Padornelo", - "lat": 42.7239, - "lng": -7.1306 - }, - { - "nombre": "Triacastela", - "lat": 42.7558, - "lng": -7.2417 - }, - { - "nombre": "Samos", - "lat": 42.7303, - "lng": -7.3275 - }, - { - "nombre": "Sarria", - "lat": 42.7778, - "lng": -7.4161 - }, - { - "nombre": "Barbadelo", - "lat": 42.7664, - "lng": -7.4642 - }, - { - "nombre": "Ferreiros", - "lat": 42.7417, - "lng": -7.5494 - }, - { - "nombre": "Portomarín", - "lat": 42.8078, - "lng": -7.6167 - }, - { - "nombre": "Gonzar", - "lat": 42.8436, - "lng": -7.6964 - }, - { - "nombre": "Ventas de Narón", - "lat": 42.8594, - "lng": -7.7319 - }, - { - "nombre": "Ligonde", - "lat": 42.8642, - "lng": -7.7711 - }, - { - "nombre": "Palas de Rei", - "lat": 42.8733, - "lng": -7.8694 - }, - { - "nombre": "Casanova", - "lat": 42.8839, - "lng": -7.9342 - }, - { - "nombre": "Leboreiro", - "lat": 42.8881, - "lng": -7.9864 - }, - { - "nombre": "Melide", - "lat": 42.9153, - "lng": -8.0142 - }, - { - "nombre": "Boente", - "lat": 42.9169, - "lng": -8.0811 - }, - { - "nombre": "Ribadiso da Baixo", - "lat": 42.9231, - "lng": -8.1467 - }, - { - "nombre": "Arzúa", - "lat": 42.9272, - "lng": -8.1642 - }, - { - "nombre": "Salceda", - "lat": 42.9136, - "lng": -8.2831 - }, - { - "nombre": "O Pedrouzo", - "lat": 42.9039, - "lng": -8.3611 - }, - { - "nombre": "Monte do Gozo", - "lat": 42.8894, - "lng": -8.4942 - }, - { - "nombre": "Santiago de Compostela", - "lat": 42.8806, - "lng": -8.5447 - } -] \ No newline at end of file diff --git a/app/src/main/res/raw/camino_frances.gpx b/app/src/main/res/raw/camino_frances.gpx new file mode 100644 index 0000000..74bfa82 --- /dev/null +++ b/app/src/main/res/raw/camino_frances.gpx @@ -0,0 +1,1988 @@ + + + + Wikiloc - Camino de Santiago, Francés + + Camino de Santiago, Francés - Wikiloc on Wikiloc + + + + + Camino de Santiago, Francés - Wikiloc + + + + + 220.433 + + + + 253.323 + + + + 318.015 + + + + 362.907 + + + + 395.614 + + + + 497.854 + + + + 739.840 + + + + 841.356 + + + + 1004.812 + + + + 1078.153 + + + + 1095.553 + + + + 1124.233 + + + + 1178.023 + + + + 1269.815 + + + + 1293.707 + + + + 1320.524 + + + + 1348.244 + + + + 1424.830 + + + + 1215.446 + + + + 1080.222 + + + + 1125.773 + + + + 1028.953 + + + + 933.354 + + + + 962.256 + + + + 928.411 + + + + 913.107 + + + + 903.146 + + + + 903.046 + + + + 884.752 + + + + 891.458 + + + + 870.454 + + + + 870.475 + + + + 930.215 + + + + 922.015 + + + + 823.865 + + + + 749.911 + + + + 757.907 + + + + 790.592 + + + + 853.672 + + + + 824.118 + + + + 832.924 + + + + 840.480 + + + + 795.261 + + + + 665.731 + + + + 645.235 + + + + 604.886 + + + + 522.114 + + + + 534.807 + + + + 547.774 + + + + 514.234 + + + + 537.040 + + + + 514.526 + + + + 494.292 + + + + 523.173 + + + + 480.153 + + + + 482.611 + + + + 471.621 + + + + 462.803 + + + + 443.707 + + + + 438.112 + + + + 438.112 + + + + 445.198 + + + + 422.054 + + + + 430.150 + + + + 460.911 + + + + 454.021 + + + + 448.443 + + + + 450.964 + + + + 444.910 + + + + 447.007 + + + + 410.915 + + + + 435.045 + + + + 518.331 + + + + 657.967 + + + + 648.713 + + + + 540.344 + + + + 486.014 + + + + 475.172 + + + + 442.313 + + + + 417.014 + + + + 355.907 + + + + 341.158 + + + + 352.588 + + + + 477.254 + + + + 438.420 + + + + 461.536 + + + + 387.667 + + + + 388.147 + + + + 465.381 + + + + 482.961 + + + + 430.217 + + + + 438.207 + + + + 447.389 + + + + 434.279 + + + + 428.455 + + + + 423.041 + + + + 420.427 + + + + 423.078 + + + + 419.718 + + + + 419.965 + + + + 438.368 + + + + 550.214 + + + + 561.707 + + + + 689.597 + + + + 587.067 + + + + 552.873 + + + + 538.999 + + + + 508.095 + + + + 542.676 + + + + 535.246 + + + + 498.772 + + + + 453.313 + + + + 445.014 + + + + 452.307 + + + + 453.658 + + + + 471.328 + + + + 456.564 + + + + 473.680 + + + + 564.096 + + + + 505.057 + + + + 479.317 + + + + 464.298 + + + + 463.515 + + + + 467.926 + + + + 416.207 + + + + 398.150 + + + + 397.460 + + + + 408.436 + + + + 435.062 + + + + 373.578 + + + + 375.819 + + + + 389.059 + + + + 402.447 + + + + 409.129 + + + + 436.021 + + + + 443.407 + + + + 443.795 + + + + 478.895 + + + + 510.461 + + + + 492.977 + + + + 501.123 + + + + 505.084 + + + + 518.744 + + + + 571.577 + + + + 561.061 + + + + 586.827 + + + + 616.107 + + + + 584.488 + + + + 557.298 + + + + 483.424 + + + + 557.870 + + + + 549.356 + + + + 551.557 + + + + 571.047 + + + + 673.117 + + + + 742.887 + + + + 717.815 + + + + 634.907 + + + + 637.642 + + + + 716.512 + + + + 634.918 + + + + 639.014 + + + + 663.980 + + + + 722.821 + + + + 733.271 + + + + 718.289 + + + + 697.906 + + + + 693.626 + + + + 736.907 + + + + 760.129 + + + + 770.299 + + + + 802.165 + + + + 771.091 + + + + 761.437 + + + + 790.038 + + + + 804.678 + + + + 766.165 + + + + 792.968 + + + + 822.814 + + + + 861.907 + + + + 895.717 + + + + 925.097 + + + + 934.613 + + + + 976.519 + + + + 1080.475 + + + + 1156.876 + + + + 1147.316 + + + + 1145.778 + + + + 1095.333 + + + + 1051.726 + + + + 966.507 + + + + 1057.948 + + + + 983.838 + + + + 944.114 + + + + 937.530 + + + + 926.076 + + + + 920.667 + + + + 890.877 + + + + 865.029 + + + + 860.400 + + + + 853.820 + + + + 854.007 + + + + 849.013 + + + + 840.013 + + + + 832.699 + + + + 825.715 + + + + 821.051 + + + + 831.332 + + + + 919.062 + + + + 821.917 + + + + 852.987 + + + + 907.715 + + + + 927.207 + + + + 865.482 + + + + 853.312 + + + + 833.318 + + + + 821.584 + + + + 804.530 + + + + 801.081 + + + + 807.051 + + + + 796.575 + + + + 807.828 + + + + 805.720 + + + + 856.407 + + + + 791.758 + + + + 769.678 + + + + 771.254 + + + + 771.430 + + + + 798.876 + + + + 783.237 + + + + 787.867 + + + + 793.089 + + + + 793.606 + + + + 783.826 + + + + 780.607 + + + + 789.549 + + + + 776.089 + + + + 783.065 + + + + 785.311 + + + + 789.277 + + + + 808.378 + + + + 836.838 + + + + 824.041 + + + + 827.081 + + + + 835.909 + + + + 828.007 + + + + 867.045 + + + + 852.475 + + + + 861.071 + + + + 889.257 + + + + 870.563 + + + + 868.974 + + + + 870.154 + + + + 874.034 + + + + 844.755 + + + + 862.710 + + + + 842.407 + + + + 815.514 + + + + 832.774 + + + + 817.310 + + + + 831.186 + + + + 817.952 + + + + 797.223 + + + + 809.223 + + + + 823.084 + + + + 826.407 + + + + 831.517 + + + + 851.007 + + + + 861.899 + + + + 867.899 + + + + 868.195 + + + + 854.761 + + + + 845.077 + + + + 798.038 + + + + 801.658 + + + + 804.935 + + + + 825.686 + + + + 853.014 + + + + 882.807 + + + + 812.154 + + + + 818.034 + + + + 814.020 + + + + 817.146 + + + + 828.042 + + + + 819.393 + + + + 821.413 + + + + 836.067 + + + + 890.981 + + + + 886.019 + + + + 880.807 + + + + 900.077 + + + + 893.097 + + + + 890.043 + + + + 891.029 + + + + 876.655 + + + + 875.076 + + + + 845.016 + + + + 833.974 + + + + 835.656 + + + + 828.321 + + + + 823.307 + + + + 817.098 + + + + 819.458 + + + + 818.024 + + + + 838.490 + + + + 847.496 + + + + 880.297 + + + + 917.787 + + + + 915.095 + + + + 840.249 + + + + 861.323 + + + + 870.507 + + + + 865.960 + + + + 871.880 + + + + 859.866 + + + + 866.112 + + + + 867.478 + + + + 879.099 + + + + 868.039 + + + + 925.045 + + + + 984.547 + + + + 1030.911 + + + + 1104.107 + + + + 1191.395 + + + + 1344.025 + + + + 1365.541 + + + + 1442.047 + + + + 1477.013 + + + + 1489.934 + + + + 1496.184 + + + + 1479.799 + + + + 1462.407 + + + + 1462.227 + + + + 1502.807 + + + + 1414.690 + + + + 1389.810 + + + + 1286.776 + + + + 1156.462 + + + + 1055.988 + + + + 959.229 + + + + 918.449 + + + + 801.343 + + + + 736.964 + + + + 650.910 + + + + 604.707 + + + + 571.055 + + + + 615.135 + + + + 541.051 + + + + 517.127 + + + + 507.113 + + + + 528.084 + + + + 532.054 + + + + 523.433 + + + + 532.323 + + + + 522.215 + + + + 524.207 + + + + 539.594 + + + + 543.074 + + + + 511.140 + + + + 496.556 + + + + 513.222 + + + + 482.993 + + + + 476.153 + + + + 508.655 + + + + 570.407 + + + + 531.517 + + + + 574.907 + + + + 532.356 + + + + 508.926 + + + + 658.432 + + + + 738.948 + + + + 792.314 + + + + 857.565 + + + + 906.435 + + + + 891.984 + + + + 630.407 + + + + 579.017 + + + + 587.007 + + + + 614.559 + + + + 614.139 + + + + 646.345 + + + + 654.431 + + + + 676.327 + + + + 696.328 + + + + 960.188 + + + + 1211.621 + + + + 1266.141 + + + + 1291.605 + + + + 1336.507 + + + + 1252.393 + + + + 1229.583 + + + + 1244.899 + + + + 1292.045 + + + + 1289.551 + + + + 1240.612 + + + + 1184.832 + + + + 1160.359 + + + + 1127.403 + + + + 823.623 + + + + 696.407 + + + + 657.726 + + + + 700.726 + + + + 776.882 + + + + 862.438 + + + + 875.084 + + + + 893.075 + + + + 869.915 + + + + 857.474 + + + + 765.356 + + + + 732.721 + + + + 682.507 + + + + 660.068 + + + + 618.178 + + + + 421.364 + + + + 471.960 + + + + 547.556 + + + + 573.027 + + + + 627.237 + + + + 616.785 + + + + 595.789 + + + + 629.017 + + + + 635.107 + + + + 633.689 + + + + 664.429 + + + + 656.235 + + + + 653.741 + + + + 640.557 + + + + 641.898 + + + + 533.718 + + + + 425.099 + + + + 413.307 + + + + 348.127 + + + + 380.907 + + + + 367.440 + + + + 371.570 + + + + 438.396 + + + + 450.922 + + + + 498.378 + + + + 653.149 + + + + 691.339 + + + + 688.398 + + + + 723.915 + + + + 637.026 + + + + 633.007 + + + + 586.790 + + + + 597.810 + + + + 619.856 + + + + 561.592 + + + + 530.818 + + + + 529.939 + + + + 442.139 + + + + 468.773 + + + + 450.285 + + + + 409.713 + + + + 456.107 + + + + 426.488 + + + + 464.078 + + + + 416.044 + + + + 348.090 + + + + 409.676 + + + + 331.097 + + + + 340.797 + + + + 357.711 + + + + 388.921 + + + + 386.803 + + + + 355.307 + + + + 333.962 + + + + 369.572 + + + + 397.838 + + + + 335.924 + + + + 360.620 + + + + 375.671 + + + + 401.391 + + + + 343.756 + + + + 294.059 + + + + 342.914 + + + + 373.907 + + + + 362.766 + + + + 333.426 + + + + 336.882 + + + + 298.568 + + + + 296.514 + + + + 320.495 + + + + 356.165 + + + + 361.334 + + + + 372.455 + + + + 360.410 + + + + 310.007 + + + + 305.074 + + + + 289.844 + + + + 272.230 + + + + 280.186 + + + + 260.762 + + + + \ No newline at end of file diff --git a/app/src/main/res/raw/caminofrances.json b/app/src/main/res/raw/caminofrances.json new file mode 100644 index 0000000..547df42 --- /dev/null +++ b/app/src/main/res/raw/caminofrances.json @@ -0,0 +1,163 @@ +[ + { + "nombre": "Saint-Jean-Pied-de-Port", + "lat": 43.1636, + "lng": -1.2394, + "alt": 172, + "tiene_albergue": true + }, + { + "nombre": "Huntto", + "lat": 43.1345, + "lng": -1.2461, + "alt": 608, + "tiene_albergue": true + }, + { + "nombre": "Orisson", + "lat": 43.1234, + "lng": -1.2642, + "alt": 792, + "tiene_albergue": true + }, + { + "nombre": "Puerto de Ibañeta", + "lat": 43.0205, + "lng": -1.3242, + "alt": 1057, + "tiene_albergue": false + }, + { + "nombre": "Roncesvalles", + "lat": 43.0092, + "lng": -1.3194, + "alt": 950, + "tiene_albergue": true + }, + { + "nombre": "Burguete", + "lat": 42.9891, + "lng": -1.3341, + "alt": 885, + "tiene_albergue": true + }, + { + "nombre": "Espinal", + "lat": 42.9774, + "lng": -1.3735, + "alt": 870, + "tiene_albergue": true + }, + { + "nombre": "Viscarret", + "lat": 42.9492, + "lng": -1.4111, + "alt": 780, + "tiene_albergue": true + }, + { + "nombre": "Zubiri", + "lat": 42.9298, + "lng": -1.5042, + "alt": 526, + "tiene_albergue": true + }, + { + "nombre": "Larrasoaña", + "lat": 42.9094, + "lng": -1.5235, + "alt": 485, + "tiene_albergue": true + }, + { + "nombre": "Pamplona", + "lat": 42.8125, + "lng": -1.6458, + "alt": 446, + "tiene_albergue": true + }, + { + "nombre": "Puente la Reina", + "lat": 42.6719, + "lng": -1.8156, + "alt": 345, + "tiene_albergue": true + }, + { + "nombre": "Estella", + "lat": 42.6717, + "lng": -2.0306, + "alt": 425, + "tiene_albergue": true + }, + { + "nombre": "Logroño", + "lat": 42.4627, + "lng": -2.4447, + "alt": 384, + "tiene_albergue": true + }, + { + "nombre": "Santo Domingo de la Calzada", + "lat": 42.4406, + "lng": -2.9531, + "alt": 638, + "tiene_albergue": true + }, + { + "nombre": "Burgos", + "lat": 42.3439, + "lng": -3.6969, + "alt": 856, + "tiene_albergue": true + }, + { + "nombre": "León", + "lat": 42.5989, + "lng": -5.5672, + "alt": 837, + "tiene_albergue": true + }, + { + "nombre": "Astorga", + "lat": 42.4578, + "lng": -6.0567, + "alt": 869, + "tiene_albergue": true + }, + { + "nombre": "Ponferrada", + "lat": 42.5458, + "lng": -6.5911, + "alt": 543, + "tiene_albergue": true + }, + { + "nombre": "O Cebreiro", + "lat": 42.7081, + "lng": -7.0436, + "alt": 1330, + "tiene_albergue": true + }, + { + "nombre": "Sarria", + "lat": 42.7778, + "lng": -7.4161, + "alt": 454, + "tiene_albergue": true + }, + { + "nombre": "Portomarín", + "lat": 42.8078, + "lng": -7.6167, + "alt": 387, + "tiene_albergue": true + }, + { + "nombre": "Santiago de Compostela", + "lat": 42.8806, + "lng": -8.5447, + "alt": 260, + "tiene_albergue": true + } +]