Get the top HN stories in your inbox every day.
semi-extrinsic
noiv
It's JavaScript and exposes an extensive API via console: https://github.com/anvaka/city-roads/blob/main/API.md#loadin...
Liftyee
In the age of bloated resource hogs, I was pleasantly surprised that this rendered with no perceptible lag or stuttering, even on my phone. Impressive how everything is drawn so efficiently.
undefined
mrbluecoat
I agree. The pinch zoom was also buttery smooth. Nice job!
Defenestresque
The hobby-sized projects/videos on your Twitter are mesmerizing: https://x.com/anvaka
Talk about a true hacker mindset. Great bloody job!
hiatus
Link to the github project: https://github.com/anvaka/city-roads
stevage
So, it's a filter on OpenStreetMap to retrieve all ways with a highway=* tag, and draw them identically?
I think a much faster and easier way to implement this would be using existing sources of vector tiles, but scaled down. You could probably even just use Mapbox GL JS, and scale the whole canvas down by a factor of 4 or something, to avoid the issue of small roads not being present at city-scale zoom levels.
thih9
OSM content attribution is missing (either not added or getting clipped) when the data is exported for printing on a mug.
matsemann
Do you need the attribution when you print it on a mug for personal use?
maxerickson
That's the terms of the ODBL (produced work in section 4).
Pedantically, in this case, it isn't personal use either (the site is using the produced image to offer a mug for sale).
Note that this isn't necessarily an endorsement of those terms.
walski
I get a 403 for some cities. E.g. Wyk (auf Föhr) returns 403 on this .pbf resource: https://city-roads.s3-us-west-2.amazonaws.com/nov-02-2020/36...
pmg101
If you choose Brighton and zoom in on Hove Park you see the fingerprint maze there very beautifully rendered as a vector, amazing OSM has this detail!
JSR_FDED
I was intrigued by how many of the 3000 cities you’ve cached I had heard of. You used population size >100k as cutoff, it would be interesting to compare how many cities someone has heard of with their population size.
This would be a fun metric to rate someone’s “global orientation”.
Only recognize the cities with >1M people? Low GO score (or more charitably, high Local Focus score :-)
rplnt
There are many quizzes like that on Sporcle.
myroon5
links:
https://www.sporcle.com/games/g/populouscities
https://www.sporcle.com/games/Wrightboy05/50-biggest-cities-...
https://www.sporcle.com/games/Wrightboy05/100-biggest-cities...
https://www.sporcle.com/games/eliasostnas/top-100-most-popul...
https://www.sporcle.com/games/MapleLeaf/world200
https://www.sporcle.com/games/vanderbizzle2014/300-largest-c...
crabmusket
I have a map of Brugge (Bruges) from this tool printed off on my wall. It's a great concept!
lippihom
Was hoping to do something like this but have had the formatting always come out wonky. Any tips?
lippihom
Ah I figured it out, didn't see the export to .svg under "Customize".
anvaka
oh wow. Glad you liked it!
rl_for_energy
One of those simple charming tech experiences. Thanks for sharing!
latkin
In case others gave up, it took about 2.5 minutes to load my (midsize city) hometown from OpenStreetMap. So hang in there.
remram
Probably going to hit the paradox here, where most people are going to request a place where many people live, even though most places are small.
I probably have no chance, living in NYC.
zactato
I would expect the opposite with a basic LRU cache before the fetch to OSM
remram
That's fair unfortunately it's not what happened :-(
dotancohen
I'm in a city well under 50,000 people not in the Americas nor Europe. The site gave a message that it was retrieving the data from OSM, then rendered the map faster than the browser would render a png. Very impressive.
sandworm101
I'm at 10 minutes now, for a town of <15k. Render time might depend more on total area than number of lines to draw. Update: gave up after 20min. Something might be wrong with the particular city.
fnordpiglet
Render time for Seattle is a blink of the eye which has both area and density. I think the time people is observing is loading the raw data from open street map itself.
Capricorn2481
Because they cache the biggest cities in the world.
> To improve the performance of download, I indexed ~3,000 cities with population larger than 100,000 people and stored into a very simple protobuf format. The cities are stored into a cache in this github repositor
flufluflufluffy
About 2 seconds for me to load and draw Los Angeles. It’s definitely the load time/network latency, depending on where it’s loading from. This is amazing! I might use it for a custom map or something
NavinF
That's surprising. It only took me a couple of seconds to load NYC on my iPhone over 5G
zipping1549
Some cities are cached and NYC is going to be in it for sure.
Get the top HN stories in your inbox every day.
Would be nicer if it would distinguish (just varying line thickness) between footpaths, roads, highways etc. Many European cities look messy in this view.
IMO, prettymaps is quite a bit better: https://github.com/marceloprates/prettymaps