-d should be approx. 10k to 14k given the size of the city. You can give it a shot.
Is there a reason you’ve defaulted to PNG that I’m missing?
I have tried adjusting -d, but it only affects the scale.
Here is the command I used: python create_map_poster.py --city Leuven --country Belgium --distance 4000 --theme sunset
It doesn't look like the orange and blue colors are part of the theme definitions, so the rendering library may be using some default values. This is why they are rendered in the same color on images using different theme files.
If only I knew this before I printed it out and attached it all together with rasterbator lol
It also appears to be open source, so perhaps you can open a pull request with your improvements based on your cartographical experience.
Looks neat!
Salem, OR and Salem, MA
Portland, OR and Portland, ME
Springfield, IL and Springfield, MO
Dallas, TX and Dallas, GA
https://github.com/anvaka/city-roads
Edit: it outputs SVGs and you can try it online. Anvaka (author) has other really cool dataviz projects.
Anyhow, nice work. Thanks!
*`Dockerfile`*
``` FROM python:3.12.10-slim-bookworm
RUN apt-get update -q -y && apt-get install -q -y \ build-essential \ git \ python3-dev \ && rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 10000 python \ && useradd --uid 10000 --gid python --shell /bin/bash --create-home python
WORKDIR /home/python/app
RUN git clone https://github.com/originalankur/maptoposter.git
RUN chown -R python:python ./maptoposter
# 5. Switch to non-root user USER python
RUN pip install --no-cache-dir --upgrade pip && \ cd ./maptoposter && \ pip install --no-cache-dir -r requirements.txt
CMD ["sleep", "infinity"]
```
*`main.sh`*
``` #!/usr/bin/env bash
# https://github.com/originalankur/maptoposter # Read the documentation to change themes and settings for each city
# Get the directory where THIS script is located SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) cd "$SCRIPT_DIR" || exit 1
# TODO: kolkata is done already, change to some other city both here and on that notepad.pw link in Chrome readonly CITY="kolkata" readonly COUNTRY="india"
readonly CONTAINER_NAME="map_to_poster"
if ! docker buildx build \ --file "Dockerfile" \ --progress none \ --tag "${CONTAINER_NAME}" \ --quiet .; then printf "Error: %s" "while attempting to build the docker container:${CONTAINER_NAME}" exit 1 fi
if ! docker container run \ --detach \ --interactive \ --name "${CONTAINER_NAME}" \ --tty \ "${CONTAINER_NAME}"; then printf "Error: %s" "while attempting to run the docker container:${CONTAINER_NAME}" exit 1 fi
container_id=$(docker ps -aqf "name=${CONTAINER_NAME}")
if [ -z "$container_id" ]; then echo "Container not found!" else echo "The ID for ${CONTAINER_NAME} is: $container_id" fi
docker exec -i "${CONTAINER_NAME}" /bin/bash << EOF cd /home/python/app/maptoposter python create_map_poster.py --city "${CITY}" --country "${COUNTRY}" EOF
mkdir -p "${HOME}/map_to_poster"
if ! docker cp "${container_id}":/home/python/app/maptoposter/posters "${HOME}/map_to_poster"; then printf "Error: %s" "while attempting to copy map files from container:${CONTAINER_NAME}" fi
if ! docker stop "${CONTAINER_NAME}"; then printf "Error: %s" "stopping container:${CONTAINER_NAME}" fi
if ! docker rm "${CONTAINER_NAME}"; then printf "Error: %s" "removing container:${CONTAINER_NAME}" fi
```
Using Claude Code and OP's library, I've put it on the internets. Web hosting is cheap(free) and generation takes some time
Error: Generation failed: ==================================================