【问题标题】:Trouble installing Osmosis for OpenStreetMap on Mac OS Monterey在 Mac OS Monterey 上安装 Osmosis for OpenStreetMap 时遇到问题
【发布时间】:2022-01-11 04:16:47
【问题描述】:

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

按照安装说明,我执行了以下操作:

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

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

说了这么多,我如何让渗透工作如these usage examples 中所述?当我运行 open bin 时,似乎 osmosis 可执行文件运行,但它不允许我执行任何操作或运行任何命令。

仅供参考,看起来这个问题是今年早些时候的asked before on StackExchange,但没有那么详细,到目前为止还没有人回答。

【问题讨论】:

    标签: openstreetmap osmosis


    【解决方案1】:

    解决了!

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

    我做的具体步骤:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-01
      • 2020-07-03
      • 2015-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多