问题
使用
osm2pgrouting
选项在典型 .osm
文件上运行 --addnodes
时,osm_relations
表保持为空。
重现
osm2pgrouting -f home/map.osm -c "/usr/local/share/osm2pgrouting/mapconfig.xml" -d city_routing -U [username] -W [password] --clean --tags --addnodes
期待
我根据文档使用
--addnodes
标志,我可以看到 osm_nodes
和 osm_ways
表确实已填充。但是,运行 osm_relations
后,osm2pgrouting
有 0 条记录,并且输出中从未提及“Final osm_relations:”:
Creating tables...
TABLE: ways_vertices_pgr created ... OK.
TABLE: ways created ... OK.
TABLE: pointsofinterest created ... OK.
TABLE: configuration created ... OK.
TABLE: osm_nodes created ... OK.
TABLE: osm_ways created ... OK.
TABLE: osm_relations created ... OK.
Opening configuration file: /usr/local/share/osm2pgrouting/mapconfig.xml
Parsing configuration
Exporting configuration ...
- Done
Counting lines ...
- Done
Opening data file: home/map.osm total lines: 175957
Parsing data
Current osm_nodes: 48000
Final osm_nodes: 48375
Current osm_ways: 6000
Final osm_ways: 6320
...
End Of file
Finish Parsing data
Adding auxiliary tables to database...
Export Ways ...
...
Creating indexes ...
Processing Points of Interest ...
Adding functions for processing Points of Interest ...
To process pointsOfInterest table:
osm2pgr_pois_update(radius default 200, within default 50)
- Using areas of (radius)mts on POIS
- Using edges that are at least (within) mts of each POI
POIS that do not have a closest edge is considered as too far
#########################
size of streets: 6320
Execution started at: Tue May 30 10:07:09 2023
Execution ended at: Tue May 30 10:07:21 2023
Elapsed time: 11.767 Seconds.
User CPU time: -> 1.12268 seconds
样本数据
附加了示例
.osm
文件(如果需要,请将 txt
重命名为 osm
),但是我尝试了其他包含 .osm
关系的 osm
导出,具有相同的结果。
haywards-heath-uk-small-extract.txt
平台/版本
SELECT version();
PostgreSQL 15.3 (Debian 15.3-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
SELECT postgis_full_version();
POSTGIS="3.3.2 4975da8" [EXTENSION] PGSQL="150" GEOS="3.9.0-CAPI-1.16.2" PROJ="7.2.1" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
SELECT pgr_version();
3.4.1
问题
我看到在源代码中有一个
AddRelation
函数。会被调用吗?
有什么方法可以修改
osm2pgrouting
的代码以使其填充osm_relations
表吗?