Skip to content

Commit 2baee38

Browse files
committed
Add pgRouting documentation
1 parent 92fed2d commit 2baee38

File tree

5 files changed

+119
-2
lines changed

5 files changed

+119
-2
lines changed

CN/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*** xref:master/5.6.adoc[plpgsql_check]
2222
*** xref:master/5.7.adoc[pgroonga]
2323
*** xref:master/5.8.adoc[pgaudit]
24+
*** xref:master/5.9.adoc[pgrouting]
2425
** IvorySQL架构设计
2526
*** 查询处理
2627
**** xref:master/6.1.1.adoc[双parser]

CN/modules/ROOT/pages/master/5.0.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ IvorySQL 作为一款兼容 Oracle 且基于 PostgreSQL 的高级开源数据库
1818
| xref:master/5.5.adoc[pgsql-http]​ | 1.7.0 | 允许在SQL中发起HTTP请求,与外部Web服务进行交互 | 数据采集、API集成、微服务调用
1919
| xref:master/5.6.adoc[plpgsql_check] | 2.8 | 提供PL/pgSQL代码的静态分析功能,可在开发阶段发现潜在错误 | 存储过程开发、代码质量检查、调试优化
2020
| xref:master/5.7.adoc[pgroonga] | 4.0.4 | 提供​非英语语言全文搜索功能,满足高性能应用的需求 | 中日韩等语言的全文搜索功能
21+
| xref:master/5.8.adoc[pgaudit] | 18.0 | 提供细粒度的审计功能,记录数据库操作日志,便于安全审计和合规性检查 | 数据库安全审计、合规性检查、审计报告生成
22+
| xref:master/5.9.adoc[pgrouting] | 3.8.0 | 提供地理空间数据的路由计算功能,支持多种算法和数据格式 | 地理空间分析、路径规划、物流优化
2123
|====
2224

2325
这些插件均经过 IvorySQL 团队的测试和适配,确保在 IvorySQL 环境下稳定运行。用户可以根据业务需求选择合适的插件,进一步提升数据库系统的能力和灵活性。
2426

25-
我们也将持续扩展和丰富 IvorySQL 的插件生态,欢迎社区开发者提交新的插件适配建议或代码贡献。如需了解更多每个插件的详细使用方法和最新兼容版本,请参阅各插件对应的文档章节。
27+
我们也将持续扩展和丰富 IvorySQL 的插件生态,欢迎社区开发者提交新的插件适配建议或代码贡献。如需了解更多每个插件的详细使用方法和最新兼容版本,请参阅各插件对应的文档章节。
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
:sectnums:
3+
:sectnumlevels: 5
4+
5+
= pgRouting
6+
7+
== 概述
8+
pgRouting 是一个基于 PostgreSQL/PostGIS 数据库构建的开源地理空间路由扩展库。它为数据库赋予了强大的网络分析功能,使其能够处理复杂的路径规划与图论计算问题,例如计算两点之间的最短路径、执行旅行推销员(TSP)分析或计算服务区范围等。它将路由算法直接嵌入到数据库中,从而避免了在应用层进行复杂的数据传输与计算。
9+
10+
该扩展的核心优势在于能够利用 PostgreSQL 强大的数据管理能力和 PostGIS 丰富的空间函数,直接在数据库内部对空间网络数据执行高效计算。这不仅简化了应用程序的开发流程,还通过减少数据移动大幅提升了大规模网络分析的性能。
11+
12+
pgRouting 广泛应用于物流配送、交通导航、网络分析、城市规划及供应链管理等多个领域。其开源特性吸引了全球开发者持续的贡献与完善,使其成为空间数据库领域进行路径分析和网络求解的首选工具之一。
13+
14+
== 安装
15+
16+
[TIP]
17+
环境中已经安装了IvorySQL5.0及以上版本,安装路径为/usr/local/ivorysql/ivorysql-5
18+
19+
=== 源码安装
20+
21+
** 安装依赖
22+
23+
对perl有依赖,perl一般在装IvorySQL时已经装上了,这里不用再装。
24+
CMake版本要求 >= 3.12, Boost版本 >= 1.56
25+
```
26+
#安装依赖
27+
sudo apt install cmake libboost-all-dev
28+
```
29+
30+
** 编译安装
31+
```
32+
wget https://github.com/pgRouting/pgrouting/releases/download/v3.8.0/pgrouting-3.8.0.tar.gz
33+
tar xvf pgrouting-3.8.0.tar.gz
34+
cd pgrouting-3.8.0
35+
mkdir build
36+
cd build
37+
cmake .. -DPOSTGRESQL_PG_CONFIG=/path/to/pg_config # eg: /usr/local/ivorysql/ivorysql-5/bin/pg_config
38+
make
39+
sudo make install
40+
```
41+
42+
== 创建Extension并确认ddlx版本
43+
44+
psql 连接到数据库,执行如下命令:
45+
```
46+
ivorysql=# CREATE extension pgrouting;
47+
CREATE EXTENSION
48+
49+
ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'pgrouting';
50+
name | default_version | installed_version | comment
51+
-----------+-----------------+-------------------+---------------------
52+
pgrouting | 3.8.0 | | pgRouting Extension
53+
(1 row)
54+
```
55+
56+
== 使用
57+
关于pgRouting的使用,请参阅 https://docs.pgrouting.org/[pgRouting官方文档]

EN/modules/ROOT/nav.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
** xref:master/4.4.adoc[Operation Management]
1313
** xref:master/4.5.adoc[Migration]
1414
* IvorySQL Ecosystem
15-
** xref:master/5.0.adoc[Overview]
15+
** xref:master/5.0.adoc[Overview]
1616
** xref:master/5.2.adoc[pgvector]
1717
** xref:master/5.3.adoc[pgddl(DDL Extractor)]
1818
** xref:master/5.4.adoc[pg_cron]
1919
** xref:master/5.5.adoc[pgsql-http]
2020
** xref:master/5.6.adoc[plpgsql_check]
2121
** xref:master/5.7.adoc[pgroonga]
2222
** xref:master/5.8.adoc[pgaudit]
23+
** xref:master/5.9.adoc[pgrouting]
2324
* IvorySQL Architecture Design
2425
** Query Processing
2526
*** xref:master/6.1.1.adoc[Dual Parser]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
:sectnums:
2+
:sectnumlevels: 5
3+
4+
= pgRouting
5+
6+
== Overview
7+
pgRouting is an open-source geospatial routing extension library built on PostgreSQL/PostGIS databases. It endows databases with powerful network analysis capabilities, enabling them to handle complex path planning and graph theory computation problems, such as calculating the shortest path between two points, performing Traveling Salesman Problem (TSP) analysis, or computing service area coverage. It embeds routing algorithms directly into the database, thereby avoiding complex data transfer and computation at the application layer.
8+
9+
The core advantage of this extension lies in its ability to leverage PostgreSQL's powerful data management capabilities and PostGIS's rich spatial functions to perform efficient computation on spatial network data directly within the database. This not only simplifies application development processes but also significantly improves the performance of large-scale network analysis by reducing data movement.
10+
11+
pgRouting is widely used in logistics and distribution, traffic navigation, network analysis, urban planning, and supply chain management, among other fields. Its open-source nature has attracted continuous contributions and improvements from developers worldwide, making it one of the preferred tools for path analysis and network solving in the spatial database domain.
12+
13+
== Installation
14+
15+
[TIP]
16+
IvorySQL 5.0 or higher version is already installed in the environment, with the installation path at /usr/local/ivorysql/ivorysql-5
17+
18+
=== Source Installation
19+
20+
** Install dependencies
21+
22+
It depends on perl, which is generally already installed when installing IvorySQL, so no need to install it here.
23+
CMake version requirement >= 3.12, Boost version >= 1.56
24+
```
25+
# Install dependencies
26+
sudo apt install cmake libboost-all-dev
27+
```
28+
29+
** Compile and install
30+
```
31+
wget https://github.com/pgRouting/pgrouting/releases/download/v3.8.0/pgrouting-3.8.0.tar.gz
32+
tar xvf pgrouting-3.8.0.tar.gz
33+
cd pgrouting-3.8.0
34+
mkdir build
35+
cd build
36+
cmake .. -DPOSTGRESQL_PG_CONFIG=/path/to/pg_config # eg: /usr/local/ivorysql/ivorysql-5/bin/pg_config
37+
make
38+
sudo make install
39+
```
40+
41+
== Create Extension and Confirm pgRouting Version
42+
43+
Connect to the database with psql and execute the following commands:
44+
```
45+
ivorysql=# CREATE extension pgrouting;
46+
CREATE EXTENSION
47+
48+
ivorysql=# SELECT * FROM pg_available_extensions WHERE name = 'pgrouting';
49+
name | default_version | installed_version | comment
50+
-----------+-----------------+-------------------+---------------------
51+
pgrouting | 3.8.0 | | pgRouting Extension
52+
(1 row)
53+
```
54+
55+
== Usage
56+
For pgRouting usage, please refer to the https://docs.pgrouting.org/[pgRouting Official Documentation]

0 commit comments

Comments
 (0)