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

Don't fill in empty KML <name>s for the user #90

Closed
jidanni opened this issue Apr 19, 2020 · 3 comments
Closed

Don't fill in empty KML <name>s for the user #90

jidanni opened this issue Apr 19, 2020 · 3 comments

Comments

@jidanni
Copy link
Contributor

jidanni commented Apr 19, 2020

Using File > Append File, with this KML:

<Placemark>
  <name/>
  <description>G8348DD38 水泥桿</description>
  <Point>
    <coordinates>120.877622,24.172929</coordinates>
  </Point>
</Placemark>

viking notices the user has 'surely forgotten" to name his Placemark,
and then helpfully lets the <description> do double duty as the <name>.

Alas, this excludes the case where the user really wants to not have a
name placed on the map!

Indeed, illegally using <description> for <name> with no workaround...

Here if <name> is empty, Viking does not correctly just not display a
name, It instead just assumes that the user for some reason wants the
<description> to be used as the name. Sure we can put one SPACE in <name> </name> but boy does that sure look ugly when viewed.
(Anyway, there is no way to let only the nodes with non-empty <name> tags
to get named: if we just do

$ viking file.kml

all nodes are just dots, including those with names.)

(I'm guessing that an empty or even missing <name> is valid KML.)

@jidanni
Copy link
Contributor Author

jidanni commented Apr 19, 2020

P.S., one also notes Properties' Comment is "helpfully" cloned from the Description. But that is another issue...

@rnorris
Copy link
Collaborator

rnorris commented May 10, 2020

Viking uses GPSBabel to convert .kml files into something that it can understand (a temporary GPX format).
The name (and comment) being derived from the description is an artfect of using GPSBabel.
So fixing it fully requires either reporting it to GPSBabel or writing ones own KML parser (and determing what elements to support - no easy task - I briefly considered it when adding the read TCX implementation recently but decided it wasn't straight-forward enough to add. I'll have another think about this).

Using GPSBabel was very much an expedient measure to off load that hard work and more convenient in being in the normal open dialog. Rather than as part of the generic GPSBabel import method - File->Acquire->Import File With GPSBabel...

Secondary on the empty/missing names issue, Viking itself would generate names even if GPSBabel didn't create them.

However it seems like you want to control the view on the map/viewport to display the Waypoint name, seperately from the dot/symbol.

ATM Viking has the 'visible' checkbox on the treeview in the left hand side - but this would remove the dot/symbol from the viewport too. There is an overall TrackWaypoint layer property -> Waypoints -> Draw Labels, but that applies to all waypoints, whereas I think you would like a 'draw label' property for each waypoint individually. Defaulting to on, this draw label could be turned off when the originating name is missing/empty (may be a configuration setting)

@rnorris
Copy link
Collaborator

rnorris commented Jun 26, 2020

Viking now has a native KML parser.

A general facility to hide display of individual waypoint names has also been added.
So now when loading KML files for empty or missing placemark names, it should default to making the (auto generated) name hidden.
NB It still requires a name for each item - as displayed on the left hand panel.

@rnorris rnorris closed this as completed Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants