You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Docker容器时向同一OSM瓦片服务器添加新osm.pbf文件的方法

Adding a second OSM PBF to an existing overv/openstreetmap-tile-server Docker setup

Great question! Let's break down the right approach here:

Core Answer

You should use your first command approach — mount the new PBF file to the default /data.osm.pbf path while reusing the existing openstreetmap-data volume. The second approach (using a custom path like /data2.osm.pbf) won't work because the overv/openstreetmap-tile-server image's import script is hardcoded to look for the input file at /data.osm.pbf.

Why This Works

The image's import process is designed to handle appending data to an existing PostgreSQL database (stored in your openstreetmap-data volume). When you run the import command with the same volume, it detects the existing database and adds the new region's data instead of overwriting what's already there.

Step-by-Step Instructions

  1. Download your new region's PBF file (example with Tanzania):
    wget https://download.geofabrik.de/africa/tanzania-latest.osm.pbf
    
  2. Stop your running tile server container (to avoid database conflicts during import):
    # First get the container ID with docker ps
    docker stop <your-tile-server-container-id>
    
  3. Run the import command with the new PBF:
    docker run -v /home/renderaccount/tanzania-latest.osm.pbf:/data.osm.pbf -v openstreetmap-data:/var/lib/postgresql/12/main overv/openstreetmap-tile-server import
    
  4. Restart your tile server once the import finishes:
    docker start <your-tile-server-container-id>
    # Or re-run your original run command if you prefer:
    # docker run -p 8080:80 -v openstreetmap-data:/var/lib/postgresql/12/main -d overv/openstreetmap-tile-server:1.3.10 run
    

Key Notes

  • Geofabrik's regional PBF files are generally clean and won't cause major conflicts with existing data (like duplicate node IDs), so you shouldn't run into issues merging regions.
  • Import time depends on the size of the new PBF — be patient for larger regions!
  • If you ever need to update existing regions later, you can repeat this process with the latest version of their PBF files (the import script will handle updating the existing data).

内容的提问来源于stack exchange,提问作者dmwpepper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 22:42:48