wiki:PythonScripts

Version 2 (modified by Uriel, 7 years ago) (diff)

--

There are a few main python scripts created to help perform various tasks with Maperitive, which are described here. There are also a number of "test scripts" which are one-offs or works in progress stored on the maps USB drive.

convert_georef.py

This script is used to read in a directory of images (such as created by the Maperitive export-bitmap or save-source command), and convert all the Maperitive .georef text files in that folder to GDAL-compatible world files. The folder to be worked on must be manually entered at the top of the python script by editing the file.

Example:

Matperitive .georef

<georef>
  <srs>
    <id>EPSG:3857</id>
  </srs>
  <origin>
    <x>-20037508.342789244</x>
    <y>-7558415.6560817827</y>
  </origin>
  <cell-width>61.844161551818772</cell-width>
  <cell-height>105.31808356728818</cell-height>
</georef>

World File (.pngw)

61.844161551818772
0
0
105.31808356728818
-20037508.342789244
-7558415.6560817827

fill_terrain_tiles.py

gen_terrain_image_script.py

gen_tiles_from_images_script.py

gen_terrain_tiles_script.py

Attachments (5)

Download all attachments as: .zip