# city-roads
Render every single road in any city at once: https://anvaka.github.io/city-roads/
![demo](https://i.imgur.com/6bFhX3e.png)
## How it is made?
The data is fetched from OpenStreetMap using [overpass API](http://overpass-turbo.eu/). 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](https://github.com/anvaka/index-large-cities/blob/master/proto/place.proto) protobuf format. The cities are stored into a cache in this github [repository](https://github.com/anvaka/index-large-cities).
The name resolution is done by [nominatim](https://nominatim.openstreetmap.org/) - 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](https://github.com/anvaka/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](https://twitter.com/anvaka) know how it goes. You can also sponsor my projects [here](https://github.com/sponsors/anvaka) - 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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
city-roads-main.zip (56个子文件)
city-roads-main
.editorconfig 147B
babel.config.js 73B
.github
FUNDING.yml 122B
src
lib
request.js 2KB
svgExport.js 2KB
BoundingBox.js 2KB
protobufExport.js 513B
bus.js 135B
postData.js 1KB
LoadOptions.js 3KB
findBoundaryByName.js 2KB
canvas2BlobPolyfill.js 4KB
Grid.js 3KB
getZazzleLink.js 1KB
appState.js 716B
Progress.js 463B
saveFile.js 5KB
createScene.js 5KB
Query.js 3KB
GridLayer.js 3KB
App.vue 12KB
createOverlayManager.js 6KB
NoWebGL.vue 981B
main.js 908B
vars.styl 265B
components
LoadingIcon.vue 480B
clickOutside.js 2KB
FindPlace.vue 13KB
EditableLabel.vue 1KB
ColorPicker.vue 4KB
vue3-color
LICENSE 68B
mixin
color.js 3KB
common
Saturation.vue 4KB
Alpha.vue 3KB
Checkboard.vue 2KB
Hue.vue 5KB
EditableInput.vue 2KB
Sketch.vue 6KB
proto
encode.js 475B
place.proto 437B
decode.js 264B
place.js 2KB
config.js 641B
LICENSE 1KB
API.md 5KB
vite.config.js 440B
package.json 798B
package-lock.json 208KB
.eslintrc.cjs 374B
deploy.sh 230B
index.html 2KB
.gitignore 164B
.eslintignore 30B
images
tokyo_and_seattle.png 1.07MB
static
.gitkeep 0B
README.md 3KB
共 56 条
- 1
资源评论
张謹礧
- 粉丝: 2w+
- 资源: 266
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- wine下的NVIDIA库支持
- 医学图像分割数据集:人体骨骼图像分割数据集(多类别分割,约3500张数据和标签)
- Python 列表入门教程.docx
- QGIS使用example
- Notepad-v2.13.0各安装版本(可打开100G以上文本),含mac版本、windows版本,亲测超好用
- etcd-cpp-apiv3-master
- linux常用命令(系统进程相关).docx
- 精心整理-2024最新产品经理面试资料合集(共1076份,有这份就够了).zip
- 面向对象的模拟i2c程序
- 高分成品毕业设计《基于SSM(Spring、Spring MVC、MyBatis)+MySQL开发摊位管理系统》+源码+论文+说明文档+数据库
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功