Menu

#20 TwoNav rmap file format support

Enhancement
closed
r_x
5
2012-09-18
2010-11-10
Luka
No

Hi,

I am attaching a mobac.program.atlascreators.TwoNavRmap.java class that adds support for TwoNav rmap file format.

Discussion

  • r_x

    r_x - 2010-11-10

    Looks nice - I imported it into the project SVN and optimized the usage of the ConvertedRawTileProvider a bit (custom image output format is now supported a slong as you only select JPEG formats).

    However executing my default unit test for AtlasCreator implementations (see src/test/java/unittests/AtlasDownloadTestCase.java in SVN) this one fails with a MapCreationException: zoomLevel not found.

    The current version can be found here: https://trekbuddyatlasc.svn.sourceforge.net/svnroot/trekbuddyatlasc/trunk/MOBAC/src/main/java/mobac/program/atlascreators/TwoNavRmap.java

    Please review it an try to fix this bug.

     
  • Luka

    Luka - 2010-11-11

    Well, this was not (only) a bug but also a limitation of a rmap format.

    rmap file (as I have figured it out - it is a proprietary format) is basically
    a series of (tiled, 256x256 pixels) maps (from the largest one, to the smallest one),
    where each next map is previous map shrunk to half.
    Every map has to have the same extent in geographic coordinates,
    but of course different size in pixels.

    So in order to make a rmap file you have to select maps that have the same
    geographical boundaries - this is why your test atlas failed
    (there were some other minor glitches that I have also fixed)

    The easiest/best way is to select a fixed grid zoom (for example 6),
    select zoom levels 6 and above (not below) and add this to atlas content.

    So you end up with an atlas with a single layer and several maps

    Unnamed atlas
    Layer name
    map 06 - 2x1 tile, 512x256 pixels
    map 07 - 4x2 tile, 1024x512 pixels
    map 08 - 8x4 tile, 2048x1024 pixels
    map 09 - 16x8 tile, 4096x2048 pixels

    each map covering the same area. To complicate things further, the smallest
    map has to have only 1 tile - the height AND width less than 256, so in addition to
    downloaded maps/tiles above, one (or several) maps are created by (bicubic)
    shrinking the downloaded ones to make further 256x128 and 128x64 maps.

    This also means, that if a user selects only 1 relatively large map, it will be
    downloaded, but all the remaining smaller maps (since in rmap there have to be)
    will be made by shrinking this map by half and than by half again till you reach 1 tile,
    which can take a long time.

    I have modified the TwoNavRmap class a bit, added some more tests to testAtlas()
    function, to make error descriptions more clear and to try to warn users in
    cases of "invalid" input.

    I have replaced the attached file with a new, fixed one...

     
  • Luka

    Luka - 2010-11-11
     
  • Luka

    Luka - 2010-11-12

    README.HTM with info about TwoNav rmap added

     
  • Luka

    Luka - 2010-11-12

    Patch to fix a typo error (JPG instead of PNG)

     
  • Luka

    Luka - 2010-11-12

    I have uploaded a modified README.HTM and also a patch that fixes a small (but significant) typo error.

     
  • r_x

    r_x - 2010-11-12

    Thanks - looks we have finally completed this atlas format.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.