GithubHelp home page GithubHelp logo

hgoebl / mapsforge-mapcreator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapsforge/mapsforge-mapcreator

0.0 3.0 0.0 3.99 MB

Automatic map generation for mapsforge maps

Home Page: http://download.mapsforge.org/

Python 100.00%

mapsforge-mapcreator's Introduction

Create your own Mapsforge maps with MapCreator

With the coastline and water issues, creating a mapsforge map is not as simple as it should be, but here we offer a scripted solution that includes these additional steps.

Mapsforge uses the process described here to build maps for the download.mapsforge.org site. The process is run on a Linux machine with 8 cores, 24GB memory and 2TB of storage. The process has not been tested on any other operating system, running this on Windows or OSX will most likely require some changes.

Cook Book

  1. Clone mapsforge-mapcreator git clone https://github.com/mapsforge/mapsforge-mapcreator.git
  2. In the directory xml you will find an example configuration file, named example-config. You will need to edit this file to suit your installation and your map requirements.
  3. You will also need polygons for any area you want to build a map for. The polygons are found in the polygons directory.
  4. Run python mapcreator.py -c xml/myconfigfile.xml

The configuration file

The configuration file has a number of settings and path specifications in the top, adjust them to your environment:

<mapcreator-config xmlns="http://mapsforge.org/mapcreator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://mapsforge.org/mapcreator https://raw.githubusercontent.com/mapsforge/mapsforge-mapcreator/master/resources/mapcreator.xsd"
	default-map-start-zoom="14" map-staging-path="maps" pbf-staging-path="data" polygons-path="polygons" map-target-path="/web/ftp.mapsforge.org/public/maps"
	logging-path="logs" initial-source-pbf="planet.osm.pbf" osmosis-path="/export/local-1/public/mapsforge/preprocessing/bin/osmosis-0.40.1/bin/osmosis"
	default-preferred-languages="en">

The second part are the maps to be created. Map definitions look like this:

<part name="great_britain" create-pbf="true" map-start-lat="51.499266" map-start-lon="-0.124787">
	<part name="england" map-start-lat="51.50728" map-start-lon="-0.12766" defines-hierarchy="false">
	    <part name="greater_london" map-start-lat="51.50728" map-start-lon="-0.12766"/>
	</part>
	<part name="scotland" map-start-lat="55.94834" map-start-lon="-3.19327"/>
	<part name="wales" map-start-lat="51.48353" map-start-lon="-3.18369"></part>
</part>

A part directive specifies an extract from the original pbf file, from which either only pbf extracts are made or/and maps. For every part for which a map will be created you will need to define a start point that needs to lie within the polygon. Every part requires a correspondingly named polygon in the polygons folder (at the same depth).

These are some of the more important options for each part:

  • name required and needs to have a matching polygon in the polygons directory.
  • create-map if a map should be created or simply a pbf extract that can be used for parts of this part (this is a speed issue, extracting everything from a top-level planet can be very slow).
  • create-pbf if true will create a pbf file that can subsequently be used for parts of this part.
  • type if set to hd uses less memory, but much slower
  • map-start-zoom start zoom level
  • map-start-lat
  • map-start-lon starting position, must be within polygon
  • preferred-languages If not specified, only the default language with no tag will be written to the file. If only one language is specified, it will be written if its tag is found, otherwise the default language will be written. If multiple comma separated languages are specified, the default language will be written, followed by the specified languages (if present and if different than the default).

For all options see https://github.com/mapsforge/mapsforge-mapcreator/blob/master/resources/mapcreator.xsd

Notes

  • This script will not download the initial file, e.g. planet pbf.
  • You will need a working Osmosis installation
  • You will need the mapsforge writer installed
  • Requirements: GDAL , Shapely
  • If you are making something like a world map, you might consider the zoom-interval-config setting as well as the land-simplification setting, which reduces the number of nodes in the land borders (higher=more simplification).
  • It might be worthwhile to first try this process without any changes applied and full planet.pbf file, to rule out any configuration problems.

mapsforge-mapcreator's People

Contributors

aalih avatar andreynovikov avatar devemux86 avatar jjbross avatar ludwigb avatar peter17 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.