icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • bluetooth / serial / internal GPS, simulator
  • offline raster maps (common grids and projections)
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • ... and more
  • MIDP and Symbian phones
  • Blackberry
  • Android
  • Windows Mobile 5.x/6.x
  • Windows Phone Store  (FAQ)
Visit our wiki to see all features, guides and howtos. Project tracker.

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/╚esky)(╚esky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
HOWTO Maps and Atlases
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    TrekBuddy Forum Index -> English
View previous topic :: View next topic  
Author Message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5401

PostPosted: Tue Jul 25, 2006 4:13 pm    Post subject: HOWTO Maps and Atlases Reply with quote

Howto create a map

1. 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. Wink

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 Smile

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 forum

c) 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.map
18_Prague_north.set
set/
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 atlas

!!!! "cr" stands for Czech Republic in this example. It is not mandatory name of the atlas index nor meta file!!!! I mean, if I were creating atlas for, let's say Portugal, I would use "pt" instead.


Atlas 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.tba
atlas-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:

Code:
Atlas 1.0


Only the extension (.tba) is important, basename can be anything you like. Example: for an atlas of city of London atlas, london.tba make a lot of sense, for the whole Portugal contry pt.tba or portugal.tba etc.

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 map

You 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 atlas

1. 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


Last edited by kruch on Wed Feb 06, 2013 1:17 pm; edited 37 times in total
Back to top
View user's profile Send private message
ylazarev
Guest





PostPosted: Mon Sep 04, 2006 6:57 am    Post subject: Map in ogf2 format Reply with quote

Hi!
I discovered this app recently and think its great that it uses offline maps
that you can import by yourself.
I have maps in ogf2 format that come with a .map file I would like to
import, is there a way I can do that?

Thanks in advance, Yigal.
Back to top
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5401

PostPosted: Mon Sep 04, 2006 6:55 pm    Post subject: Re: Map in ogf2 format Reply with quote

ylazarev wrote:
Hi!
I have maps in ogf2 format that come with a .map file I would like to
import, is there a way I can do that?

Thanks in advance, Yigal.


I suppose .map file is Ozi calibration (is the first line "OziExplorer Map Data File Version ..."?) and .ogf2 is a proprietary image format of SmartComGPS/MapViewGPS?
If so, you only need to convert the .ogf2 format to .png (the only format a J2ME application can display), and then follow the HOWTO here. I can see there's a converter from/to OGF2 available for download at http://www.wild-mobile.ru.

Regards,
k.
Back to top
View user's profile Send private message
ylazarev
Guest





PostPosted: Tue Sep 05, 2006 5:34 am    Post subject: Thanks Reply with quote

Found the converter, and extracted .png files, thank you Very Happy .
Back to top
mac-es



Joined: 14 Sep 2006
Posts: 2

PostPosted: Thu Sep 14, 2006 8:30 am    Post subject: Reply with quote

I installed Trekbuddy on a Siemens SXG75 and created a map with both the .tar and the .set method.

When trying to load this map I get the following error: "java.lang.StringIndexOutofBoundsException: String index out of range: -1"

What's the problem?

Thanks,

Chris.
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5401

PostPosted: Thu Sep 14, 2006 9:22 am    Post subject: Reply with quote

mac-es wrote:
I installed Trekbuddy on a Siemens SXG75 and created a map with both the .tar and the .set method.

When trying to load this map I get the following error: "java.lang.StringIndexOutofBoundsException: String index out of range: -1"

What's the problem?

Thanks,

Chris.


Please hold on, I'm working on this file I/O issue on SXG75...

Thanks, k.
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Sep 14, 2006 11:36 am    Post subject: Reply with quote

[quotePlease hold on, I'm working on this file I/O issue on SXG75...

Thanks, k.[/quote]

Thanks for your effort! Really looking forward...
Back to top
ed



Joined: 18 Sep 2006
Posts: 7

PostPosted: Tue Sep 19, 2006 8:09 pm    Post subject: United Kingdom Ordnance Survey maps Reply with quote

If you want maps of Great Britain or Northern Ireland, look no further than here, where you'll find superb Ordnance Survey maps at scales including 1:25000, 1:50000, 1:250000, and >250000.

(Don't use the "Print/Save/Copy" link on that page; just zoom in to the part you want, right-click on the image and save it -- it's 400x400 pixels, ideal for use as a tile in a larger map).

Calibrating these maps is straightforward: convert from OS grid references to WGS84 Lat/Long coordinates using the online coordinate converter here. (It's easiest if you align the OS grid lines with the corners of the map image tile).

-ed
Back to top
View user's profile Send private message
ed



Joined: 18 Sep 2006
Posts: 7

PostPosted: Tue Sep 19, 2006 8:15 pm    Post subject: Swiss national map coordinates Reply with quote

I haven't found large-scale maps of Switzerland online (I'd like to though) but here is a converter to convert between Swiss grid references and WGS84 Lat/Long coordinates.

-ed
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5401

PostPosted: Wed Sep 20, 2006 6:47 am    Post subject: Reply with quote

Do you happen to know Swiss grid parameters (reference ellipsoid, and dx/dy/dz to WGS-84)?

And which variant of OS is commonly used? There are about 5 variants Sad

Ordnance Survey Great Britain 1936 Airy 1830 371 -112 434 England
Ordnance Survey Great Britain 1936 Airy 1830 371 -111 434 England; Isle of Man; Wales
Ordnance Survey Great Britain 1936 Airy 1830 375 -111 431 MEAN FOR England; Isle of Man; Scotland; Shetland Islands; Wales
Ordnance Survey Great Britain 1936 Airy 1830 384 -111 425 Scotland; Shetland Islands
Ordnance Survey Great Britain 1936 Airy 1830 370 -108 434 Wales


I'd include it in predefined datums list. Right now I have these:

WGS-84
AGD-66
NAD-27 (CONUS)
SAD-69
S-42 (CZ)
S-42 (Russia)
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Sep 20, 2006 10:19 pm    Post subject: Reply with quote

The OS GB grid is based on OSGB1936 (described here) but given the existence of this you don't need to care: it's easy enough to convert everything to WGS84 with a negligible error of ~5m in either direction.

I don't know much about the Swiss grid, even though I live in Switzerland. I expect they've paid particular attention to the altitude though, given that Switzerland is mostly mountainous. There is information about Swiss reference systems here. Swiss maps are beautiful, even more so than the 1:25000 OS GB ones; I wish they were available online Smile

-ed
Back to top
ed



Joined: 18 Sep 2006
Posts: 7

PostPosted: Wed Sep 20, 2006 11:01 pm    Post subject: Reply with quote

Aaah, my links got mangled. OS GB coordinate systems are described here: http://www.ordnancesurvey.co.uk/oswebsite/gps/information/coordinatesystemsinfo/guidecontents/index.html and conversion between coordinate systems here: http://www.ordnancesurvey.co.uk/oswebsite/gps/information/coordinatesystemsinfo/guidecontents/guide6.html

-ed
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5401

PostPosted: Thu Sep 21, 2006 6:34 am    Post subject: Reply with quote

Thanks!

The http://www.swisstopo.ch site has excellent info on "Swiss grid".

Anyway, although there are online converters from a local to WGS-84 datum, there already is a a basic support for other datums then WGS-84 in 0.9, because all hiking maps for Czech Republic I have use S-42 (CZ) datum, and I'm lazy to do the conversion for some 50 maps Smile

And besides, I have enjoyed learning interesting stuff when trying to find out why my real position does not match with map Smile , like - geodetic datums, other coordinate systems like UTM...

k.
Back to top
View user's profile Send private message
Ranger
Guest





PostPosted: Thu Sep 21, 2006 6:12 pm    Post subject: Reply with quote

Interesting mapping tool for different services:
http://www.dcemu.co.uk/vbulletin/showthread.php?t=33068

Can we calibrate in TrekBuddy ?
Some guys do this for PSP ...

Very Happy
Back to top
ed



Joined: 18 Sep 2006
Posts: 7

PostPosted: Wed Sep 27, 2006 10:32 am    Post subject: More maps Reply with quote

Links to a large collection of maps of nearly everywhere: http://www.lib.utexas.edu/maps/

-ed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> English All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group