0

我想在我目前运行 MacOS Monterey 12.0.1 的 Macbook 上安装Osmosis

按照安装说明,我做了以下事情:

  1. 下载了最新版本(发帖时为 0.48.3)
  2. 我导航到OSX 安装说明,下面的屏幕截图显示了说明的范围:

在此处输入图像描述

  1. 尽我所能(我是 linux 命令行的新手),我执行了上面截图中的命令。
  2. 相应地移动后,我尝试运行osmosis命令行以查看是否会出现任何内容,但被告知找不到该命令。
  3. 当我运行 osmosis 文件时(通过open bin在我的用户主目录中键入 when ,会弹出一个新的终端窗口,显示一堆关于 osmosis 的文档,并且无法编辑或运行任何命令
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]

综上所述,我如何让渗透按照这些使用示例中的描述工作?当我运行open bin时,似乎 osmosis 可执行文件运行,但它不允许我做任何事情或运行任何命令。

仅供参考,今年早些时候在 StackExchange 上似乎有人问过这个问题,但没有那么详细,到目前为止还没有人回答过这个问题。

4

1 回答 1

0

解决了!

简短回答:我需要将 osmosis 可执行文件的文件夹路径添加到$PATH.

我做的具体步骤:

  1. 打开 .zshrc(我使用的是 zsh,而不是 bash 终端)
  2. 将以下内容添加到 .zshrc 文件中:
# Adding Osmosis executable to path
path+=('/folder/where/osmosis/executable/is')
export PATH

完成上述操作后,您可以像在文档中一样从命令行运行 osmosis

似乎 OSM wiki 的说明(请参阅我原始帖子中的屏幕截图)本质上是在做同样的事情(即,只需将 osmosis 可执行文件的路径添加到$PATH),但它们对我不起作用。不知道为什么。

于 2021-12-06T03:57:22.743 回答