Overv / openstreetmap-tile-server

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

Only renders Luxemburg #392

Open Eric-Arz opened 11 months ago

Eric-Arz commented 11 months ago

Trying to get this working with a custom region and docker compose

---
services:
  tileserver:
    image: overv/openstreetmap-tile-server:latest
    command: run
    restart: always
    ports:
      - 8080:80
    environment:
      - DOWNLOAD_PBF=https://download.geofabrik.de/europe/xx/xx/xx-latest.osm.pbf
      - DOWNLOAD_POLY=https://download.geofabrik.de/europe/xx/xx/xx.poly
    volumes:
      - osm-data:/data/database/

volumes:
  osm-data:

i run docker compose first with "import" and then again with "run". Importing succeeds it writes stuff to the database. Server starts fine but, no matter what pbf i specify the only thing that gets rendered is Luxemburg.

It does download the correct files. Logs from import show:

2023-10-02 10:13:46 (14.3 MB/s) - ‘/data/region.osm.pbf’ saved [84021811/84021811]

Istador commented 11 months ago

I assume you tested it first without the environment variables, then added them and are still running the old version.

When using docker-compose (or docker compose) the command to start the service should be docker-compose up -d and not docker-compose start. Otherwise your changes to the docker-compose.yml will not be applied, but the old container with the old configuration will be started. Starting it with up -d will recreate the container with the new configuration (iff it changes in a way that requires recreating).

You can also do docker-compose down --volumes to delete the already created things.

PeterRangelov commented 11 months ago

I am experiencing the same issue after I run these commands:

docker volume create osm-data

docker run \
-v ~/path-to.osm.pbf:/data/region.osm.pbf \
-v osm-data:/data/database/ \
overv/openstreetmap-tile-server \
import
docker run \
 -p 8080:80 \
-v osm-data:/data/database \
-e ALLOW_CORS=enabled \
-d overv/openstreetmap-tile-server \
run

I see only Luxemburg data on the world map.

acakojic commented 10 months ago

same error. It always render Letzebuerg.

KIlian42 commented 10 months ago

same here, could someone solve it?

Istador commented 10 months ago

Works for me without issues. This is not a problem with the docker image.

Regardeless if I provide a PBF file as a volume, or let the image download it, in both cases it renders Hamburg (Germany) for me as it's suppose to and the Luxemburg region is empty.

I tested both usage scenarios right now in two clean linux VMs (Debian 11 based).

Mount as a volume:

$ wget  https://download.geofabrik.de/europe/germany/hamburg-latest.osm.pbf
$ docker  volume  create  osm-data
$ docker  run  --rm  -v osm-data:/data/database/  -v ./hamburg-latest.osm.pbf:/data/region.osm.pbf  overv/openstreetmap-tile-server  import
$ docker  run  --rm  -v osm-data:/data/database/  -d  -p 80:80  overv/openstreetmap-tile-server  run

Download URL as environment variable:

$ docker  volume  create  osm-data
$ docker  run  --rm  -v osm-data:/data/database/  -e DOWNLOAD_PBF=https://download.geofabrik.de/europe/germany/hamburg-latest.osm.pbf  overv/openstreetmap-tile-server  import
$ docker  run  --rm  -v osm-data:/data/database/  -d  -p 80:80  overv/openstreetmap-tile-server  run

The Luxemburg region is the default fallback region for the docker image to download, if neither a PBF file is present nor a DOWNLOAD_PBF environment variable is provided.

So if the image does download a Luxemburg PBF file, then there is an issue with one of these two things.

Problems with volume mounts are a common issue, especially on Windows machines. If in the import log it does download the Luxemburg PBF file, then the volume mount was not successful and the file doesn't exist for the container.

And when working with docker-compose the container needs to be recreated when changing anything in the service definition. (See my earlier comment here.)


If you need any support for your issues, please provide all the commands that you executed and the full import output.

GerritJahn commented 6 months ago

Hi - need to dig this up again.

I did follow the descriptions and entered:

docker volume create my-osm-data

docker run -v my-osm-data:/data/database/ -e DOWNLOAD_PBF=https://download.geofabrik.de/europe/germany/hessen-latest.osm.pbf overv/openstreetmap-tile-server  import

docker run -p 8085:80 -v my-osm-data:/data/database/ -d overv/openstreetmap-tile-server run

and voila - I can see.... Luxembourg! :-)

The import part seemed to download the data for Hessen (roughly 300MB), but the webpage still shows Luxembourg only.

Any idea?

EDT: for whatever reason - just restarted the image again. I can see now Hessen!

All good so far, did not really understand this, but works apparently as expected. Sorry for the confusion...

IngoKeen commented 2 months ago

I followed the steps on Switch2Osm and also Luxembourg was rendered. Finally I found out that my container was based on an outdated docker image. After updating the image the behavior was as expected