alguien si es tan amable podria traducir bien esto!? sacado foro del trekbuddy. Es la forma de crear los mapas !!! que tanats veces e pedio
Howto create a map1. Get a calibrated map, or scan it and calibrate yourself, using a program like OziExplorer or MapCalibrator.
4 calibration points near the map corners are good enough. Be sure to select proper map datum and projection. I recommend OziExplorer if you are serious about maps.
WARNING! MapCalibrator seems to
move calibration points sometimes, check their positions when you think
you are done, and correct if necessary (right-click,
Calibration->Fine Calibration->Drag It!).
You may also find some handy map tools in Tools forum.
Now you need to cut the map to slices, with top-left corner pixel coordinates encoded in the filename, like my_map_240_960.png
(note the undercores before x-y coordinates). I use slices of 300x400
and 256x256 pixels; you may use smaller or bigger, however smaller may
be less comfortable due to more frequent slice loading, larger may
cause OutOfMemoryErrors depending on how much memory your device has
for MIDlets; feel free to experiment... and share your findigs with
others
If you have your favourite application for such task, skip to step 2d.2. Create map tiles and their listing. If you are
on Windows, I recommend using Duffa's excellent TB Cutter application and then skip to
3. If you are on Linux, or a masochist, go through
2a-d.
a) Install GIMP2
b) Download skript for GIMP by Petr Krejčí for map cutting and copy it to GIMP
share\gimp\2.0\scripts directory.
NEW! Optimized version available in Tools forumc) Start GIMP and open the map. In the main window in
Scripts-Fu menu you should have
OT2gps item. Click on it, set 240x320 or 300x400 slice dimension, 256 colors and run it. The script will create map slices named
xxx_240_960.png int the same directory where the original map is. It may take a few minutes...
d) Prepare map directory. In the same place you have the calibration file (the one with
.map or
.gmi extension), create
set directory and copy all map slices to it.
The map directory then looks like this:
18_Prague_north.map
set/
set/18_0_0.png
set/18_240_0.png
set/18_480_0.png
set/...
* Directory listing may be very slow on real devices. You may get
significant speedup for map loading if you create a listing of map
slices in advance. The listing file must have the same name as
calibration file, with extension
.set and be in the same directory.
So for the example above, you can easily create the listing this way:
Code: |
dir /b set > 18_Prague_north.set (on Linux: ls set > 18_Prague_north.set) |
The listing file content is simple:
18_0_0.png
18_0_1280.png
18_0_1600.png
...
So the complete example directory looks like:
18_Prague_north.map18_Prague_north.setset/
set/18_0_0.png
set/18_240_0.png
set/18_480_0.png
set/...
3. Copy the map (output) directory to the memory card.
So much for a single map.
Howto create an atlasAtlas is a multidimensional maps collection. Maps of the same scale,
usually covering a continuous area (this is not a condition, but it
makes sense), are grouped in something I call a
layer. And there may be more layers in an
atlas.
Atlas directory structure sample:
atlas-cr/
atlas-cr/
cr.tbaatlas-cr/
roadmap/
atlas-cr/
roadmap/24/
atlas-cr/
roadmap/24/P24_ozf.map
atlas-cr/
roadmap/24/P24_ozf.set
atlas-cr/
roadmap/24/set/
atlas-cr/
roadmap/24/set/24_0_0.png
atlas-cr/
roadmap/24/set/24_0_320.png
atlas-cr/
roadmap/24/set/...
atlas-cr/
roadmap/25/
atlas-cr/
roadmap/25/P25_ozf.map
atlas-cr/
roadmap/25/P25_ozf.set
atlas-cr/
roadmap/25/set/
atlas-cr/
roadmap/25/set/25_0_0.png
atlas-cr/
roadmap/25/set/25_0_320.png
atlas-cr/
roadmap/25/set/...
atlas-cr/
hikingmap/
atlas-cr/
hikingmap/18_Prague_north/
atlas-cr/
hikingmap/18_Prague_north/18_Prague_north.map
atlas-cr/
hikingmap/18_Prague_north/18_Prague_north.set
atlas-cr/
hikingmap/18_Prague_north/set/
atlas-cr/
hikingmap/18_Prague_north/set/18_0_0.png
atlas-cr/
hikingmap/18_Prague_north/set/...
atlas-cr/
hikingmap/19_Prague_south/
atlas-cr/
hikingmap/19_Prague_south/19_Prague_south.map
atlas-cr/
hikingmap/19_Prague_south/19_Prague_south.set
atlas-cr/
hikingmap/19_Prague_south/set/
atlas-cr/
hikingmap/19_Prague_south/set/19_0_0.png
atlas-cr/
hikingmap/19_Prague_south/set/...
You can see that
24,
25,
18_Prague_north and
19_Prague_south are normal maps as described in previous chapter, groupped in 2 layers - one is a collection of hiking maps
hikingmap (1:50000), another is
roadmap (1:200000).
File cr
.tba is a text file with single line:
Now all you have to do is copy this directory tree to the phone, select
Load Atlas in the
Options menu, and in file browser select this cr
.tba file. You can switch layers with
7, maps with
9 key.
Note: To speed up non-packed atlas
loading or rather to overcome "java.io.IOException: Too many
FileConnection.list enums" error, you can create master index file for
the atlas the same way as you would do it for packed atlas (see bellow)
- just give the resulting file .idx extension instead of .tar extension and load this .idx file instead of .tba.Atlas example (11 MB!) - unpack it and copy to the phone's memory card.
***
Sometimes,
due to a device limitations and/or bugs, or ineffectivity of memory
card filesystem, having a map/atlas in a single file may become a
better solution.***
Howto create a packed mapYou need a
tar utility. For Windows version of
tar, google for "unixtutils".
To pack the calibration file and map slices to a tar archive, do:
Code: |
tar -cf 18_Prague_north.tar 18_Prague_north.map set |
Order of command line parameters is important for performance - you are advised to put the calibration file before set directory!Then copy the archive to your phone's memory card.
Packed map example 990kB (page 47 from Czech Republic road map).
Howto create a packed atlas1. Create "index" file of the whole atlas, using tar (let's assume you are in the main
atlas-cr atlas directory from the previous example):
Code: |
tar -cf cr.tar --exclude=*.png cr.tba hikingmap roadmap |
The result of this is cr
.tar file, which contains (verify with
tar -tf cr.tar):
cr.tba
roadmap/
roadmap/24/
roadmap/24/P24_ozf.map
roadmap/24/set/
roadmap/25/
roadmap/25/P25_ozf.map
roadmap/25/set/
hikingmap/
hikingmap/18_Prague_north/
hikingmap/18_Prague_north/18_Prague_north.map
hikingmap/18_Prague_north/set/
hikingmap/19_Prague_south/
hikingmap/19_Prague_south/19_Prague_south.map
hikingmap/19_Prague_south/set/
You can see here that the cr
.tar contains all calibration files from the whole atlas, with preserved directory structure, and the
.tba file too.
2. Now, pack each map in all layers the same way as a single map described above. So assuming you are in
atlas-cr/hikingmap/18_Prague_north directory, run
Code: |
tar -cf 18_Prague_north.tar 18_Prague_north.map set |
Then you may delete (or better - backup somewhere else) maps slices and
calibration files. The atlas directory structure then looks like:
atlas-cr/
atlas-cr/
cr.tar atlas-cr/
roadmap/
atlas-cr/
roadmap/24/24.tar
atlas-cr/
roadmap/25/25.tar
atlas-cr/
hikingmap/
atlas-cr/
hikingmap/18_Prague_north/18_Prague_north.tar
atlas-cr/
hikingmap/19_Prague_south/19_Prague_south.tar
The name of the map pack (eg.
18_Prague_north.tar) must be the same as the name of the map directory (ie.
18_Prague_north)!
Now all you have to do is copy this directory tree to the phone,
select Load Atlas in the Options menu, and in file browser select this
cr.tar file.
Packed atlas example - unpack it and copy to the phone's memory card.
---END