我正在创建一个postgis数据库,并希望使用过滤后的OpenStreetMap数据。
为此,我尝试了以下过程:
在我的第一次尝试中,我只过滤了土地面积。
但是,在使用osm2pgsql的步骤4中,我在命令提示符中接收到以下错误:"Osm2pgsql由于错误而失败:第3137102行的XML解析错误,第61列:格式不正确(无效令牌) "
如windows计算机上的命令提示符所示:
Z:\OpenStreetMap>osm2pgsql -U postgres -W -m -d osm -p filteredland -S "C:\Progr
am Files (x86)\HOTOSM\share\default.style" filteredland2.osm
osm2pgsql version 0.92.0 (64 bit id space)
Password:
Using built-in tag processing pipeline
Using projection SRS 3857 (Spherical Mercator)
Setting up table: filteredland_point
Setting up table: filteredland_line
Setting up table: filteredland_polygon
Setting up table: filteredland_roads
Allocating memory for sparse node cache
Node-cache: cache=800MB, maxblocks=12800*65536, allocation method=1
Mid: Ram, scale=100
Reading in file: filteredland2.osm
Using XML parser.
Processing: Node(1230k 61.5k/s) Way(0k 0.00k/s) Relation(0 0.00/s)node cache: st
ored: 1233078(100.00%), storage efficiency: 50.00% (dense blocks: 0, sparse node
s: 1233078), hit rate: -nan(ind)%
Osm2pgsql failed due to ERROR: XML parsing error at line 3137102, column 61: not
well-formed (invalid token)
我还尝试了两条备选路线,但也失败了:
有人知道如何避免这个错误,或者有过滤planet.osm文件并上传到postgis的经验吗?
发布于 2017-07-25 14:28:34
我建议使用锇,而不是osmfilter,它不需要首先将地球转换成不同的格式,并且本机能够返回PBF数据,这些数据可以由osm2pgsql直接处理。它也更快。
https://stackoverflow.com/questions/45297108
复制相似问题