Hacker News new | past | comments | ask | show | jobs | submit login
Prettymapp – Create maps from OpenStreetMap data in a Streamlit webapp (github.com/chrieke)
324 points by hggh on Aug 22, 2023 | hide | past | favorite | 29 comments



For anyone else looking to customize OSM maps, here is a handy Figma plugin that imports OSM data. https://www.figma.com/community/plugin/1251030017228239072/V...


Great work, thanks!

As the example app has been DoS'd, I decided to try and deploy my own on streamlit (having never used it before). The deployment process isn't documented in your project, but it was super easy to do using the upstream docs!

Welcome to try mine: https://wfcmzortl5n8cqhdowr6dm.streamlit.app/


To run it locally, I did:

    pip install -r requirements.txt
    pip install -r requirements-dev.txt
    pip install -r streamlit-prettymapp/requirements.txt
    streamlit run streamlit-prettymapp/app.py
(The `streamlit` command is installed by the third requirements.txt)

It does properly show the Macau map, but is hanging on `Creating map... (may take up to a minute)`; I wonder if there's an OSM api key that is not working, or something like that.

edit: looks like the issue is just that it's very slow in places with a decent amount of OSM stuff? It's actually hanging on converting the OSM to geometries, as it tries to convert 400k objects

edit 2: https://github.com/chrieke/prettymapp/issues/26


Well it didn't last long


Argh! It looks like a badly handled error in the app, which I can't blame the platform for... but it looks like the platform gives great access to error logging

I've "rebooted" the app, but no idea how long it will last again!

  ```
  /home/adminuser/venv/lib/python3.9/site-packages/geopandas/array.py:158: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
  return GeometryArray(vectorized.from_shapely(data), crs=crs)
  /home/adminuser/venv/lib/python3.9/site-packages/geopandas/array.py:158: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
  return GeometryArray(vectorized.from_shapely(data), crs=crs)
  [15:49:17]  Streamlit server consistently failed status checks
  [15:49:17]  Please fix the errors, push an update to the git repo, or reboot the app.
  ```


> but it looks like the platform gives great access to error logging

Where do you see errors in the log? In the snippet you shared, I see only a couple warning then "please fix the errors".


As the site owner of MY deployment, it gives me a box down the bottom right which also allows me to restart the app. It's worth deploying it yourself to experiment with the platform.

  1) Fork the app in Github
  2) Create an account on https://streamlit.io/
  3) New app, and link to your fork in Github


Also hugged to death ;)


Wow. This is great. Is there API documentation? I'd love to be able to center the map at a GPS location instead of a city/town name. If I use my city's name, I find that it uses the city center, which is a reasonable default, but my neighborhood is actually quite far from that so it does not appear on the map unless I zoom way out.


Examining the source, you can use coordinates instead of address when calling get_aoi.

https://github.com/chrieke/prettymapp/blob/main/prettymapp/g...


Excellent, thanks!


Discussed a number of times in the past https://hn.algolia.com/?q=Prettymap


From the README:

> Prettymapp is based on a rewrite of the fantastic prettymaps project by @marceloprates.


They should have maybe gone with a name that pays tribute but differentiates. PrettiMapp? French derived: JoliesCarte? BellesCartes? JollyCart? BellCart?

edit: those sound like ecommerce spots. What about CharMApp?


Can anyone help clarify what license this is released under? The original was AGPL if the rewrite is permissively licensed that would be pretty cool.



It’s MIT but based on an AGPL project? Hmm. Something is fishy.


Probably just an honest mistake. But they should definitely look into fixing that.


The original is AGPL, and the new one is MIT. I wonder if that's even legal?

I'm not sure if this is really a rewrite, or simply an adaptation. I don't think the license could have changed, be advised.


Why would that be "pretty cool"?


Etsy store generator


Interesting app. I have also really enjoyed customizing maps in Ortelius which is no longer around. And also Felt at felt.com


Maptiler has a nice SAAS service. We use their vector maps with maplibre. Nice company trying to carve out a business in this space with decent tools, maps, and they are a major open source contributor as well. Several of their tools are opensource and you can self host.

Some nice examples of themed maps on their website.


It's funny when different incarnation of thing people wants happens

mainstream functional programming => expected (Ocamal/haskel) => got js libary with functionalness (REACT)

Immediate mode GUI => expected (imgui) => gardio/streamlit

i have not tried gardio/streamlit myself but quick glance that's what it feels like


HN killed your app!


This is beautiful and great for gifting. Thank you.


Hey, haven't looked at it yet, but what does this have over streamlit-folium, which can also do OSM?


Ok, I misunderstood, this is quite different


hn hug of death




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: