There is a related project which I used several times:<p><a href="https://github.com/anvaka/city-roads" rel="nofollow">https://github.com/anvaka/city-roads</a><p>Edit: it outputs SVGs and you can try it online. Anvaka (author) has other really cool dataviz projects.
San Francisco looks nice, but there seems to be a problem with the projection in some of the sample images. It looks as if it isn't UTM but a global sphere projection, which isn't suitable for local renders. It's suspicious that the word 'projection' isn't mentioned in the Readme.
This is an artistic project to make a fun and artsy poster, so it's not at all "suspicious" that the map projection is not critical to the artwork.<p>It also appears to be open source, so perhaps you can open a pull request with your improvements based on your cartographical experience.
It looks like the final images have some kind of vignetting to make the corners and outter edges fade away. Probably grabbing OSM tiles and doing some image processing.<p>Looks neat!
Great project! It takes a bit of fiddling to get the distance parameter right in some cases, and two possible improvements would be to allow for coordinate input rather than city name so I can point it at a specific spot as the center of the map. Another one would be to output all styles simultaneously so I can visually select from the generated images.<p>Anyhow, nice work. Thanks!
Also check out prettymapp<p><a href="https://prettymapp.streamlit.app/" rel="nofollow">https://prettymapp.streamlit.app/</a>
I believe (from a quick code check on my phone) it should be possible to output the images to SVG with a little tweak, thanks to your use of matplotlib?<p>Is there a reason you’ve defaulted to PNG that I’m missing?
Valid Point @mft_ plt.savefig(output_file, format='svg', facecolor=THEME['bg']) should do it. I will add a --format parameter and make the change.
Holy heck exporting to PDF/SVG for large cities is laggy, just patched the repo and did it for one over half a million people and it’s insanely slow lol
Does anyone have recommendations for how to actually print a poster from images like these?
El-co Color in New Jersey is known for its affordable 20x30" poster prints.<p><a href="https://www.elcocolor.net/index.php/poster-special" rel="nofollow">https://www.elcocolor.net/index.php/poster-special</a>
For what it's worth, I use Vistaprint. That's not based on an extensive comparison, just that it always works for me and seems comparable in price and quality to other services.
For something DIY, Rasterbator.net can make you a poster-sized print in multiple sheets. You’ll need some elbow grease to assemble the print.
In the US, I've had good results with Staples
I remember one of these had a service that made a 3D relief map (3D print) and then framed it, so you could hang it onto a wall.
dotphoto.com
A good print on demand that delivers ?
This repo is fantastic. The README should be the gold standard for OSS. Not to mention how stunning the outputs are. Thanks for sharing.
This really needs to be `uvx` runnable.
That's splendid. I've long wanted to make a jigsaw puzzle out of Sydney's road map, so I can familiarise myself with the layout of roads while having fun. That way I can reduce my reliance on nav app and become one of those old-school drivers.
What 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:<p>Salem, OR and Salem, MA<p>Portland, OR and Portland, ME<p>Springfield, IL and Springfield, MO<p>Dallas, TX and Dallas, GA
Don't even get started on American cities named after world cities: Paris, Munster, London, Toledo, Memphis, Athens,...
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.
lol, I didn't even think of it. May be I should start taking country too. Edge case :-p
Three random themes for anyone who's Czech or likes Prague and doesn't want to set up the script locally: <a href="https://imgur.com/a/Ovg8mDW" rel="nofollow">https://imgur.com/a/Ovg8mDW</a>
I tried it in a python3 venv, but the download data step is stuck at 0% unfortunately.
The bar only updates once that entire step is complete (ie, if step 1 of 3 is downloading roads, it won't tell you what % of roads have been downloaded, but rather it will remain at 0% until all roads are downloaded at which point it will jump to 33%).
It will work, give it time. Also default distance is 29000. Give distance of 10000 to see faster results. It certainly is working as many users have generated maps.
Etsy sellers devastated
Awesome! After I generate, where can I take that super res image and get a high quality photo print to frame?
The map of Venice seems to be the only one whose image is "squeezed" horizontally. Wondering why.
Are you using a coding package or graph-based approach for this, or is it standard image generation? I’ve seen very similar results on <a href="https://picxstudio.com" rel="nofollow">https://picxstudio.com</a> —it’s an AI image generation platform.
<a href="https://maptoposter.penk.in/" rel="nofollow">https://maptoposter.penk.in/</a><p>Using Claude Code and OP's library, I've put it on the internets. Web hosting is cheap(free) and generation takes some time
Pretty cool! It would be great if there was a way to set coordinates manually, since Nominatim can sometimes produce mediocre results. Also, would be nice to have a way to render the same map in all themes, not just one.
These demonstrate just how car-obsessed our society is. Depressing.
Looks amazing !
In my free time, i play with my laser cutting machine.
It will save me some design time.
Thanks
Why are big chunks of Sam Francisco missing (eg around the bridge) missing from the example?
Those smooth chunks are all (mostly) public park land. Known as Presidio and part of the Golden Gate National Recreation Area.
python create_map_poster.py -c "San Francisco" -C "USA" -t sunset -d 10000<p>-d should be approx. 10k to 14k given the size of the city. You can give it a shot.
It says there are examples but I can't see them?
what are the blue dots? (not water bodies i think?)
I was curious about this too and it’s actually a bug— these blue dots are random parks or park features. Most parks are polygons, but less than 5% or them are points from volunteer mappers who didn’t make them polygons and so these stray points seem to slip through and get plotted as the matplotlib default color…<p>If only I knew this before I printed it out and attached it all together with rasterbator lol
Yes, the blue and orange dots are from the water and parks Nodes and Ways in the OSM data.<p>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.
Very cool, thanks for sharing!!
- for those of you that dont want to install this locally, run this inside docker<p>*`Dockerfile`*<p>```
FROM python:3.12.10-slim-bookworm<p>RUN apt-get update -q -y && apt-get install -q -y \
build-essential \
git \
python3-dev \
&& rm -rf /var/lib/apt/lists/*<p>RUN groupadd --gid 10000 python \
&& useradd --uid 10000 --gid python --shell /bin/bash --create-home python<p>WORKDIR /home/python/app<p>RUN git clone <a href="https://github.com/originalankur/maptoposter.git" rel="nofollow">https://github.com/originalankur/maptoposter.git</a><p>RUN chown -R python:python ./maptoposter<p># 5. Switch to non-root user
USER python<p>RUN pip install --no-cache-dir --upgrade pip && \
cd ./maptoposter && \
pip install --no-cache-dir -r requirements.txt<p>CMD ["sleep", "infinity"]<p>```<p>*`main.sh`*<p>```
#!/usr/bin/env bash<p># <a href="https://github.com/originalankur/maptoposter" rel="nofollow">https://github.com/originalankur/maptoposter</a>
# Read the documentation to change themes and settings for each city<p># Get the directory where THIS script is located
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "$SCRIPT_DIR" || exit 1<p># 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"<p>readonly CONTAINER_NAME="map_to_poster"<p>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<p>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<p>container_id=$(docker ps -aqf "name=${CONTAINER_NAME}")<p>if [ -z "$container_id" ]; then
echo "Container not found!"
else
echo "The ID for ${CONTAINER_NAME} is: $container_id"
fi<p>docker exec -i "${CONTAINER_NAME}" /bin/bash << EOF
cd /home/python/app/maptoposter
python create_map_poster.py --city "${CITY}" --country "${COUNTRY}"
EOF<p>mkdir -p "${HOME}/map_to_poster"<p>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<p>if ! docker stop "${CONTAINER_NAME}"; then
printf "Error: %s" "stopping container:${CONTAINER_NAME}"
fi<p>if ! docker rm "${CONTAINER_NAME}"; then
printf "Error: %s" "removing container:${CONTAINER_NAME}"
fi<p>```
Nice! Thanks
[dead]