Overv / openstreetmap-tile-server

Docker file for a minimal effort OpenStreetMap tile server
Apache License 2.0
1.2k stars 482 forks source link

Import command fails for OSM data #404

Open djmakwana opened 9 months ago

djmakwana commented 9 months ago

Hi

I am setting up a map server locally with entire OSM world data downloaded from https://download.geofabrik.de/. I must confess that I am new to this OSM and map tiles. So as a small test, I downloaded South America and Australia regions. I first tried to run the import process twice using docker but second time it failed with some renderer user error. After searching I found this #300. In order to workaround it, I googled and found osmium-tool merge utility. I used it to merge the two small files and created a combined.osm.pbf file. The exact command was run using docker image as

docker run --rm -it -v .:/data stationa/osmium-tool merge --progress /data/australia-oceania-latest.osm.pbf /data/south-america-latest.osm.pbf -o /data/combined.osm.pbf

When I tried to import the combined file, it failed with following error

ERROR: Input data is not ordered: relation id 2202162 appears more than once.

Here's my docker-compose.yml file

version: '3.7'

services:
  map_importer:
    image: overv/openstreetmap-tile-server
    volumes:
      - ./data/osm-data:/data/database/
      - ./data/osm-tiles:/data/tiles/
      - /mnt/data/osm_map_tiles/combined.osm.pbf:/data/region.osm.pbf
    ports:
      - "9090:80"
    command: "import"
    environment:
      - THREADS=12
      - OSM2PGSQL_EXTRA_ARGS=-C 4096

What am I doing wrong? I think there should be no overlap and the merge command is supposed to handle this.

Objects in all files must be sorted by type, ID, and version. The results will also be sorted in the same way. Objects that appear in multiple input files will only be in the output once.