28 comments

  • stanko20 days ago
    There is a related project which I used several times:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;anvaka&#x2F;city-roads" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;anvaka&#x2F;city-roads</a><p>Edit: it outputs SVGs and you can try it online. Anvaka (author) has other really cool dataviz projects.
    • sandos18 days ago
      Kinda sad that maptoposter uses png. SVG is so much better in this case, if you want to actually print a poster!
      • PetahNZ17 days ago
        It does support SVG, --format=svg
  • Helmut1000120 days ago
    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&#x27;t UTM but a global sphere projection, which isn&#x27;t suitable for local renders. It&#x27;s suspicious that the word &#x27;projection&#x27; isn&#x27;t mentioned in the Readme.
    • jasongill20 days ago
      This is an artistic project to make a fun and artsy poster, so it&#x27;s not at all &quot;suspicious&quot; 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.
      • Helmut1000120 days ago
        You are absolutely correct. Suspicious was the wrong word and I did not mean to criticize the author or the work.
    • jlarocco20 days ago
      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!
  • mvdwoord20 days ago
    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!
  • hyperific20 days ago
    Also check out prettymapp<p><a href="https:&#x2F;&#x2F;prettymapp.streamlit.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;prettymapp.streamlit.app&#x2F;</a>
    • croisillon20 days ago
      and <a href="https:&#x2F;&#x2F;anvaka.github.io&#x2F;city-roads" rel="nofollow">https:&#x2F;&#x2F;anvaka.github.io&#x2F;city-roads</a>
  • mft_21 days ago
    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?
    • originalankur21 days ago
      Valid Point @mft_ plt.savefig(output_file, format=&#x27;svg&#x27;, facecolor=THEME[&#x27;bg&#x27;]) should do it. I will add a --format parameter and make the change.
    • Footprint052120 days ago
      Holy heck exporting to PDF&#x2F;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
      • originalankur20 days ago
        There is throttling in the code when making api request to respect the map provider as per their terms and conditions. Can make few thing parallel but it&#x27;s a hobby project how many posters would one person want to generate?.
  • nycerrrrrrrrrr20 days ago
    Does anyone have recommendations for how to actually print a poster from images like these?
    • fmajid20 days ago
      El-co Color in New Jersey is known for its affordable 20x30&quot; poster prints.<p><a href="https:&#x2F;&#x2F;www.elcocolor.net&#x2F;index.php&#x2F;poster-special" rel="nofollow">https:&#x2F;&#x2F;www.elcocolor.net&#x2F;index.php&#x2F;poster-special</a>
    • jfengel20 days ago
      For what it&#x27;s worth, I use Vistaprint. That&#x27;s not based on an extensive comparison, just that it always works for me and seems comparable in price and quality to other services.
    • loloquwowndueo20 days ago
      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.
    • xnx20 days ago
      In the US, I&#x27;ve had good results with Staples
    • 1970-01-0120 days ago
      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.
    • dexterdog20 days ago
      dotphoto.com
    • hirako200020 days ago
      A good print on demand that delivers ?
  • stephenlf20 days ago
    This repo is fantastic. The README should be the gold standard for OSS. Not to mention how stunning the outputs are. Thanks for sharing.
  • nl20 days ago
    This really needs to be `uvx` runnable.
  • tianqi21 days ago
    That&#x27;s splendid. I&#x27;ve long wanted to make a jigsaw puzzle out of Sydney&#x27;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.
    • bobnamob21 days ago
      There&#x27;s a reason Where 2 -&gt; 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
  • dylan60420 days ago
    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
    • MengerSponge20 days ago
      Don&#x27;t even get started on American cities named after world cities: Paris, Munster, London, Toledo, Memphis, Athens,...
      • tokai20 days ago
        Every country has those. There was some that found it very funny when Russia occupied New York last year (or last year again?).
        • netsharc20 days ago
          Even the name &quot;New York&quot; is a reference to an existing city...
          • MengerSponge20 days ago
            But they had the decency to append &quot;New&quot;. New Birmingham? New Athens? New Madrid? These are cyberpunk city names.
        • ornornor19 days ago
          There is a Suisse in France, but no France in Switzerland afaik
    • fat_cantor20 days ago
      If you just type &quot;Salem&quot; for the city, it just picks one and goes with it. If you type &quot;Salem, Oregon&quot; vs &quot;Salem, MA&quot;, it gives the desired result (at least for the cases I&#x27;ve tried), and then uses your input text as the caption.
      • vivzkestrel20 days ago
        there is also a salem in tamil nadu india
    • originalankur20 days ago
      lol, I didn&#x27;t even think of it. May be I should start taking country too. Edge case :-p
  • tomashubelbauer21 days ago
    Three random themes for anyone who&#x27;s Czech or likes Prague and doesn&#x27;t want to set up the script locally: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;Ovg8mDW" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;Ovg8mDW</a>
    • originalankur20 days ago
      Looks beautiful. The gold+dark color does justice.
    • xixixao20 days ago
      What’s up with the Zizkovska tower highlight?
  • emaro21 days ago
    I tried it in a python3 venv, but the download data step is stuck at 0% unfortunately.
    • NoboruWataya20 days ago
      The bar only updates once that entire step is complete (ie, if step 1 of 3 is downloading roads, it won&#x27;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%).
      • emaro16 days ago
        Thank you, it worked with the help of your tips!
    • originalankur21 days ago
      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.
      • originalankur21 days ago
        Also note that as per their terms and conditions I need to give a user agent, so multiple users will be sharing same user agent right now.
  • m-hodges20 days ago
    Etsy sellers devastated
  • kingforaday20 days ago
    Awesome! After I generate, where can I take that super res image and get a high quality photo print to frame?
    • giarc18 days ago
      Really depends on country you live in. Just google local printers and email them.
  • simonebrunozzi21 days ago
    The map of Venice seems to be the only one whose image is &quot;squeezed&quot; horizontally. Wondering why.
    • originalankur21 days ago
      need to take into consideration the length and width of the city and choose distance appropriately. I haven&#x27;t followed my own suggestion here - <a href="https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;maptoposter?tab=readme-ov-file#distance-guide" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;maptoposter?tab=readme-ov-f...</a> will fix.
      • hehe2320 days ago
        Hi! I generated a map as well, but indeed, the map is squeezed horizontally. I have here a screenshot from a map and the poster: <a href="https:&#x2F;&#x2F;photos.diffop.be&#x2F;apps&#x2F;photos&#x2F;public&#x2F;h6JKMJImLZCXutcTJDSs3bZ8PNIPUe6g" rel="nofollow">https:&#x2F;&#x2F;photos.diffop.be&#x2F;apps&#x2F;photos&#x2F;public&#x2F;h6JKMJImLZCXutcT...</a><p>I have tried adjusting -d, but it only affects the scale.<p>Here is the command I used: python create_map_poster.py --city Leuven --country Belgium --distance 4000 --theme sunset
  • Yash1620 days ago
    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:&#x2F;&#x2F;picxstudio.com" rel="nofollow">https:&#x2F;&#x2F;picxstudio.com</a> —it’s an AI image generation platform.
  • mindwork19 days ago
    <a href="https:&#x2F;&#x2F;maptoposter.penk.in&#x2F;" rel="nofollow">https:&#x2F;&#x2F;maptoposter.penk.in&#x2F;</a><p>Using Claude Code and OP&#x27;s library, I&#x27;ve put it on the internets. Web hosting is cheap(free) and generation takes some time
    • giarc18 days ago
      I get an ambiguous error when submitting a request.<p>Error: Generation failed: ==================================================
      • mindwork18 days ago
        yup, something to fix in the future. I suspect it couldn&#x27;t find city coordinates
  • Kwpolska20 days ago
    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.
    • originalankur20 days ago
      The initial version were coordinates actually but then realised people mostly love their cities more than anything and it&#x27;s easy that way. Will add this feature back as optional parameters.
  • colinbartlett20 days ago
    These demonstrate just how car-obsessed our society is. Depressing.
  • japoneris20 days ago
    Looks amazing ! In my free time, i play with my laser cutting machine. It will save me some design time. Thanks
  • doophus21 days ago
    Why are big chunks of Sam Francisco missing (eg around the bridge) missing from the example?
    • Sajarin21 days ago
      Those smooth chunks are all (mostly) public park land. Known as Presidio and part of the Golden Gate National Recreation Area.
    • originalankur21 days ago
      python create_map_poster.py -c &quot;San Francisco&quot; -C &quot;USA&quot; -t sunset -d 10000<p>-d should be approx. 10k to 14k given the size of the city. You can give it a shot.
  • cinntaile21 days ago
    It says there are examples but I can&#x27;t see them?
    • originalankur21 days ago
      Please check on desktop, the table is hiding images in responsive mode - You can see the images on X here <a href="https:&#x2F;&#x2F;x.com&#x2F;getpy&#x2F;status&#x2F;2009255303775174684" rel="nofollow">https:&#x2F;&#x2F;x.com&#x2F;getpy&#x2F;status&#x2F;2009255303775174684</a>
      • cinntaile21 days ago
        Thanks, I didn&#x27;t notice there was another column that I could sidescroll to!
  • arnavpraneet20 days ago
    what are the blue dots? (not water bodies i think?)
    • Footprint052120 days ago
      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
    • thamer20 days ago
      Yes, the blue and orange dots are from the water and parks Nodes and Ways in the OSM data.<p>It doesn&#x27;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.
  • 7777777phil20 days ago
    Very cool, thanks for sharing!!
  • vivzkestrel20 days ago
    - 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 &amp;&amp; apt-get install -q -y \ build-essential \ git \ python3-dev \ &amp;&amp; rm -rf &#x2F;var&#x2F;lib&#x2F;apt&#x2F;lists&#x2F;*<p>RUN groupadd --gid 10000 python \ &amp;&amp; useradd --uid 10000 --gid python --shell &#x2F;bin&#x2F;bash --create-home python<p>WORKDIR &#x2F;home&#x2F;python&#x2F;app<p>RUN git clone <a href="https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;maptoposter.git" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;maptoposter.git</a><p>RUN chown -R python:python .&#x2F;maptoposter<p># 5. Switch to non-root user USER python<p>RUN pip install --no-cache-dir --upgrade pip &amp;&amp; \ cd .&#x2F;maptoposter &amp;&amp; \ pip install --no-cache-dir -r requirements.txt<p>CMD [&quot;sleep&quot;, &quot;infinity&quot;]<p>```<p>*`main.sh`*<p>``` #!&#x2F;usr&#x2F;bin&#x2F;env bash<p># <a href="https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;maptoposter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;originalankur&#x2F;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 -- &quot;$(dirname -- &quot;${BASH_SOURCE[0]}&quot;)&quot; &amp;&gt; &#x2F;dev&#x2F;null &amp;&amp; pwd) cd &quot;$SCRIPT_DIR&quot; || 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=&quot;kolkata&quot; readonly COUNTRY=&quot;india&quot;<p>readonly CONTAINER_NAME=&quot;map_to_poster&quot;<p>if ! docker buildx build \ --file &quot;Dockerfile&quot; \ --progress none \ --tag &quot;${CONTAINER_NAME}&quot; \ --quiet .; then printf &quot;Error: %s&quot; &quot;while attempting to build the docker container:${CONTAINER_NAME}&quot; exit 1 fi<p>if ! docker container run \ --detach \ --interactive \ --name &quot;${CONTAINER_NAME}&quot; \ --tty \ &quot;${CONTAINER_NAME}&quot;; then printf &quot;Error: %s&quot; &quot;while attempting to run the docker container:${CONTAINER_NAME}&quot; exit 1 fi<p>container_id=$(docker ps -aqf &quot;name=${CONTAINER_NAME}&quot;)<p>if [ -z &quot;$container_id&quot; ]; then echo &quot;Container not found!&quot; else echo &quot;The ID for ${CONTAINER_NAME} is: $container_id&quot; fi<p>docker exec -i &quot;${CONTAINER_NAME}&quot; &#x2F;bin&#x2F;bash &lt;&lt; EOF cd &#x2F;home&#x2F;python&#x2F;app&#x2F;maptoposter python create_map_poster.py --city &quot;${CITY}&quot; --country &quot;${COUNTRY}&quot; EOF<p>mkdir -p &quot;${HOME}&#x2F;map_to_poster&quot;<p>if ! docker cp &quot;${container_id}&quot;:&#x2F;home&#x2F;python&#x2F;app&#x2F;maptoposter&#x2F;posters &quot;${HOME}&#x2F;map_to_poster&quot;; then printf &quot;Error: %s&quot; &quot;while attempting to copy map files from container:${CONTAINER_NAME}&quot; fi<p>if ! docker stop &quot;${CONTAINER_NAME}&quot;; then printf &quot;Error: %s&quot; &quot;stopping container:${CONTAINER_NAME}&quot; fi<p>if ! docker rm &quot;${CONTAINER_NAME}&quot;; then printf &quot;Error: %s&quot; &quot;removing container:${CONTAINER_NAME}&quot; fi<p>```
  • giuliomagnifico21 days ago
    Nice! Thanks
  • SaintQb10 days ago
    [dead]