Author Topic: dpi independent map/theme  (Read 4569 times)

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
dpi independent map/theme
« on: July 12, 2015, 12:26:47 »
Is there a way to create a dpi independent map/theme?

The mapsforge-maps in Locus looks different on every device. I can define some dpi dependent scale in the theme (adding dp to the value). It works but it produce an unusable view on higher dpi devices, because the map itself does not scale.

How can I create a theme which looks on every device identical? A have only found a solution which I am not happy with it: Remove all dpi scaling features from the theme and manual configure "Settings > Map - advanced > Change map resolution: Enable; and Set resolution: 2x or higher".
Disadvantage: Manual user task, Bitmap Scaling even for fonts or svg. It looks ugly.

Could the dpi dependent scaling of the whole map added as option to the theme?
Is there a solution where I have not yet discovered?


Some pictures:
160dpi

240dpi


I have tested the line stroke-width with and without dp.
With 160dpi I don't expect any difference. And yes, everything looks fine.
With 240dpi the streets are scaled with the dp parameter. But it look ugly because the map itself isn't scaled. On 320 or 480dpi devices you won't see any details from the round about. I expect a smaller map view/extract. The android and locus Interface are scaled.

Remark: These screenshots have all the same resolution but on a hardware device the 240dpi pictures are much smaller.
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1868
  • Thanked: 10 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: dpi independent map/theme
« Reply #1 on: July 12, 2015, 16:15:38 »
I don´t have a solution, but why do you not set 200 - 240 dpi as reference?
This screenshot is taken from my Note 2 with 267dpi.

Regards J.
 

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
Re: dpi independent map/theme
« Reply #2 on: August 16, 2015, 23:23:16 »
A reference of 200-240 dpi? A simple standard smartphone with 5" and Full HD has 440dpi.
So, a theme must work at 480dpi. But with Locus it does not and I can't optimize a theme for 480dpi.

I made another screenshot to explain the issue:



These screenshots are made with an android emulator and reduced in size by 50%.
The pixels on these pictures have all the same size. On a real 480dpi-device the picture is 3x smaller than on a 160dpi-device.
This require that you draw it 3x bigger so that you're capable to read or recognize something.

Column A: A Theme which does not scale by device density. Simple values or values with "px".
From 160 to 480: The pictures becomes smaller and smaller (on a real device!). You can’t read anything.

Column B: A Theme which does zoom scale elements (lines, symbols, text) by device density. Values with "dp".
From 160 to 480: The text is scaling well, but the streets need too much space, they overlapping. Issue: The areas, the map itself does not scale.

Column C: A Theme which does not scale by device density. Simple values or values with "px". The scaling is manually set to 1x, 1.5x, 2x, or 3x.
From 160 to 480: The pictures have all the same size (on a real device!). Great or not? No, because it must manually set and the map is pixelated. It is not rendered at that resolution.

I expect that Locus will behave like column C automatically and without pixelating.
A normal user does not try to find this option somewhere in the settings and nobody wants to see pixels on his high dpi phone.

 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 378
  • Thanked: 15 times
    • View Profile
  • Device: MotoG
Re: dpi independent map/theme
« Reply #3 on: August 17, 2015, 10:16:53 »
Surely you should zoom in or out accordingly? What happens with your column B images if you zoom in at higher resolution, so the same area of real life is shown on the screen?
 

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
Re: dpi independent map/theme
« Reply #4 on: August 17, 2015, 10:44:02 »
Zooming does not resolve it.

All picuture above are at zooming level 18.
I made a picture with theme B - 480dpi zooming level 19.


The areas are still to small, or the lines to big. Details are lost.

 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1868
  • Thanked: 10 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: dpi independent map/theme
« Reply #5 on: August 19, 2015, 11:41:00 »
Sorry, I can´t follow.
How would you explain the difference between your 240 dpi screenshot in first post and my screenshot in seond post?
Perhaps you can let us test your theme? But I have to say, I don´t have a 480 dpi phone.
Regards J.
 

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
Re: dpi independent map/theme
« Reply #6 on: August 19, 2015, 20:11:50 »
Yes it is not easy to understand the issue when you don't have a 480dpi device. With a 240dpi device you can recognize it, but it will not bother you. On a 480dpi device Locus becomes unusable (not the user interface, only the map).
It is also not easy to explain the issue, because all screenshots in this thread have the same pixel size (your local display define the size). You have to imagine that on a real 480dpi-device the picture is 3x smaller than on a 160dpi-device.

jusc, you asking about the difference between the two screenshots (first & second post):
Your theme is V-Scale2 right? My theme is fzk-outdoor-contrast which I am currently trying to make it more useful with Locus. The unedited version is available on the webpage freizeitkarte-osm.de.
As I have seen, your theme has no density scaling features, so the theme is similar my screenshots on the left side of the first post, or column A of third post. Both themes are unusable at 480dpi. Everything is too small.
The initial size of the street and text are a slightly bigger, but not enough that you can read it at 480dpi. This bigger size of the streets has also a disadvantage, because they overlapping with the buildings. This overlapping gets extreme when you use the density scaling features (right side first post, column B third post).

Get a 480dpi device and try it out. ;)
I hope menion has one.


 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9860
  • Thanked: 43 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: dpi independent map/theme
« Reply #7 on: August 19, 2015, 21:22:49 »
Unfortunately I don't. And this is a problem why I not yet noticed any problems with themes. You (and others with such high DPI devices) will have to wait till Q4 of this year, when I plan to purchase something ...
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 378
  • Thanked: 15 times
    • View Profile
  • Device: MotoG
Re: dpi independent map/theme
« Reply #8 on: August 19, 2015, 22:06:36 »
What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
 

Offline Tobias

  • More than Newbie
  • *
  • Posts: 72
  • Thanked: 1 times
    • View Profile
    • Elevate themes
Re: dpi independent map/theme
« Reply #9 on: August 19, 2015, 22:40:27 »
What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
Same as in column B. Everything with dp gets scaled, but not the tile size which is fixed at 256px. The problem is that lines are getting thicker, but areas stay the same (and are disappearing with too much scaling).

There's two solutions:

- scale tile size with dpi (as mapsforge did starting with 0.4, 256px for 160dpi, 512px for 320dpi etc.), not implemented in Locus (and most other apps)

- use different zoom levels for comparison (e.g. one tile at ZL15 at 160dpi=256px is equal to four tiles at ZL16 at 320dpi=512px) and adapt you theme files accordingly, e.g. extra files for different dpi (disadvantage: zoom-min/max in theme files have also to be adjusted for real conversion, and zoom-appear in map files can't be adjusted)
 

Offline fzk

  • Apprentice of Locus
  • **
  • Posts: 238
    • View Profile
    • http://freizeitkarte-osm.de/de/index.html
Re: dpi independent map/theme
« Reply #10 on: August 20, 2015, 21:36:30 »
Unfortunately I don't. And this is a problem why I not yet noticed any problems with themes. You (and others with such high DPI devices) will have to wait till Q4 of this year, when I plan to purchase something ...
Mapsforge 0.5 has already implemented a dpi dependent scaling feature. But I have learned from another thread that this isn't an option for Locus. So I wonder what you intend to buy and how will this solve the problem?

Klaus
 

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
Re: dpi independent map/theme
« Reply #11 on: August 20, 2015, 22:38:00 »
Klaus, I don’t think that you motivate menion to solve the problem when you point to mapsforge.

...I hope he gets his new toy long before Christmas. ;D
 

Offline jusc

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1868
  • Thanked: 10 times
    • View Profile
  • Device: Samsung Galaxy S2 and Note 2
Re: dpi independent map/theme
« Reply #12 on: August 22, 2015, 11:07:44 »
Get a 480dpi device and try it out. ;)

Only to get some strange looking maps?  ;D
But what about Johns question: "What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?"
Can you show us some screenshots with his theme too, please? I don´t have this possibility.
Regards J.
 

Offline SwissPoPo

  • More than Newbie
  • *
  • Posts: 17
    • View Profile
Re: dpi independent map/theme
« Reply #13 on: August 24, 2015, 20:43:42 »
You not only get strange looking maps, you also get a very powerful phone. ;) Since over two years most flagship phones have a display density of 400 and above.

Johns question was already answered by Tobias, it looks the same as in column B (Post #3). "dp" in the theme only scales the lines, text, and icons but not the map itself (areas/buildings).
Here a screenshot at 480dpi Zoom 18 (file reduced by 50%).


You can test with the free Goggle Android Emulator (part of AndroidStudio). There also exists more comfortable emulators from others.
 

Offline Viajero Perdido

  • More than Newbie
  • *
  • Posts: 20
  • Thanked: 2 times
    • View Profile
  • Device: Nexus 5 & 7 (2013), both Android 6.
Re: dpi independent map/theme
« Reply #14 on: September 02, 2015, 04:06:43 »
What happens with a scalable theme like my Voluntary UK, where everything is defined in terms of dp?
Everything is readable!

I can finally turn off the "Change map resolution" feature (which magnifies the display by some factor), and still have very readable vector maps.  The only trouble is, with that setting off, the *online* tiled maps now look unusable.  So it's a hassle to switch between online and offline, because offline maps (with Voluntary UK) handle the high DPI, but online ones don't, and to switch I need to keep toggling the change-resolution setting.  So I mostly just stay in offline mode with Voluntary UK, or rather, my derivative version.

As a bonus, when you zoom right in, hard-to-see things like POI icons get bigger, exactly as you'd expect.

This is with a Nexus 5 with crazy-high DPI.  (Which, combined with Locus, beats the pants off a Garmin in every way.)
« Last Edit: September 02, 2015, 04:10:52 by Viajero Perdido »