# 使用 Homebrew, apt, MacPorts 安装 osm2pgrouting

查看 osm2pgrouting 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:osm2pgrouting
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install osm2pgrouting
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install osm2pgrouting
```

  证据: MacPorts ports tree: gis/osm2pgrouting/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install osm2pgrouting
```

  证据: Debian stable package indexes: osm2pgrouting from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:osm2pgrouting
- **软件包管理器:** Homebrew
- **版本:** 3.0.0
- **来源摘要:** Import OSM data into pgRouting database
- **主页:** <https://pgrouting.org/docs/tools/osm2pgrouting.html>
- **仓库:** <https://github.com/pgRouting/osm2pgrouting>
- **最后更新:** 2026-08-02T00:19:40+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- osm2pgrouting (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.0.0
## 项目历史与用法

osm2pgrouting imports OpenStreetMap road-network data into a PostgreSQL/PostGIS database shaped for pgRouting. It is a specialized bridge between raw OSM XML and graph-routing SQL workflows.

### 项目历史

The pgRouting/osm2pgrouting GitHub repository was created on October 30, 2010. Older pgRouting documentation credits Daniel Wendt as the primary original author and describes the project as later hosted on the pgRouting project site.

The tool's documentation and README place it firmly in the pgRouting stack: users prepare PostgreSQL, PostGIS, pgRouting, Boost, Expat, libpqxx, and CMake, then run the importer against an OSM file and an XML mapping configuration.

### 采用历史

Its adoption is narrower than osm2pgsql because it targets routing topology rather than general OSM rendering or analysis. Evidence of packaging in Homebrew, Debian, Ubuntu, MacPorts, and FreeBSD ports shows it remains useful as a small import utility around pgRouting.

### 使用方式

osm2pgrouting reads an OSM XML file, uses `mapconfig.xml` to select road types and road classes, and creates routing-oriented tables. The older pgRouting documentation emphasizes generated types and classes tables, which can be used to build more sophisticated cost functions.

### 为什么软件包爱好者会关心

The package is a classic geospatial adapter: not a database, not a router, and not a renderer, but the glue that creates pgRouting-ready graph tables from OSM source data. Package maintainers care because its dependency stack crosses C++, PostgreSQL client libraries, PostGIS, and pgRouting ABI expectations.

### 时间线

- 2010-10-30: the pgRouting/osm2pgrouting repository is created on GitHub.
- Older pgRouting documentation records Daniel Wendt as the primary original author.
- Version 3.0.0 release notes discuss schema-level changes such as bigint identifiers and generated identity columns.

### Related projects

- pgRouting supplies the graph algorithms and database extension; PostGIS supplies spatial types and operations; PostgreSQL stores the imported network. osm2pgrouting is one importer in that stack.

### 来源

- <https://api.github.com/repos/pgRouting/osm2pgrouting>
- <https://formulae.brew.sh/formula/osm2pgrouting>
- <https://github.com/pgRouting/osm2pgrouting>
- <https://github.com/pgRouting/osm2pgrouting/discussions/322>
- <https://ma.ellak.gr/edu/mod/resource/view.php?id=1092>
- <https://www.freshports.org/converters/osm2pgrouting>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 其他软件包管理器记录

- Debian apt - osm2pgrouting - 2.3.8-3: normalized package name match | Debian stable package indexes: osm2pgrouting from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tool to import OpenStreetMap data into a pgRouting database | https://github.com/pgRouting/osm2pgrouting
- Ubuntu apt - osm2pgrouting - 2.3.8-2build3: normalized package name match | Ubuntu 24.04 LTS package indexes: osm2pgrouting from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Tool to import OpenStreetMap data into a pgRouting database | https://github.com/pgRouting/osm2pgrouting
- MacPorts - osm2pgrouting: normalized package name match | MacPorts ports tree: gis/osm2pgrouting/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/osm2pgrouting.yml](https://github.com/mxcl/pkgdb/blob/main/combined/osm2pgrouting.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
