# 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币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 聋哑人手语词汇图像分类数据集【已标注,约1,100张数据】
- 基于Pygame库实现新年烟花效果的Python代码
- 必应图片壁纸Python爬虫代码bing-img.zip
- 购物返利源码/代购网站源码/每日分打包完整版源码下载
- Java外卖项目(瑞吉外卖项目的扩展)
- 使用Python和matplotlib库绘制爱心图形的技术教程
- 国际象棋检测11-YOLO(v7至v9)、COCO、Darknet、Paligemma、VOC数据集合集.rar
- Python与Pygame实现带特效的圣诞节场景模拟程序
- R语言实战机器学习实战教程
- 常用算法介绍与学习资源汇总
- ssd5课件图片记录保存
- 国际象棋检测2-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- Offer资讯交流Web系统(编号:0889870).zip
- 高考志愿智能推荐系统_2a1qfv22.zip
- 个性化推荐影院(编号:03132141).zip
- 高校学生求职就业平台(编号:24440246).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功