这是我第一次尝试设置 OSM 服务器。我一直在关注这个教程:
https://github.com/AnderPijoan/vectorosm(使用节点为什么我需要改变地图的渲染方式以满足我的项目的一些特定要求)。
我做了所有事情,除了我从源代码安装了 osm2pgsql,因为存储库版本太旧了。
但我在导入数据库时遇到困难,我正在使用:
osm2pgsql -m -s -c -j -v --cache-strategy dense --flat-nodes tempFileErase -d osm -U osmuser --unlogged --hstore-add-index --exclude-invalid-polygon -r pbf planet-latest.osm.pbf
但我得到:
osm2pgsql SVN version 0.83.0 (64bit id space)
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE: table "planet_osm_point" does not exist, skipping
NOTICE: table "planet_osm_point_tmp" does not exist, skipping
Setting up table: planet_osm_line
NOTICE: table "planet_osm_line" does not exist, skipping
NOTICE: table "planet_osm_line_tmp" does not exist, skipping
Setting up table: planet_osm_polygon
NOTICE: table "planet_osm_polygon" does not exist, skipping
NOTICE: table "planet_osm_polygon_tmp" does not exist, skipping
Setting up table: planet_osm_roads
NOTICE: table "planet_osm_roads" does not exist, skipping
NOTICE: table "planet_osm_roads_tmp" does not exist, skipping
Using built-in tag processing pipeline
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Node-cache: cache=800MB, maxblocks=0*102401, allocation method=8192
Mid: loading persistent node cache from tempFileErase
Failed to allocate space for node cache file: Success
Error occurred, cleaning up
我知道该如何修复它吗?
问候。
答案1
-S
尝试使用或相同的命令--style
。您应该使用此命令传递 default.style 文件的位置。您可以从此链接下载该文件。
https://github.com/openstreetmap/osm2pgsql/blob/master/default.style
答案2
尝试--cache-strategy dense
从命令中删除。这对我有用。