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.
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.
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.
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?
Is there a reason you’ve defaulted to PNG that I’m missing?
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
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.
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.
There's a reason Where 2 -> Google Maps happened in Sydney. The sheer number of one-way roads combined with the imposition of the harbour and the messy tunnel system make internalising Sydney navigation a life-long endeavour
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:
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.
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.
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 https://picxstudio.com —it’s an AI image generation platform.
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.
The initial version were coordinates actually but then realised people mostly love their cities more than anything and it's easy that way. Will add this feature back as optional parameters.
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…
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.
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.
# 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
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
stanko|1 month ago
https://github.com/anvaka/city-roads
Edit: it outputs SVGs and you can try it online. Anvaka (author) has other really cool dataviz projects.
sandos|1 month ago
Helmut10001|1 month ago
jasongill|1 month ago
It also appears to be open source, so perhaps you can open a pull request with your improvements based on your cartographical experience.
jlarocco|1 month ago
Looks neat!
mvdwoord|1 month ago
Anyhow, nice work. Thanks!
hyperific|1 month ago
https://prettymapp.streamlit.app/
croisillon|1 month ago
mft_|1 month ago
Is there a reason you’ve defaulted to PNG that I’m missing?
originalankur|1 month ago
Footprint0521|1 month ago
nycerrrrrrrrrr|1 month ago
fmajid|1 month ago
https://www.elcocolor.net/index.php/poster-special
jfengel|1 month ago
loloquwowndueo|1 month ago
xnx|1 month ago
1970-01-01|1 month ago
dexterdog|1 month ago
hirako2000|1 month ago
stephenlf|1 month ago
unknown|1 month ago
[deleted]
nl|1 month ago
tianqi|1 month ago
bobnamob|1 month ago
dylan604|1 month ago
Salem, OR and Salem, MA
Portland, OR and Portland, ME
Springfield, IL and Springfield, MO
Dallas, TX and Dallas, GA
MengerSponge|1 month ago
fat_cantor|1 month ago
originalankur|1 month ago
tomashubelbauer|1 month ago
originalankur|1 month ago
xixixao|1 month ago
emaro|1 month ago
NoboruWataya|1 month ago
originalankur|1 month ago
m-hodges|1 month ago
kingforaday|1 month ago
giarc|1 month ago
simonebrunozzi|1 month ago
originalankur|1 month ago
Yash16|1 month ago
mindwork|1 month ago
Using Claude Code and OP's library, I've put it on the internets. Web hosting is cheap(free) and generation takes some time
giarc|1 month ago
Error: Generation failed: ==================================================
Kwpolska|1 month ago
originalankur|1 month ago
colinbartlett|1 month ago
unknown|1 month ago
[deleted]
japoneris|1 month ago
doophus|1 month ago
Sajarin|1 month ago
originalankur|1 month ago
-d should be approx. 10k to 14k given the size of the city. You can give it a shot.
cinntaile|1 month ago
originalankur|1 month ago
arnavpraneet|1 month ago
Footprint0521|1 month ago
If only I knew this before I printed it out and attached it all together with rasterbator lol
thamer|1 month ago
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.
7777777phil|1 month ago
vivzkestrel|1 month ago
*`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
```
giuliomagnifico|1 month ago
SaintQb|1 month ago
[deleted]