User:SK53/Osmosis

From OpenStreetMap Wiki
Jump to: navigation, search

Various bits and pieces relating to using Osmosis.

Running under Windows

A very simple-minded .BAT file for Osmosis 0.31 under windows which works, unlike the one in the distribution.

SET CP=.\osmosis.jar
SET CP=%CP%;.\lib\default\aopalliance-1.0.jar
SET CP=%CP%;.\lib\default\commons-pool-1.3.jar
SET CP=%CP%;.\lib\default\postgresql-8.3-603.jdbc4.jar
SET CP=%CP%;.\lib\default\spring-jdbc-2.5.6.SEC01.jar
SET CP=%CP%;.\lib\default\bzip2-20090327.jar
SET CP=%CP%;.\lib\default\jpf-1.5.jar
SET CP=%CP%;.\lib\default\spring-beans-2.5.6.SEC01.jar
SET CP=%CP%;.\lib\default\spring-tx-2.5.6.SEC01.jar
SET CP=%CP%;.\lib\default\commons-dbcp-1.2.2.jar
SET CP=%CP%;.\lib\default\mysql-connector-java-5.1.6.jar
SET CP=%CP%;.\lib\default\spring-context-2.5.6.SEC01.jar
SET CP=%CP%;.\lib\default\stax2-api-3.0.1.jar
SET CP=%CP%;.\lib\default\commons-logging-1.1.1.jar
SET CP=%CP%;.\lib\default\postgis-1.3.2.jar
SET CP=%CP%;.\lib\default\spring-core-2.5.6.SEC01.jar
SET CP=%CP%;.\lib\default\woodstox-core-lgpl-4.0.3.jar
SET CP=%CP%;.\lib\default\commons-compress-1.0.jar


#echo %CP%

java -Xmx1048m -cp %CP% org.openstreetmap.osmosis.core.Osmosis %*

Generating a Change File

Turning an ordinary OSM file into an OSC file. file0 is empty, both files have been sorted with --sort-0.6 option.

osmosis.bat --rx file="file_s6.osm" --rx file="file0_s6.osm" --dc --wxc file="file.osc"


Change & bbox

osmosis --rxc diff-to-apply.osc.gz --rx old-extract.osm.gz --ac --bb [your bounding box] --wx new-extract.osm.gz