[HN Gopher] City Roads - Draw all roads in a city at once ___________________________________________________________________ City Roads - Draw all roads in a city at once Author : jordinebot Score : 211 points Date : 2020-01-22 18:29 UTC (4 hours ago) (HTM) web link (anvaka.github.io) (TXT) w3m dump (anvaka.github.io) | glitcher wrote: | Awesome project, love the output! | | My wishlist item would be to have an option to render an | additional x miles around the city limits boundaries to help | incorporate communities that have the same city in their address | but are technically not within the city limits. | movablepoint wrote: | Nice work! Easy to use (and fast). | | Reminds me of this print I still have on my wall called "All | Streets Limited" by Ben Fry. | anvaka wrote: | Thank you! | ajsharp wrote: | This is incredibly cool. Cheers. | anvaka wrote: | Thank you ! | chadlavi wrote: | Huh, didn't find my hometown somehow. Dies this only work for | cities over a certain size? | anvaka wrote: | If you are able to find your town here | https://nominatim.openstreetmap.org/ - and the osm type for the | found place is "relationship" not node - it should work. | | We are trying to find a fallback for `node` types here | https://github.com/anvaka/city-roads/issues/7 - we basically | don't have accurate city boundaries for nodes. | jdboyd wrote: | It's really simple looking, but I entered my city, and I just | love the graphic that was rendered. Is there any chance of making | it produce SVGs to download? | parekhnish wrote: | Yes, but it is (as of this moment) an experimental feature. Add | "?svg=1" to the end of the URL to enable this feature [0]. | | [0]: https://github.com/anvaka/city-roads/issues/4 | anticensor wrote: | I misread it as the website that _tenders_ every single road | within a city. | seaish wrote: | Apparently it can't load all of California, but other than that, | this is really cool. | anvaka wrote: | Locally it is limited by ram, video card capabilities. Remotely | it depends on overpass turbo API being able to process huge | request s. Which error do you see? | ademars94 wrote: | It would be really neat to be able to set a custom resolution to | render as a .png image. Like e.g. if somebody wanted to create a | poster. | Sohcahtoa82 wrote: | It's definitely missing a lot of roads in my city. | | Compare it's view to Beaverton, Oregon: | https://anvaka.github.io/city-roads/?q=Beaverton%2C%20OR&are... | | With the Google Maps view: | https://www.google.com/maps/@45.5029349,-122.8365195,13.75z | | It's like most of the Cedar Hills neighborhood doesn't exist. It | also drew a line for a power line where there is no road. | jmkb wrote: | OpenStreetMap's definition of Beaverton is quite complicated: | https://www.openstreetmap.org/relation/423111 It includes | several cut-outs for neighborhoods (including Cedar Hills) and | other features. I'd guess that the OSM mappers were trying to | represent a particular legal definition of the Beaverton city | limits. How accurate it is, I wouldn't know. | | Perhaps in situations like this, "City Roads" might consider | ignoring the cut-out enclaves and just using the mulipolygon's | outer boundaries. | | The power line showing up as a road is a mystery. If you can | locate the corresponding feature on OSM you might want to | investigate it. (There may in fact be a road or trail of some | sort, though -- it's common for powerlines to have a track for | maintenance vehicles.) | maxerickson wrote: | The boundary was initially imported from US Census Bureau | data, which frequently does attempt to follow actual | administrative boundaries. | | The source data tends to not be incredibly accurate. | Sohcahtoa82 wrote: | There's definitely a little bit of fuckery regarding | Beaverton's borders. | | My mailing address is in Beaverton, but OSM thinks it's | Aloha. My zip code according to the post office is 97003, but | some map software rejects it as non-existent, or forces a | change to 97006. | | OSM's Portland borders also definitely don't match what | mailing addresses are there. I used to live in apartments off | of NW 185th near US-26, which most people would call | Beaverton, but my mailing address was Portland, but I was at | least 4 miles from anywhere people would actually call | Portland. | | I wonder how common these confusing city limits are in other | metro areas. | KingMachiavelli wrote: | What OSM shows as matching the relation to the city is very | strange. The boundary is so folded that I can't tell which | parts are inside and which parts are very carefully excluded... | If you look at other cities vs yours on OSM you'll see that it | looks like most of Cedar Hills is excluded on OSM or rather the | roads are their but it doesn't consider them part of the city. | | Denver, CO: https://www.openstreetmap.org/relation/253750 | | Beaverton, Oregon: | https://www.openstreetmap.org/relation/423111 | anvaka wrote: | Hey there, I'm the author of the tool! | | Just wanted to thank you for the comments, feedback and shares! I | 'm very happy! | | PS: If you liked that project you may find my other stuff | interesting: | https://twitter.com/search?q=from%3Aanvaka%20min_retweets%3A... - | it's just a hobby but I love it :D | oh_sigh wrote: | I don't know if open street data let's you monetize like this, | but consider adding a link to Shutterfly or some similar site | that would let the user get their road network of choice be | printed out on a mug or t shirt. | | A site featured on hn a few weeks ago which showed height | renderings of various locales let you do something like that. | rhn_mk1 wrote: | OpenStreetMap data license (ODBL) allows any use of | renderings as long as attribution is present, and that | modifications to the data have been made available under | ODBL. | tnorthcutt wrote: | That one is also from anvaka :) | oh_sigh wrote: | Funny. I wonder if the similar visual styles led me to | connect the two despite not even remembering what exactly | the terrain height mapping one was. | | Now I feel kind of silly suggesting to this person a great | idea that was actually...their own. | cglace wrote: | Do you remember the site that was submitted? | jesterpm wrote: | Peak map: Visualize the elevation of any area using a | ridgeline chart | | https://news.ycombinator.com/item?id=21968874 | anvaka wrote: | Oh! This one is fun :)! | jschwartzi wrote: | Bonus points if you let me add UTM or Lat+Long | coordinates to have marks appear for the peaks I've | bagged on the peak map. Then I can buy a mug or print a | poster that lists all the peaks I've bagged or intend to | bag. | windthrown wrote: | This is already incorporated into the site. After the roads | render, click "Customize", then "Onto a mug" and a link to | zazzle.com will open to order a mug. | ym705 wrote: | Your projects are awesome anvaka! Please continue doing those! | anvaka wrote: | Sincerely thank you. I'm so happy to know this! | bduerst wrote: | Well done. If possible, can you add functionality for: | | - Pre-saved color swatches to cycle through, like those at | color.adobe.com/trends | | - Custom cell phone cases. A bunch like casetify offer | affiliate revenue. | iagovar wrote: | It's pretty cool mate. Gonna make a wallpaper with it. | anvaka wrote: | Yay! I'd love to know how it goes! I'm myself not sure what | would be the best resolution and line thickness to do | wallpapers. If you find something appealing - please share? | pfundstein wrote: | Tokyo (massive map) seems a bit buggy, and there's several | distinct groups of roads loading. Awesome tool nonetheless! | jolmg wrote: | It seems they're islands that are also part of Tokyo. | From[1]: | | > Also within the administrative boundaries of Tokyo | Metropolis are two island chains in the Pacific Ocean | directly south: the Izu Islands, and the Ogasawara Islands | | [1] https://en.wikipedia.org/wiki/Tokyo | dvasdekis wrote: | Typed in 'Brisbane', an Australian city of 3 million, but the | only result that came up was Brisbane, Santa Monica. | | Any thoughts on international support? :) | anvaka wrote: | I see that it is defined as `node` in osm: | https://nominatim.openstreetmap.org/details.php?place_id=164... | | We need `relationship` osm type to get the boundaries... | | There is an ongoing discussion on the repository to give a | better fallback: https://github.com/anvaka/city-roads/issues/7 | subterrane wrote: | It renders footways as roads so don't use this while driving. :D | Treblemaker wrote: | Would love to find something like this for rural areas. Maddening | sometimes how details disappear from most online maps based only | on zoom level rather than on feature density. | anvaka wrote: | as long as there is openstreetmap data for it It should work | for rural areas as well :) | MacKay wrote: | was able to do Cape Breton Island [1], maps look really nice! | | [1]: https://i.imgur.com/I7q7Ttv.png | londons_explore wrote: | Did you compare to a regular old canvas doing path calls? | | Or SVG? | | Most web browsers these days should GPU accelerate line drawing, | making the whole lot one single openGL/directX/vulkan api call. | | If it doesn't perform equivalently, it's really a browser bug, | and ought to be fixed. | izzydata wrote: | My neighborhood was non-existant between the two cities that end | on both sides of it. | keyle wrote: | Export to something printable would be really neat. The export to | PNG is cute but it's 2K wide, not useful for anything but | potentially a desktop background. | c0nsumer wrote: | Neat, but this does not seem to be all roads, it seems to be | everything tagged highway=*. | | Specifically, non-motorized walking/biking paths and mountain | bike trails (highway=path) are rendered. | | Ref: https://anvaka.github.io/city- | roads/?q=Marquette%2C%20MI&are... | jlv2 wrote: | In my case, I noticed many driveways were rendered when I did | my town. | fralewsmi wrote: | Same here, was interested to see it was only certain suburbs | which had the driveways mapped. | anvaka wrote: | Do you guys think it would be worth removing the foot | paths? Someone here proposes to remove them altogether: | https://github.com/anvaka/city-roads/issues/3 - I'm not | sure yet which direction would make more sense? | chillly wrote: | The site times out, YC has struck. | | It says it is contacting openstreetmaps, but the global mapping | community is called openstreetmap (no 's'). | anvaka wrote: | Will fix the name! Thanks for catching | tantalor wrote: | Can I play Pac-Man on it? | crazygringo wrote: | I love how elegant it is! | | Unfortunately it can't seem to find most cities I try. Just one | example, typing "New Hartford" only finds one in Iowa, instead of | listing all of them [1]. Most other medium-sized towns I tried | show no results at all. | | I'd also love it if there were a way to export as SVG's -- these | seem like they would make amazing posters to frame. | | [1] https://en.wikipedia.org/wiki/New_Hartford | anvaka wrote: | Thank you! | | I checked here | https://nominatim.openstreetmap.org/search.php?q=New+Hartfor... | - looks like all other `New Hartford` have type "node" in the | database, which doesn't give boundaries of the cities. | | We are thinking about fallback here: | https://github.com/anvaka/city-roads/issues/7 but what might | work better in short term: try entering a county name, and then | zoom in onto the place. It is not as convenient as having a | city boundaries, sorry about that. | crazygringo wrote: | Ah the counties work great! Never even would have occurred to | me. And honestly, for many medium-sized towns, the county is | more intuitive boundary anyways. | | Since it's not clear you could search by county, may I | suggest including that as a tip or something? Otherwise it | gives the impression the site is broken somehow. | ppod wrote: | Very nice, customisable colours for water and different land | types would be great. | ohlookabird wrote: | It looks great, but is the rendering of the OSM data the main | thing or am I overlooking a feature here? | Mathnerd314 wrote: | from the GitHub: "beautiful art" | | I think the main feature is buying the rendering as a coffee | mug. | anvaka wrote: | Lol | | I hope it has more potential than art, though art in itself | is very strong and inspirational thing! | | For example, one could use this tool to debug missing areas | in OSM. You could also use it as a source of large natural | graphs to study network flow, deseas propgation, etc. | | Finally it could also be used for educational purposes: you | could show various graph algorithms on this data with | something more realistic than abstract graphs :) | irrational wrote: | I did my city. Lots of streets (that are decades old) are not on | there, including the street that my house is on (which has been | there since at least 1970). Other streets cut out and then pick | back up a half mile or so later. What happened to the road in | between those two points? | krzyk wrote: | I see an empty page when I enter my city (after it downloads it, | I disabled uBlock but that didn't change anything) :( | anvaka wrote: | Interesting! What's the city name? | anon767 wrote: | My Girlfriend is an architect and she finds this tool great :) | She asks if it would be possible to export these maps as .dwg | file | maxerickson wrote: | The data is coming from OpenStreetMap, via http://overpass- | api.de/ | | It's kind of overwhelming, but there's all sorts of tools that | can take OSM data and do something with it. | oxplot wrote: | Export to svg as explained in another comment, open with | inkscape and export to dwg. | werber wrote: | Unable to export to png in Safari on iPhone xs | exdsq wrote: | It's interesting to see how some cities are spread out. For | instance, Aleppo is pretty interesting in that it has clusters of | compact streets growing out of the center. | thunderbong wrote: | Beautiful! I tried it with quite a few cities. Most of the cities | hardly look as if they were planned out! | | A few from the Wikipedia list [0] looks nice though. | | [0]: https://en.wikipedia.org/wiki/Planned_cities | | Quezon City: https://anvaka.github.io/city-roads/?q=Quezon | City&areaId=3600106569 | | Chandigarh: https://anvaka.github.io/city- | roads/?q=Chandigarh&areaId=360... | | Singapore: https://anvaka.github.io/city- | roads/?q=Singapore&areaId=3600... | ksbakan wrote: | Wow this thing is fast! | | I expected lag on my phone but it works great. | dvtrn wrote: | Yeah I was genuinely blown away by how fast this rendered every | street in Chicago on mobile, a very side-street dense city. | anvaka wrote: | thank you :)! | sethammons wrote: | > Something went wrong. The error was: | | > { "statusError": 504, "message": "Unexpected status code 504 | when calling https://overpass.openstreetmap.ru/cgi/interpreter" } | | And the referenced url 404s | asdasdasdasdwd wrote: | Try a smaller city. This rendered almost immediately for me: | https://anvaka.github.io/city-roads/?q=La%20Plata%2C%20Argen... | sethammons wrote: | Now the site is not loading at all for me. Oops, there it | goes. I think it could be overwhelmed. | | I think it just does not have data on smaller towns and | cities. I've tried several US smaller cities and nothing | works. However, your link does. I can get San Diego and | Irvine, CA. But I can't get Redlands or Yucaipa, CA. I can't | get Polson, MT (nor Kalispell nor Helena). | | Edit: Update - Finally got some data on Polson, MT. | anvaka wrote: | Sorry it takes so long sometimes! I assume overpass (the | back end that gives data) may experience higher loads which | would affect response time! But glad it finally worked! | anvaka wrote: | To fetch the roads I use overpass turbo API. They are | sometimes slow and timeout and sometimes limit amount of | requests that we can send. So I found three endpoints of | overpass turbo and rotate between them: in case when one | fails I go to the next one. If none was able to handle the | request, I bail out and show the error. | | That said, I also cached 3,000 cities with population over | 100k citizens and try the cache first, before going to | overpass. That may be the reason why it is fast in some cases | and slow in others. | | By the way if someone has more stable/fast overpass endpoints | - I will be happy to add them to the list! | reaperducer wrote: | _Try a smaller city. This rendered almost immediately for me_ | | I tried Sandy Valley, Nevada. Doesn't get much smaller than | that. | | Unexpected status code 504 when calling | https://overpass.openstreetmap.ru/cgi/interpreter ___________________________________________________________________ (page generated 2020-01-22 23:00 UTC)