Osmosis/Quick Install (Windows)

From OpenStreetMap Wiki
Jump to navigation Jump to search

Osmosis windows installation is quite straightforward and similar in many ways to Osmosis/Installation on other operating systems.

Installing

You need Java (specifically Java Runtime Environment) to be able to run osmosis. If you don't have it (check here if you're not sure), you can download JRE from java.com/en/download. After the download completes, double-click the downloaded installer and follow the instructions.

Download the latest osmosis runtime zip file from https://github.com/openstreetmap/osmosis/releases/latest (DOWNLOAD) . You'll need to put it where you can unzip/edit it (eg your desktop)

Unzip the downloaded file. You don't need the outer directory (osmosis-latest), and you may find it simpler to remove the version number from the next-level directory. Put the directory somewhere appropriate (eg C:\Program Files (x86)\)

Finally, you need to get access to Osmosis via the Command Line. One way of doing this is described at http://learnosm.org/en/osm-data/osmosis/, another is the following:

Create a text file with a .BAT extension (probably somewhere in your user space) containing something like this:

"C:\Program Files (x86)\osmosis\bin\osmosis.bat"

(the quotes are necessary because there are spaces in the directory name; the .bat isn't required, it's just there for clarity)

You can run this by double-clicking on the file, but you may well find that the window closes before you can see what's happened. In which case, create a shortcut to the file, open its Properties, and on the Shortcut tab insert cmd /k at the beginning of the Target. This runs it in a window that stays open.

The output should look very similar to this:

Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline complete.
Apr 23, 2012 3:20:31 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Total execution time: 387 milliseconds.

You're set. Osmosis works. Head on over to Osmosis#Example_Usage for some basic usage examples. The full reference documentation is here.

Troubleshooting

Osmosis may well need to be told where to find java.

  • Find the java application (exe file) - it's probably in C:\Program Files (x86)\Java\jre6\bin\.
  • Edit C:\Program Files (x86)\osmosis\bin\osmosis.bat
  • Find the line about 3/4 of the way down that sets JAVACMD and change it to:
IF "%JAVACMD%"=="" set JAVACMD="C:\Program Files (x86)\Java\jre7\bin\java" 
  • You may also have to change the line near the end that sets EXEC and put double quotes before and after %JAVACMD%

Help

Not working? Search for a solution to your problem. You can also Contact the community in various ways to ask for help. If you choose to ask a new question on http://help.openstreetmap.org be sure to search first, and be sure to mention that you are using Osmosis on Windows.