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.
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
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...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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...
I improved your version to write one RMAP file per layer - therefore multiple layers are now possible.
Latest version:
https://trekbuddyatlasc.svn.sourceforge.net/svnroot/trekbuddyatlasc/trunk/MOBAC/src/main/java/mobac/program/atlascreators/TwoNavRmap.java
Could you please provide a section for README.HTM explaining everything a user has to know when using this atlas format?
README.HTM with info about TwoNav rmap added
Patch to fix a typo error (JPG instead of PNG)
I have uploaded a modified README.HTM and also a patch that fixes a small (but significant) typo error.
Thanks - looks we have finally completed this atlas format.