View Single Post
Posts: 40 | Thanked: 18 times | Joined on May 2008
#60
DRAFT!!!

How to install bsb2tiles kit on Windows:

Here are the prerequisites for the kit: Python (v 2.6), Python imaging library (PIL), NumPy package, GDAL (v. 1.6 and above) and, optionally, pngnq utility.
  1. Install these packages:Python, PIL, numpy. Download them from here: http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi, http://effbot.org/media/downloads/PI...in32-py2.6.exe and http://pypi.python.org/packages/2.6/...in32-py2.6.exe
  2. Unpack GDAL from http://vbkto.dyndns.org/sdk/release-...server-5-6.zip to a folder
  3. Take bsb2tiles.tar.gz from the 1st post in this thread: http://forums.internettablettalk.com...05&postcount=1
  4. Unpack it with 7zip (http://7-zip.org) to another folder
  5. in this folder edit bsb2tiles.bat, to modify the paths to the Python and GDAL packages, for example:
    Code:
    set PYTHON=D:\bin\Python26
    set GDAL=D:\bin\release-1400-gdal-1-7-mapserver-5-6
  6. Now you can launch bsb2tiles.bat

*** Map conversion

After bsb2tiles.bat starts, a command line window pop-ups. In this window you do the job.

First you navigate to the folder with the source data: OZI .MAP, BSB .KAP, JPEG, PNG, TIFF rasters, etc. For example:
Code:
cd /d D:\test\bsb\tst-ozi
These files can be dragged here from the Windows Explorer window to compose a command line.

bsb2gdal.py script creates a GDAL's .VRT file from a BSB .KAP file.

ozi2gdal.py script translates ozi .MAP data into a format GDAL's .VRT. A corresponding raster file (jpg, png, tiff) must be in the the same folder. NB: OZF2 and OZF3 are not supported, but on the Internet you could find some converters for them.

gdal2tiles.py using information from .VRT file converts a raster to a tile pyramid folder (in so-called TMS structure). It also puts a few helper files there. In particular, googlemaps.html, with this file you can check the result of a conversion with a browser.

tiles2mapper.py converts a set of tiles from one format to another. By default it converts TMS pyramid into a maemo-mapper SQLite data base

In the simplest case, the data preparation for maemo-mapper looks like this:
Code:
bsb2gdal.py my_map.kap
or
ozi2gdal.py my_map.map
...
gdal2tiles.py my_map.vrt
...
tiles2mapper.py my_map
...
The result is in the file my_map.db. You'd need to copy it to N8xx the folder with the other maemo-mapper map caches. Then, in maemo-mapper you'd need to create a new repository. The path parameter of the repository to set the path of the ".db" file . The URL value in this case is not important, for example you can put there something like http://myserver/maps/%0d/%d/%d.png

Notes:
  • The scripts have a useful "--help" option
  • Some BSB or OZI files have a description of a "useful" part of a raster. This region can be "cut out":
    Code:
    bsb2gdal.py --cut my_map.kap 
    or
    ozi2gdal.py --cut my_map.map
  • On some maps a "useless" area is painted by some color (or you can paint it by your own). These can mask by the "--no-data" option:
    Code:
    ozi2gdal.py --no-data=111,222,333 my_map.map
  • When rendering tiles for upper pyramid levels, gdal2tiles.py gives somewhat better result with "-r antialias":
    Code:
    gdal2tiles.py -r antialias my_map.vrt
  • The range of zoom levels generated by gdal2tiles.py can be set by: "-z 9-15"
  • Multiple maps can be sewn into one by tiles-merge.py:
    Code:
    tiles-merge.py map1-folder map2-folder map3-folder result-folder
    where mapN-folder are the folders generated by gdal2tiles.py
  • The pyramid of tiles can be transformed into a google-compliant form:
    Code:
    tiles2mapper.py --to gtiles source-tiles result-tiles
    The result is compatible with mappero cache, so can be copied straight to N900

Last edited by vadp; 2010-12-08 at 14:00.