opening local gpx files via kml Overlay

Started by rainer0665, August 24, 2020, 04:28:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rainer0665

Hi,

i am playing around with overlays (want to create a offline overlay with all premium hiking ways, with the start points as KML waypoints, and in the description of that waypoint, i want to include a clickable URL to a local GPX file so that Orux can load the GPX if needed).

I am able to open an "online link" to a gpx file (e.g. https://www.wanderinstitut.de/gpx/aacher-geissbock.gpx), but if i download this GPX and store it in my Download directory on Android 10, i was unsuccessful to find a way to have Orux loading this local file.

See my kml file below. I would have hoped that this option ("<a href="file:///storage/emulated/0/Download/tst.gpx">GPX Track lokal 2</a>" would allow me to open the locally stored GPX in Oruxmaps, but neither of the local options work. (the online variant works as expected, downloads the GPX file to the tracklogs directory and opens it in ORUX)

Any idea, how i would need to specify local GPX files so that they open when i click the link?

Thanks!

Quote
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Region>
  <LatLonAltBox>
    <north>47.900</north>
    <south>47.800</south>
    <east>8.900</east>
    <west>8.500</west>
  </LatLonAltBox>
  <Lod>
    <minLodPixels>4032</minLodPixels>
  </Lod>
</Region>
<Style id="berg">
  <IconStyle>
    <scale>0.7</scale>
    <Icon>
      <href>https://maps.google.com/mapfiles/kml/shapes/mountains.png</href>
    </Icon>
  </IconStyle>
</Style>


  <Placemark>
    <name>Premiumwanderweg Achener Gaißbock</name>
    <description>
    <![CDATA[
<p>Länge: 2187 m</p>
<p>Höhenmeter: 1010 m</p>
<p><a href="https://opentopomap.org/#map=15/47.846275/8.858108">OpenTopoMap</a></p>

<p><a href="https://www.wanderinstitut.de/gpx/aacher-geissbock.gpx">GPX Track online</a></p>
<p><a href="/storage/emulated/0/Download/tst.gpx">GPX Track lokal 1</a></p>
<p><a href="file:///storage/emulated/0/Download/tst.gpx">GPX Track lokal 2</a></p>
<p><a href="file://storage/emulated/0/Download/tst.gpx">GPX Track lokal 3</a></p>
]]>
    </description>
    <styleUrl>#berg</styleUrl>
    <Point>
      <altitudeMode>clampToGround</altitudeMode>
      <coordinates>8.858108,47.846275</coordinates>
    </Point>
  </Placemark>



</Document>
</kml>

afgb1977

Open the GPX file in OruxMaps and add a WayPoint to it. In the WayPoint, in the description menu you can attach a WEB link as a clickable item. To do this, you must first go to: General Settings - Waypoint - and check the box "Links in Description "

rainer0665

Hi afgb1977, thanks for the answer, but I am afraid, that this is not what I like to achieve (I have checkmarked the "Links in description" and this works great for all the "online links" in my KML file (for example if I click on the "OpenTopoMap" Link in the description of the placemark ("<p><a href="https://opentopomap.org/#map=15/47.846275/8.858108">OpenTopoMap</a></p>"), the link is opened in a web browser as expected.

In addition to opening the OpenTopMap link, I would like to save the GPX track locally to Android (say in "Download" directory as tst.gpx). Instead of calling "https://" links I would like top open "file:///" links, hoping that Orux then would load the tst.gpx file as a route (just as if you open gpx files via the oruxmaps menu)

Problem from my point of view is, that I do not know, how to enter these "local" links to a kml file (maybe not enough "/", or too many, or maybe local links don't even work at all, or my path is incorrect (would assume for internal storage, the /storage/emulated/0/Download should be the right path, but maybe this also is wrong??).

If I click on one of the local link variants in the KML below, just nothing happens, whereas the "https://" links just opens fine.

Appreciate any further help!

regards Rainer

rainer0665

Hello Orux,

is there a way to debug what happens if i click on a link in the description of a waypoint (either kml/gpx).

As mentioned in this thread, clicking "http://" or "https://" URLs works fine, but as soon as i try to open a "file:///" URL, just nothing happens :-(. I assume Oruxmaps would get some kind of error from Android to narrow down, what is wrong.

I am just wondering if opening "file:///" URLs in descriptions does not work at all, or if i specify wrong path, wrong number of slashes, ...

Would really be great if "file:///" URLs also would work and if you can describe how they should look like.

That would allow to have nice overview of local tracks on the map (without loading each of them) and then open description and just click the "file:///" URL to open the track of interest directly out of the map.

Really appreciate any pointer on how this could be achieved!

Thanks in advance!

Rainer