gpt4 book ai didi

postgresql - osm2pgrouting - 解析数据格式不正确(无效 token )

转载 作者:行者123 更新时间:2023-11-29 11:58:59 25 4
gpt4 key购买 nike

我需要通过 osm2pgrouting 工具将开放的街道 map 数据导入我的 PostGIS 数据库。但是当我运行命令时,创建了表但没有任何数据。你能告诉我我做错了什么吗?我在我的数据库中安装了扩展 pgrouting ...

作为 mapconfig,我使用默认的 mapconfig.xml,它与 osm2pgrouting 工具位于同一文件夹中 (C:\Program Files\PostgreSQL\9.5\bin)。我正在使用 Windows 操作系统。

E:\>osm2pgrouting -f osm_data.osm.pbf --dbname osm_db --conf mapconfig.xml --clean
Execution starts at: Fri Jan 20 19:24:13 2017

***************************************************
COMMAND LINE CONFIGURATION *
***************************************************
Filename = osm_data.osm.pbf
Configuration file = mapconfig.xml
host = localhost
port = 5432
dbname = osm_db
username = postgres
password =
schema=
prefix =
suffix =
Drop tables
Don't add nodes
***************************************************
Connecting to the database
host=localhost user=postgres dbname=osm_db port=5432
connection success
Opening configuration file: mapconfig.xml
Parsing configuration

Parsing data (progress line per 100000 elements)

not well-formed (invalid token) at line 1 Finish Parsing data


Dropping tables...

Creating tables...
Creating 'ways_vertices_pgr': OK
Adding Geometry: Creating 'ways': OK
Adding Geometry: Creating 'relations_ways': OK
Exists: 'osm_nodes': OK
Exists: 'osm_relations': OK
Exists: 'osm_way_types': OK
Exists: 'osm_way_classes': OK
Adding auxiliary tables to database...

Export Types ...
Processing 4 way types: Inserted: 0 in osm_way_types

Export Classes ...
Processing way's classes: Inserted: 0 in osm_way_classes

Export Relations ...
Processing 0 relations: Inserted: 0 in osm_relations

Export RelationsWays ...
Processing way's relations: Inserted: 0 in relations_ways

Export Ways ...
Processing 0 ways:
Ways Processed: 0 Split Ways generated: 0 Vertices inserted 0 Inserted 0 split ways
Creating Foreign Keys ...
Foreign keys for osm_way_classes table created
Foreign keys for relations_ways table created
Foreign keys for Ways table created
#########################
size of streets: 0
Execution started at: Fri Jan 20 19:24:13 2017
Execution ended at: Fri Jan 20 19:24:13 2017
Elapsed time: 0.202 Seconds.
User CPU time: -> 0.202 seconds
#########################

map 配置:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<type name="highway" id="1">
<class name="motorway" id="101" />
<class name="motorway_link" id="102" />
<class name="motorway_junction" id="103" />
<class name="trunk" id="104" />
<class name="trunk_link" id="105" />
<class name="primary" id="106" />
<class name="primary_link" id="107" />
<class name="secondary" id="108" />
<class name="secondary_link" id="124" />
<class name="tertiary" id="109" />
<class name="tertiary_link" id="125" />
<class name="residential" id="110" />
<class name="living_street" id="111" />
<class name="service" id="112" />
<class name="track" id="113" />
<class name="pedestrian" id="114" />
<class name="services" id="115" />
<class name="bus_guideway" id="116" />
<class name="path" id="117" />
<class name="cycleway" id="118" />
<class name="footway" id="119" />
<class name="bridleway" id="120" />
<class name="byway" id="121" />
<class name="steps" id="122" />

<class name="unclassified" id="123" />
<class name="road" id="100" />
</type>
<type name="cycleway" id="2">
<class name="lane" id="201" />
<class name="track" id="202" />
<class name="opposite_lane" id="203" />
<class name="opposite" id="204" />
</type>
<type name="tracktype" id="3">
<class name="grade1" id="301" />
<class name="grade2" id="302" />
<class name="grade3" id="303" />
<class name="grade4" id="304" />
<class name="grade5" id="305" />
</type>
<type name="junction" id="4">
<class name="roundabout" id="401" />
</type>
</configuration>

最佳答案

解决方案是*.osm 格式而不是*.osm.pbf。

关于postgresql - osm2pgrouting - 解析数据格式不正确(无效 token ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41770302/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com