Map To Poster – Create Art of your favourite city
61–70 of 74 posts
Re: Map To Poster – Create Art of your favourite city
#62Earlier quoted context omitted.
Every country has those. There was some that found it very funny when Russia occupied New York last year (or last year again?).
Even the name "New York" is a reference to an existing city...
Re: Map To Poster – Create Art of your favourite city
#63Anyhow, nice work. Thanks!
Re: Map To Poster – Create Art of your favourite city
#64*`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 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
```
Re: Map To Poster – Create Art of your favourite city
#65What happens if there are multiple cities with the same name. Maybe this is a US specific problem, but there are many states with cities of the same name from another state. As a few examples: Salem, OR and Salem, MA Portland, OR and Portland, ME Springfield, IL and Springfield, MO Dallas, TX and Dallas, GA
If you just type "Salem" for the city, it just picks one and goes with it. If you type "Salem, Oregon" vs "Salem, MA", it gives the desired result (at least for the cases I've tried), and then uses your input text as the caption.
Re: Map To Poster – Create Art of your favourite city
#66Earlier quoted context omitted.
Don't even get started on American cities named after world cities: Paris, Munster, London, Toledo, Memphis, Athens,...
Every country has those. There was some that found it very funny when Russia occupied New York last year (or last year again?).
Re: Map To Poster – Create Art of your favourite city
#67Using Claude Code and OP's library, I've put it on the internets. Web hosting is cheap(free) and generation takes some time
Re: Map To Poster – Create Art of your favourite city
#68https://maptoposter.penk.in/ 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: ==================================================
Re: Map To Poster – Create Art of your favourite city
#69Awesome! After I generate, where can I take that super res image and get a high quality photo print to frame?
Re: Map To Poster – Create Art of your favourite city
#70There is a related project which I used several times: https://github.com/anvaka/city-roads Edit: it outputs SVGs and you can try it online. Anvaka (author) has other really cool dataviz projects.