I want to install Osmosis on my Macbook, which currently is running MacOS Monterey 12.0.1
Following the installation instructions, I did the following:
- I downloaded the latest version (0.48.3 at the time of this posting)
- I navigated to the OSX installation instructions, and the screenshot below shows the extent of the instructions:
- Doing my best to follow (I'm novice with linux command line), I executed the commands in the screenshot above.
- After moving accordingly, I tried running
osmosisinto the command line to see if anything would come up, but was told the command was not found. - When I run the osmosis file (by typing
open binwhen in my user home directory, a new terminal window pops up showing a bunch of documentation about osmosis, and no way to edit or run any commands.
Last login: Sat Dec 4 18:47:24 on ttys000
/opt/osmosis/bin/osmosis ; exit;
(base) darrenconly@Darrens-MacBook-Pro ~ % /opt/osmosis/bin/osmosis ; exit;
osmosis
Example Usage
Import a planet file into a local PostgreSQL database.
osmosis --read-xml file=~/osm/planbet/planet.osm --write-apidb host="x" database="x" user="x" password="x"
Export a planet file from a local PostgreSQL database.
osmosis --read-apidb host="x" database="x" user="x" password="x" --write-xml file="planet.osm"
Derive a change set between two planet files.
osmosis --read-xml file="planet2.osm" --read-xml file="planet1.osm" --derive-change --write-xml-change file="planetdiff-1-2.osc"
Derive a change set between a planet file and a database.
osmosis --read-mysql host="x" database="x" user="x" password="x" --read-xml file="planet1.osm" --derive-change --write-xml-change file="planetdiff-1-2.osc"
Apply a change set to a planet file.
osmosis --read-xml-change file="planetdiff-1-2.osc" --read-xml file="planet1.osm" --apply-change --write-xml file="planet2.osm"
Sort the contents of a planet file.
osmosis --read-xml file="data.osm" --sort type="TypeThenId" --write-xml file="data-sorted.osm"
The above examples make use of the default pipe connection feature, however a simple read and write planet file command line could be written in two ways. The first example uses default pipe connection, the second explicitly connects the two components using a pipe named "mypipe". The default pipe connection will always work so long as each task is specified in the correct order.
osmosis --read-xml file="planetin.osm" --write-xml file="planetout.osm"
osmosis --read-xml file="planetin.osm" outPipe.0="mypipe" --write-xml file="planetout.osm" inPipe.0="mypipe"
Full usage details are available at: http://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
So all that said, how do I get osmosis to work as described in these usage examples? When I run open bin it appears that the osmosis executable runs, but it doesn't let me do anything or run any commands.
FYI, looks like this question was asked before on StackExchange earlier this year, but was less detailed and no one has answered it thus far.

Solved!
Short answer: I needed to add the folder path of the osmosis executable to the
$PATH.Specific steps I did:
After doing the above, you can run osmosis from the command line just like in the documentation
It seems like the OSM wiki's instructions (see screenshot in my original post) are essentially doing the same thing (i.e., simply add the path to the osmosis executable to the
$PATH), but they didn't work for me. Not sure why.