Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

city-roads

> 编程语言
Open source

Visualization of all roads within any city

9.5K stars0 likes2 views
WebsiteGitHub

About

Visualization of all roads within any city

city-roads

Render every single road in any city at once: https://anvaka.github.io/city-roads/

How it is made?

The data is fetched from OpenStreetMap using overpass API. While that API is free (as long as you follow ODbL licenses), it can be rate-limited and sometimes it is slow. After all we are downloading thousands of roads within an area!

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 repository.

The name resolution is done by nominatim - for any query that you type into the search box it returns list of area ids. I check for the area id in my list of cached cities first, and fallback to overpass if area is not present in cache.

Scripting

Behind simple UI software engineers would also find scripting capabilities. You can develop programs on top of the city-roads. A few examples are available in city-script. Scene API is documented here: https://github.com/anvaka/city-roads/blob/main/API.md

Please share your creations and do not hesitate to reach out if you have any questions.

Limitations

The rendering of the city is limited by the browser and video card memory capacity. I was able to render Seattle roads without a hiccup on a very old samsung phone, though when I tried Tokyo (with 1.4m segments) the phone was very slow.

Selecting area that has millions of roads (e.g. a Washington state) may cause the page to crash even on a powerful device.

Luckily, most of the cities can be rendered without problems, resulting in a beautiful art.

Support

If you like this work and want to use it in your projects - you are more than welcome to do so!

Please let me know how it goes. You can also sponsor my projects here - your funds will be dedicated to more awesome and free data visualizations.

Local development

bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

License

The source code is licensed under MIT license

Issues· 50 open

View all issuesOpen on GitHub
  • #203

    OSM Error

    Updated Sep 28, 2026
  • #201

    OSM Error

    Updated Aug 12, 2026
  • #200

    OSM Error

    Updated Jul 25, 2026
  • #196

    OSM Error

    Updated Jun 27, 2026
  • #199

    Joinville

    Updated Jun 22, 2026
  • #198

    OSM Error

    Updated May 19, 2026
  • #197

    OSM Error

    Updated May 13, 2026
  • #195

    Majes

    Updated Apr 16, 2026
  • #194

    OSM Error

    Updated Apr 15, 2026
  • #192

    OSM Error

    Updated Apr 2, 2026

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言