Menu

QuickStart

Featured (4)
Anonymous

Overview

gdal_tiler.py creates a folder with a tile pyramid from a map file. By default a tile pyramid is created in a Google-compatible format. The script also puts a few helper files into a pyramid folder, so it's possible to check a result of a conversion with an internet browser.

For Ozi a corresponding raster file (JPEG, PNG, TIFF) must be in the the same folder. .ozf2 and .ozfx3 raster files can be converted to TIFF by ozf_decoder.py.

tiles_convert.py converts a set of tiles between a number of formats.

Quick Start

In the simplest case, the data preparation for maemo-mapper looks like this:

gdal_tiler.py my_map.kap
or
gdal_tiler.py my_map.map
or
gdal_tiler.py my_map.geo

Notes

  • The scripts have --help option. For example:

    /home/misc/bsb/test-charts$ gdal_tiler.py --help
    Usage: gdal_tiler.py <options>... source...
    
    Tile cutter for GDAL-compatible raster maps
    
    Options:
      --version             show program's version number and exit
      -h, --help            show this help message and exit
      -p PROFILE, --profile=PROFILE, --to=PROFILE
                            output tiles profile (default: zyx)
      -f, --list-profiles   list tile profiles
      -z ZOOM_LIST, --zoom=ZOOM_LIST
                            list of zoom ranges to generate
      --srs=SOURCE_SRS      override source's spatial reference system
      --tiles-srs=TILES_SRS
                            target SRS for generic profile
      --tile-size=SIZE_X,SIZE_Y
                            generic profile: tile size (default: 256,256)
      --zoom0-tiles=NTILES_X,NTILES_Y
                            generic profile: number of tiles along the axis at the
                            zoom 0 (default: 1,1)
      --overview-resampling=METHOD1
                            overview tiles resampling method (default: nearest)
      --base-resampling=METHOD2
                            base image resampling method (default: nearest)
      -r, --release         set resampling options to (antialias,bilinear)
      --tps                 Force use of thin plate spline transformer based on
                            available GCPs)
      -c, --cut             cut the raster as per cutline provided either by
                            source or by "--cutline" option
      --cutline=DATASOURCE  cutline data: OGR datasource
      --cutline-match-name  match OGR feature field "Name" against source name
      --cutline-blend=N     CUTLINE_BLEND_DIST in pixels
      --src-nodata=N[,N]...
                            Nodata values for input bands
      --dst-nodata=N        Assign nodata value for output paletted band
      --tiles-prefix=URL    prefix for tile URLs at googlemaps.hml
      --tile-format=FMT     tile image format (default: png)
      --paletted            convert tiles to paletted format (8 bit/pixel)
      -t DEST_DIR, --dest-dir=DEST_DIR
                            destination directory (default: source)
      --noclobber           skip processing if the target pyramid already exists
      -s, --strip-dest-ext  do not add a default extension suffix from a
                            destination directory
      -q, --quiet           
      -d, --debug           
      -l, --long-name       give an output file a long name
      -n, --after-name      give an output file name after a map name (from
                            metadata)
      -m, --after-map       give an output file name  after name of a map file,
                            otherwise after a name of an image file
    
  • Some map files have a description for a "useful" part of a raster (a border polygon). This region can be "cut out" by the gdal_tiler.py during the process of a pyramid generation :

    gdal_tiler.py --cut my_map.kap
    
  • There a few maps there a "useless" area is painted by some color (or you can paint it by your own). These areas can be marked by the --no-data option:

    gdal_tiler.py --src-nodata=000,111,222 my_map.vrt
    
  • By default gdal_tiler.py renders a draft quality tiles, to create a "clean copy" you can use --release option (which is a shortcut to --overview-resampling=antialias --base-resampling=cubic):

    gdal_tiler.py --release my_map.vrt
    
  • A range of zoom levels generated by gdal_tiler.py can be set by the "--zoom" option:

    gdal_tiler.py --zoom=9-15 my_map.vrt
    
  • tiles-merge.py can be used to 'sew' a number of maps into one:

    tiles_merge.py map1-folder map2-folder map3-folder result-folder
    

where mapN-folder are the folders generated by gdal_tiler.py

  • tiles_convert.py allows to select a subset of tiles to be copied to the destination tileset, like:

    tiles_convert.py --region=polygon.shape --zoom=4,7-10
    

where polygon.shape is either a OGR(GDAL)-compatible dataset or SASPlanet highlighting file

  • It's possible to make a very rough geo-referencing ('calibration') of scanned maps: you place an image into a Google Earth layer, make the layer semitransparent, adjust and align it according to the satellite image, then export it into a KML file (not KMZ). Then you can process the image the way as described above.

Related

Wiki: LinuxInstall
Wiki: WinInstall

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.