openstreetmap-tile-server icon indicating copy to clipboard operation
openstreetmap-tile-server copied to clipboard

Serving path configurable

Open TheGrum opened this issue 3 years ago • 4 comments

My existing OSM installs from pre-Docker availability all use /osm/ as the home of the tiles As far as I can see, this would be changed in two places - /etc/apache2/sites-enabled/000-default.conf AddTileConfig /tile/ default -> AddTileConfig /osm/ default

and /etc/renderd.conf URI=/tile/ -> URI=/osm/

Are these the only points that would need changing?

and for an environment variable change, there is an example in the 000-default.conf file on the errorlog, so it looks like

AddTileConfig /${OSM_TILE_DIR}/ default

would work there. Any idea if the same would work in the renderd.conf? Does that replacement happen before renderd gets its hands on it?

Would

URI=/${OSM_TILE_DIR}/

work there?

Then in the Dockerfile, adding an ENV OSM_TILE_DIR=tile would provide the current semantics and allow the serving folder to be changed externally?

TheGrum avatar Dec 10 '22 18:12 TheGrum

Tested, this does not work. Looks like the Apache2 environment does not pick up the ENV vars from the Dockerfile.

TheGrum avatar Dec 12 '22 13:12 TheGrum

Checkout https://github.com/Overv/openstreetmap-tile-server#preserving-rendered-tiles If you want to reuse your existing directory and point this docker container at it, just mount your directory something like so:

docker run \
    -p 8080:80 \
    -e REPLICATION_URL=https://planet.openstreetmap.org/replication/minute/ \
    -e MAX_INTERVAL_SECONDS=60 \
    -e UPDATES=enabled \
    -v osm-data:/data/database/ \
    -v /osm/:/data/tiles/ \
    -d overv/openstreetmap-tile-server \
    run

not sure from memory if the exact path is correct or if you need to tune the paths a bit more (like adding ajt subpath) Should be easier than messing with all config files :)

nielsole avatar Dec 21 '22 13:12 nielsole

Thanks, but that does not preserve the serving path (i.e. what the tile consumer uses to find the tiles). I ended up handling it by munging it in my go proxy. I did try my suggested solution, thinking to offer a pull request, but it did not work.

TheGrum avatar Dec 21 '22 14:12 TheGrum