Zoom levels in style file

2012-07-24
2013-05-29
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    I don't quite understand what the idea is with current zoom levels - if I zoom the map so that more than half of Finland shows on a 1340 x 970 display, there's practically nothing useful on the map except biggest city names: just country borders, some administrative borders and sea coast, even with the maximum "show ways early" settings.

    I would expect that even with the "show ways early" setting at its lowest, there would at least the primary road & rail networks visible at country level or when ca. half the country is showing.

    Any objections to changing primary & rail zoom levels so this would happen? Is there some logic with the current levels I'm overlooking?

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    Overlooked the motorways - perhaps it's just that in countries with a far-reaching motorway network the map is populated with that, and primaries would bring too much data?

    Testing with the changes below against the current git.

    -- a/Osm2GpsMid/resources/style-file.xml
    +++ b/Osm2GpsMid/resources/style-file.xml
    @@ -92,7 +92,7 @@ scale alias 1: zoomed out 21x
                    <description desc = "Town"/>
                    <searchIcon src="city.png"/>
                    <namekey tag="name"/>
    -               <scale scale = "15"/>
    +               <scale scale = "10"/>
                    <hideable hideable="false"/>
              </value>
              <value name="village">
    @@ -1234,7 +1234,7 @@ in the main index as well as in housenumber index.
                                    <namekey tag = "name"/>
                                    <namefallback tag = "ref"/>
                                    <isArea area = "false"/>
    -                               <scale scale = "12"/>
    +                               <scale scale = "7"/>
                                    <lineColor color = "00FF7375" colorAtNight="00C4BD00"/>
                                    <wayWidth width="6" />
                                    <routing with="motorcar" accessible="true" speed="80" />
    @@ -1598,7 +1598,7 @@ in the main index as well as in housenumber index.
                                    <description desc = "mainline rail"/>
                                    <namekey tag = "name"/>                                
                                    <isArea area = "false"/>
    -                               <scale scale = "12"/>
    +                               <scale scale = "9"/>
                                    <lineColor color = "00000000" colorAtNight="004E5B50" />
                                    <borderColor color="00000000" colorAtNight="004E5B50" />
                                    <wayWidth width="2" />

     
  • sk750
    sk750
    2012-07-24

    Zoom levels in style-file are related to tile levels.

    My idea of this is to have only very few map data in tile level 0 because when zooming far out the mobile will have to load and keep all of this data into memory. Therefore with commit http://gpsmid.git.sourceforge.net/git/gitweb.cgi?p=gpsmid/GpsMid;a=commitdiff;h=61283db87a3c0cf50c9f60efac5822595e9c881f I've moved secondary roads out of tile level 0 as those burden lots of data to tile level 0.

    With commit http://gpsmid.git.sourceforge.net/git/gitweb.cgi?p=gpsmid/GpsMid;a=commitdiff;h=53ed37e421a465dc4779a8332315e659d315d2c9 you moved secondary roads back into tile level 0 (which starts at zoom level 16). While I understand your intention to show secondary roads at the next zoom level, because of the tile level 0 burden would you mind reverting this part of the commit?

    Also when changing primary roads from zoom level 14 to 12 it would make sense to adjust the zoom level for trunks which are even bigger roads as well.

    Regarding the towns and city I orientated at the bayern.osm.pbf map data, changing zoom levels for towns as suggested will probably cause lots of texts overlapping when zooming out.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    "With commit http://gpsmid.git.sourceforge.net/git/gitweb.cgi?p=gpsmid/GpsMid;a=commitdiff;h=53ed37e421a465dc4779a8332315e659d315d2c9 you moved secondary roads back into tile level 0 (which starts at zoom level 16). While I understand your intention to show secondary roads at the next zoom level, because of the tile level 0 burden would you mind reverting this part of the commit?"

    OK, I thought there might be something related to the tile level balancing and thus brought it up - reverted the change to secondaries, changed trunk.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    For Finland, towns at scale 10 works quite nicely at the outmost zoom town names will show at, with default show POIs early. Even with max show POIs early, most town names look OK, and map feels much nicer than with the current style file.

    As good values for the town zoom (and probably some other map object types) obviously depends on how big the distances between each is, would be good to have something smarter than a user-set fixed value to determine the zoom level for towns.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    Hmm - the secondary roads do show up very late, will require too much zooming in to be practical for map browsing (to have a look at the roads), even with the highest value for show ways early.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    I like WAY_RATHER_BIG, though for Finland it seems e.g. 5000 would work much nicer as the limit than 500.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    .. though 5000 is a bit much for the closest zoom level of tile level 0, would be better to use a smaller limit for that (two steps).

     
  • sk750
    sk750
    2012-07-24

    feel free to introduce WAY_REALLY_BIG ;)

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    "As good values for the town zoom (and probably some other map object types) obviously depends on how big the distances  between each is, would be good to have something smarter than a user-set fixed value to determine the zoom level for towns."

    Come to think of it, it's quite complicated for the user to even set scale manually - he'll have to specify a different style-file, edit the style-file, keep it up-to-date against GpsMid distribution version etc.

    For the minimal kind of practical country-level manual tweaking of zoom levels, would make sense to have a .properties override possibility for scale. E.g.:

    scale.place/town = 10
    scale.highway/secondary = 13

     
  • sk750
    sk750
    2012-07-24

    Good idea. Wonder if we should have something like ignore.building as well ;)

    On the other hand - not very userfriendly e.g. for users of Osm2GpsMid Gui.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    Nah, 5000 is not yet really big, not even close. If a dimension is more than 100 km, then we can call the lake relatively big.

     
  • sk750
    sk750
    2012-07-24

    That's not really big, that's rather huge.

     
  • sk750
    sk750
    2012-07-24

    > Hmm - the secondary roads do show up very late, will require too much zooming in to be practical for map browsing (to have a look at the roads), even with the highest value for show ways early.

    We could decrease <tileScaleLevel level="1" minScale ="17" /> and also scale for secondary roads in style-file accordingly, so they will show up earlier without being in tile level 0, however this would lead to tile dropping for level 0 happening later (e.g. at tile level 15) thus e.g. being tile level 16 much less performant :-/

    Other options would be introducing an additional tile level or allowing tile level 3 for routable ways again and distributing ways differently. Both of those have disadvantages.

    Therefore I currently don't see a really good solution for this. :-/

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    "On the other hand - not very userfriendly e.g. for users of Osm2GpsMid Gui."

    True. One possibility for improvement in that field would be to bundle a collection of country-specific .properties files (created and used already for prebuilt midlets) with Osm2GpsMid. Then use the selected country-specific .properties file as a base for creating the map, modifying them with user choices in the GUI.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-24

    Then again, if there are other things to change besides scale (and there probably will be, you already mentioned ignoring objects), there will be growing complexity in creating a config language / methodology for .properties to overriding values of the XML file.

    As we already have an XML parser, perhaps if it would to possible read a country-specific XML file which would only override the needed entries and leave others be. Hmm, probably not, as that wouldn't be conformant to the DTD.

     
  • sk750
    sk750
    2012-07-25

    Regarding not rendering smallish areas when zoomed out:

    I'll shortly commit a new style-file parameter to attract areas depending on their diameter into higher tile levels. Therefore when zooming far out even less data will have to be loaded because e.g. all those small waters are stored in more appropriate tile levels.

    Current parameters are:
    <tileScaleLevel level="3" minScale ="21" allowedForRoutableWays = "false" attractAreasWithSmallerBoundsDiameterThan = "50" />
    <tileScaleLevel level="2" minScale ="19" attractAreasWithSmallerBoundsDiameterThan = "150"/>
    <tileScaleLevel level="1" minScale ="17" attractAreasWithSmallerBoundsDiameterThan = "500" />

    With this tile level distribution changed in my test midlet from

    Tile Level 0: 12 MB
    Tile Level 1: 93 MB
    Tile Level 2: 265 MB
    Tile Level 3: 186 MB
    at commit http://gpsmid.git.sourceforge.net/git/gitweb.cgi?p=gpsmid/GpsMid;a=commitdiff;h=c5eb6cfbfeac6f6246f0dcf916dcd7e619386265

    to

    Tile Level 0: 7 MB
    Tile Level 1: 91 MB
    Tile Level 2: 265 MB
    Tile Level 3: 193 MB

    So WAY_RATHER_BIG should be no more triggered and probably can be removed again.

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-25

    WAY_EVEN_BIGGER is still quite useful for the performance browsing of the Finnish map at outer zooms.

     
  • sk750
    sk750
    2012-07-25

    Sure, but will need a new name when we drop WAY_RATHER_BIG ;-)

     
  • Jyrki Kuoppala
    Jyrki Kuoppala
    2012-07-25

    For Finland, map creation (towns scale changed, otherwise the default style file) outputs:

      Zoomlevel 0: 127 MB in 3542 files indexed by 609 dictionary files
      Zoomlevel 1: 141 MB in 3393 files indexed by 585 dictionary files
      Zoomlevel 2: 100 MB in 5234 files indexed by 790 dictionary files
      Zoomlevel 3: 32 MB in 3112 files indexed by 388 dictionary files
      197 MB for nodes in 6495 files, 512 MB for connections in 6495 files

    disk usage from unzipped jars:

    % du -h t?
    46M     t0
    46M     t1
    66M     t2
    34M     t3
    26M     t4

     
  • sk750
    sk750
    2012-07-25

    Would be interesting if it makes any difference e.g. in midlet startup time if you set maxDictDepth to e.g. 2.5.

    However, seems the output values are wrong, actually my test midlet has about 2,5 MB in tile level 0 while Osm2GpsMid's output was 7 MB.

     
  • sk750
    sk750
    2012-07-25

    Would be interesting if it makes any difference e.g. in midlet startup time if you set maxDictDepth to e.g. 25.

    However, seems the output values are wrong, actually my test midlet has about 2,5 MB in tile level 0 while Osm2GpsMid's output was 7 MB.

     
  • sk750
    sk750
    2012-07-25

    Changed towns to show 2 scale levels earlier (tested in Bavaria, mostly ok, with no show POIs earlier).