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

Add support for tags: author, cmt, link, keywords, copyright, email #18342

Closed
ceever opened this issue Oct 13, 2023 · 20 comments · Fixed by #18812, #19022, #19032 or #19034
Closed

Add support for tags: author, cmt, link, keywords, copyright, email #18342

ceever opened this issue Oct 13, 2023 · 20 comments · Fixed by #18812, #19022, #19032 or #19034
Assignees
Labels
Milestone

Comments

@ceever
Copy link

ceever commented Oct 13, 2023

Description

No matter how I import a gpx file into OsmAnd, I am not able to leverage the or tags if they are present. As far as I understand, OsmAnd even drops this information when importing the GPX.

But url and urlname are part of the standard specification of gpx, so I think they should really be supported natively. And as the user of #14618 wrote: A link "can allow the user to open the link retrieving more information about this point and maybe adding some custom workflow (for example triggering a web page with more information and logic regarding the reached point)"

Steps to reproduce

Create a simple gpx file like this:

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><gpx version="1.1" creator="Mundraub2Use Script" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<name>Rider Houses</name>
<wpt lat="43.94073" lon="141.650913">
<name>Rider House 346</name>
<url>https://www.hatinosu.net/house/archives/346</url>
<urlname>Rider House 346</urlname>
</wpt>
<wpt lat="43.322306" lon="145.632708">
<name>Rider House 349</name>
<url>https://www.hatinosu.net/house/archives/349</url>
<urlname>Rider House 349</urlname>
</wpt>
</gpx>

Import it into OsmAnd and see how url is drop, by opening the imported file. Or put the file into the tracks folder of OsmAnd and see how no url information is available when selection the waypoints in the map.

Actual result

No url anywhere.

Expected result

Somehow the url should be displayed and also not be deleted from the gpx.

Your Environment (required)

OsmAnd Version: 4.5.10
Android/iOS version: 9
Device model: Sansung S8
@DmitryAlexei
Copy link
Contributor

OsmAnd~ 4.6.0#871m, released: 2023-10-13

  • try to import favorites-3.gpx.txt (simply delete .txt extention) as .gpx file
  • open this track (it consists of only one waypoint) and see if url is present in context menu of this waypoint (open track > points tab > waypoint)
video_2023-10-16_16-12-21.mp4

@ceever
Copy link
Author

ceever commented Oct 18, 2023

Thanks for the proposal.

However, this is not what #14618 and I are talking about. Your example is an OsmAnd specific solution using <extension>, which is not helpful when working with other apps and geo tools. We are talking about the standard gpx definition: https://www.topografix.com/gpx_manual.asp that natively should support <url> and <urlname>. But OsmAnd actually seems to actively drop these tags, even though they are defined as standard.

@ceever
Copy link
Author

ceever commented Oct 18, 2023

But, I mean since it is essentially already implemented within <extension> (also works if importing as Favourite), it shouldn't be hard to also include <url> of <gpx> in the option to deliver an url.

Just that weird removal of <url> by OsmAnd should be dropped.

@DmitryAlexei
Copy link
Contributor

@ceever please add a link(s) to documentation
it is not clear, why are you speaking about <url> and not a <link> (or whatever else) tag
what is most common implementation of this feature in other apps? (i.e. which tags other apps support?)

@ceever
Copy link
Author

ceever commented Oct 19, 2023

The link to the mentioned documentation of GPX is in my comment before. They decided for "url" instead of "link", c'est la vie. I mean what does that even matter? Would that impact the impementation in any way, it is just a word?

@DmitryAlexei
Copy link
Contributor

@ceever provided link refers to gpx 1.0 schema, and in the beginning of this document it is stated, that this schema is outdated.
According to OsmAnd technical documentation, it uses gpx 1.1 schema (see https://osmand.net/docs/technical/osmand-file-formats/osmand-gpx)
In gpx 1.1 technical documentation it is proposed to use different tags for urls (see https://www.topografix.com/GPX/1/1/#type_linkType). However, as I know, this solution looks a bit complicated, and it is not commonly used. Custom extensions are used instead.

Screenshot 2023-10-19 141414

@vshcherb vshcherb added the Observed Needs more clarification, feedback, or research label Oct 20, 2023
@ceever
Copy link
Author

ceever commented Nov 2, 2023

I don't think it is very complicated, that's just the way it is documented, which is a little cumbersome, I have to admit. But anyhow.

I mean if one implements support for a certain file format (GPX), one covers the standards of the file format first to be compatible with other applications, right? I mean it's great that there are these numerous OsmAnd extensions (osmand:color ... etc). But of what use are they as soon as I move out of the OsmAnd universe? Unless, of course, you intentionally wanted to produce incompatibilities and lock users in. But why bother using GPX then in the first place?

Wouldn't a proper implementation be to use the existing standards and always fall back onto it if possible, and only if it goes beyond the standard, one relies on the extension part?

@DmitryAlexei
Copy link
Contributor

DmitryAlexei commented Nov 17, 2023

OsmAnd~ 4.6.0#1037m, released: 2023-11-16

Steps to reproduce

  • based on .gpx file provided above, created a file that seems to meet the requirements of the 1.1 GPX standard.
    gpx_with_link.gpx.txt
  • imported this and 8 other variants of that .gpx file into OsmAnd trying to see link in the Track context menu

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<gpx version="1.1" creator="Mundraub2Use Script" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <metadata>
    <link href="https://www.hatinosu.net/house/archives/346">
      <text>Rider House 346</text>
    </link>
  </metadata>
  <wpt lat="43.94073" lon="141.650913">
    <name>Rider House 346</name>
  </wpt>
  <wpt lat="43.322306" lon="145.632708">
    <name>Rider House 349</name>
  </wpt>
</gpx>

Actual result:

  • lthe link is not displayed in the Track context menu (see screenshot)

Expected result:

  • the link is displayed in the Track context menu, when you tap it, you are redirected to the corresponding resource
  • probably it is also possible to copy it to the clipboard

@vshcherb
Copy link
Member

@DmitryAlexei please test original gpx with waypoints extra info this looks as a separate issue

@ceever
Copy link
Author

ceever commented Nov 19, 2023

OsmAnd~ 4.6.0#1037m, released: 2023-11-16

Steps to reproduce

  • based on .gpx file provided above, created a file that seems to meet the requirements of the 1.1 GPX standard.
    gpx_with_link.gpx.txt
  • imported this and 8 other variants of that .gpx file into OsmAnd trying to see link in the Track context menu

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<gpx version="1.1" creator="Mundraub2Use Script" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <metadata>
    <link href="https://www.hatinosu.net/house/archives/346">
      <text>Rider House 346</text>
    </link>
  </metadata>
  <wpt lat="43.94073" lon="141.650913">
    <name>Rider House 346</name>
  </wpt>
  <wpt lat="43.322306" lon="145.632708">
    <name>Rider House 349</name>
  </wpt>
</gpx>

Actual result:

  • lthe link is not displayed in the Track context menu (see screenshot)
**Expected result:**
  • the link is displayed in the Track context menu, when you tap it, you are redirected to the corresponding resource
  • probably it is also possible to copy it to the clipboard

Yes, that's not the issue I am talking about. The link is supposed to be part of the way point ... POIs with websites as addition.

Here the proper example:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<gpx version="1.1" creator="Mundraub2Use Script" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <wpt lat="43.94073" lon="141.650913">
    <name>Rider House 346</name>
    <link href="https://www.hatinosu.net/house/archives/346">
      <text>Rider House 346</text>
    </link>
  </wpt>
  <wpt lat="43.322306" lon="145.632708">
    <name>Rider House 349</name>
    <link href="https://www.hatinosu.net/house/archives/349">
      <text>Rider House 349</text>
    </link>
  </wpt>
</gpx>
</code>

Here the gpx:
gpx_with_POIs_with_link.gpx.txt

@zipav
Copy link

zipav commented Nov 23, 2023

OsmAnd Nightly 4.6.0#1078m, released: 2023-11-22
Nokia 5.3
Android 12

When importing a track using OsmAnd, the import fails, the application freezes. When trying to import using the device file manager, there is no URL in the description.

@zipav
Copy link

zipav commented Nov 23, 2023

OsmAnd Nightly 4.6.0#1078m, released: 2023-11-22

@vshcherb vshcherb added this to the 4.6-android milestone Nov 23, 2023
@vshcherb vshcherb added and-bugs and removed Observed Needs more clarification, feedback, or research labels Nov 23, 2023
@vshcherb
Copy link
Member

To do:

  • Links and all other tags should be displayed in Track Context menu
  • Links and all other tags should be displayed in Waypoint Track Context menu

@Chumva
Copy link
Member

Chumva commented Dec 12, 2023

Do not show bounds

@vshcherb
Copy link
Member

vshcherb commented Dec 12, 2023

Display all that inside that file (name, link, desc, author, copyright, extensions)
gpx_with_link.gpx.zip

@Chumva
Copy link
Member

Chumva commented Jan 23, 2024

file with fixed author and copyright tags - gpx_with_link.zip

@dmpr0 dmpr0 reopened this Jan 30, 2024
@dmpr0
Copy link
Contributor

dmpr0 commented Jan 30, 2024

Review

General

  • Created on, icon – ic_action_date_start
  • Size, icon – ic_sdcard
  • Location, icon – ic_action_folder

Info

<link href="http://docs.osmand.net">
  <text>OsmAnd Documetation</text>
</link>
...
<keywords>gpx, osmand, hiking</keywords>
  • Activity, icon = activity icon
  • Keywords, icon – ic_action_label
  • Link
    • Icon – ic_action_link
    • Color – active
    • Tap should open link in Chrome tabs

Author

<author>
      <name>Author Name</name>
      <email id="your" domain="email.com"/>
      <link href="https://yourwebsite.com" />
</author>
  • Name, icon – ic_action_user
  • Email, icon – ic_action_at_mail
    • Tap should open default mail client
    • Color – active
  • Link
    • Icon – ic_action_link
    • Color – active
    • Tap should open link in Chrome tabs
    • Text is missed? If is present show it instead of link. Tap should work the same

Copyright

<copyright author="OsmAnd B.V">
  <year>2023</year>
  <license>https://github.com/osmandapp/OsmAnd/blob/master/LICENSE</license>
</copyright>
  • Author, icon – ic_action_copyright
  • Year, icon – ic_action_calendar_month
  • License, icon – ic_action_link

Extensions

Example tags
<extensions>
  <osmand:address>Floyd Avenue (The Fan) 907, Richmond</osmand:address>
  <osmand:icon>place_town</osmand:icon>
  <osmand:background>circle</osmand:background>
  <osmand:color>#ff4e4eff</osmand:color>
  <test:country>United States</test:country>
  <test:state>Virginia</test:state>
  <test:telephone>(804) 828-0100</test:telephone>
  <test:postcode>23284</test:postcode>
  <test:start_date>Thursday, June 8, 2023</test:start_date>
</extensions>
Result
  • All tags from <metadata> -> <extensions> should be placed into Additional group
  • Tags are misplaced with values

@dmpr0 dmpr0 changed the title #14618 not solved yet (url and urlname support in gpx) Add support for tags: author, cmt, link, keywords, copyright, email Jan 30, 2024
@dmpr0 dmpr0 reopened this Feb 5, 2024
@dmpr0
Copy link
Contributor

dmpr0 commented Feb 5, 2024

Review 2

Screenshot
  • License should be work as link

Screenshot
  • Display first symbol of custom tag name as uppercase.
    • address > Address
    • icon > Icon

@0xRe1nk0 0xRe1nk0 linked a pull request Feb 6, 2024 that will close this issue
@dmpr0 dmpr0 reopened this Feb 6, 2024
@dmpr0
Copy link
Contributor

dmpr0 commented Feb 6, 2024

Review 3

Copyright

  • Rename Name to Author on UI

@0xRe1nk0 0xRe1nk0 linked a pull request Feb 6, 2024 that will close this issue
@EugeneZmeuk
Copy link
Member

Review 29.03.2024

  • re-write this sections of Track Context menu 1 and 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment