Differences

This shows you the differences between two versions of the page.

Link to this comparison view

content:servalmaps:osmosis [25/05/2013 01:51] (current)
Andrew Bettison created, copied from old content:software:techroadmap:features:mapping:publicalpha:publicalphamappingserviceopenstreetmapmapsforge and cleaned up
Line 1: Line 1:
 +====== Convert from OpenStreetMap to Mapsforge using Osmosis ======
 +
 +This document provides an overview of the procedure to convert data sourced from [[http://www.openstreetmap.org/|OpenStreetMap]] to the binary format used by [[http://code.google.com/p/mapsforge/|Mapsforge]], a library used to render maps on Android devices.
 +
 +Processing power, memory and storage are limited on many Android devices, so it is recommended that the smallest geographic area be converted for use on the mobile device.
 +
 +This procedure converts entire data files sourced from OpenStreetMap.  It does not describe how to convert only a region of one of these larger data files.
 +
 +==== Step 0. Assumptions ====
 +
 +  - The latest version of [[http://wiki.openstreetmap.org/wiki/Osmosis|Osmosis]], an application for manipulating !OpenStreetMap data is installed correctly on your system
 +  - The latest version of the [[http://code.google.com/p/mapsforge/wiki/MapFileWriterOsmosis|Mapsforge Mapfile-Writer]] plugin for Osmosis is installed correctly on your system
 +  - You are familiar with the command line interface of your preferred operating system
 +
 +**Note:** This procedure was developed for [[http://www.ubuntu.com|Ubuntu 11.04]], but the principles are the same for all platforms.
 +
 +==== Step 1. Download the OpenStreetMap Data ====
 +  - Create a new folder on your system to store the data
 +  - Open a new Internet browser window
 +  - Navigate to http://download.geofabrik.de/osm/
 +  - Select the folder that represents the geographic area of interest
 +  - Repeat step 1.4 narrowing the selection to the smallest geographic area until all folders have been explored
 +  - Examine the name of the files to determine which file represents the required geographic area
 +  - Download the file with the name of the geographic area that ends with the ''.pbf'' extension and is described as //OpenStreetMap data, protobuf binary format//
 +  - Save the file in the folder created in point 1
 +
 +**Example - Download data for Washington, USA**
 +
 +  - Navigate to http://download.geofabrik.de/osm/
 +  - Click on the //north-america// link
 +  - Click on the //us//link
 +  - Scroll down the page
 +  - Download the file labeled ''washington.osm.pbf''
 +  - Save the file in the folder created in point 1
 +
 +**Example - Download data for New Zealand**
 +
 +  - Navigate to http://download.geofabrik.de/osm/
 +  - Click on the //australia-oceania// link
 +  - Download the file labeled ''new-zealand.osm.pbf''
 +  - Save the file in the folder created in point 1
 +
 +==== Step 2. Convert the OpenStreetMap Data ====
 +
 +  - Open a new terminal window
 +  - Change to the folder where Osmosis is installed
 +  - Change to the bin sub-directory
 +  - Execute the following command<code>
 +./osmosis --rb {osm-path} --mw {mapsforge-path}
 +</code>where: 
 +      * ''{osm-path}'' is the path of the OpenStreetMap file downloaded in step 1
 +      * ''{mapsforge-path}'' is the path of the Mapsforge file that will be created
 +      * **Note:** ensure that paths and file names do not include spaces
 +  - Wait for the conversion to complete (this will take some time)
  

Login