Line width in GPX export

Started by ThomasDaheim, August 04, 2020, 20:55:47

0 Members and 2 Guests are viewing this topic.

ThomasDaheim

Hi,

first of all thanks for a great app! I have been using it for a while now and it works like a charme.

When exporting a track as gpx I have run into the following: It contains the gpx extension like


<line xmlns="http://www.topografix.com/GPX/gpx_style/0/2">
<color>483D8B</color>
<opacity>0.59</opacity>
<width>6.0</width>
<lineCap>square</lineCap>
<extensions>
<locus:lsColorBase>#96483D8B</locus:lsColorBase>
<locus:lsWidth>6.0</locus:lsWidth>
<locus:lsUnits>PIXELS</locus:lsUnits>
</extensions>
</line>


According to the definition of the line attributes (http://www.topografix.com/GPX/gpx_style/0/2) now the unit of the width is "Width, in millimeters, of the line".

But obviously it should be pixel, since the locus:lsUnits says so.

When opening this track in another viewer the track is drawn 6 millimeters wide...

Anything I can do here to avoid that?

Thanks,
Thomas
  •  

Menion

Hello Thomas,
interesting problem. What do you suggest here? On Android, there is nothing like "millimeters" and I'm surprised that such weird definition is in GPX. I'm trying to find out, if there is a method on how to get correct real physical device size, and can't find anything useful.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

0709

#2
@ThomasDaheim.

Quote from: ThomasDaheim on August 04, 2020, 20:55:47When opening this track in another viewer the track is drawn 6 millimeters wide...

Wich another viewer are you referring too that does diplay this as 6mm wide ? I have not seen a single one.
Also gps visualizer (? help) is referencing to px line width. In kml px is also in use.

@Menion.
How wide is a px than supposed to be ?

@all
Anyone here who can possibly explain what exactly this px width reference than means ? 
What relation does the screen ppi (small pixels) have to do with the px line width unity ?

Is there such a standard anyware official ?   
https://www.unitconverters.net/typography/pixel-x-to-millimeter.htm
Based on 96 ppi ?

Locus Pro Classic 3.70.15 - Locus map 4.27.1
  •  

Menion

More precisely, width in Locus Map is used not directly in pixels but in pixels * device DPI. DPI unit is constant which helps making all lines identical in width no matter on which device are you using it.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  
    The following users thanked this post: 0709

0709

#4
PIXELS px ? Or better dp ?

I still know of no app that uses mm width inclusive Locus map.
It should be better to add this extra info in the Locus manual.

Devs prefer the Google dp unity as in kml.
Device independent pixel, which is a 'virtual'pixel.
Based on one pixel at a 160 ppi display.
One 1 dp so equals 1/160 of inch or 0.15875 mm.

References:
https://stackoverflow.com/a/43425783
https://medium.com/huawei-developers/working-with-different-pixel-densities-in-android-6dd6b348f9c7
Locus Pro Classic 3.70.15 - Locus map 4.27.1
  •  

Menion

Ah, nice description! Exactly these values app natively use! Thanks to this, width defined as "5", looks almost identical on all devices (small/big phones, tablets, tv, etc.) where you get track over GPX, over app sync etc.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •