当前位置: 首页 > news >正文

虚拟空间网站回收池有什么作用对网站建设课程的心得体会

虚拟空间网站回收池有什么作用,对网站建设课程的心得体会,织梦网站数据库备份文件夹,wordpress免费企业主题本文通过获取在线和离线地图数据,使用开源Rust项目搭建瓦片地图服务,并使用DevExpress的MapControl控件使用自建地图服务 获取地图数据 获取地图数据有很多种方式,这里分别用在线和离线地图数据举例说明 在线下载瓦片地图 打开在线瓦片地…

本文通过获取在线和离线地图数据,使用开源Rust项目搭建瓦片地图服务,并使用DevExpress的MapControl控件使用自建地图服务

获取地图数据

获取地图数据有很多种方式,这里分别用在线和离线地图数据举例说明

在线下载瓦片地图

打开在线瓦片地图下载网站,【划范围】,勾选精度,【下载】

在这里插入图片描述

在这里插入图片描述

下载后得到压缩包“tiles.zip”

下载OpenStreetMap离线地图数据

OpenStreetMap是一个自由的街道级世界地图,它由日益壮大的绘图者团体创造。 任何人都可以编辑OpenStreetMap

数据下载地址:Geofabrik Download Server

在这里插入图片描述

下载后缀为“.bz2”格式的文件,使用开源项目工具bzip2处理

比如下载文件为“antarctica-latest.osm.bz2”,处理后得到文件“antarctica-latest.osm”

bunzip2 antarctica-latest.osm.bz2

接着处理.osm文件,使用maperitive,打开maperitive软件,打开文件“antarctica-latest.osm”

右下角【Map Sources】取消勾选“Web map”

在这里插入图片描述

在【Command prompt:】输入如下命令,maxzoom设置范围1-5,范围最大值越大,看到细节更多,Tiles文件夹体积也越大

generate-tiles minzoom=1 maxzoom=5

运行过后,在maperitive的安装目录下就会多一个Tiles文件夹

搭建开源瓦片地图服务

这里我使用本人用Rust开发的tiles_rs,启动服务的命令如下

tiles_rs.exe --tiles-dir=C:\Users\Tiles --host=0.0.0.0 --port=5000 --log_level=warn
  • tiles-dir: 为瓦片地图数据文件夹
  • host: 服务器IP地址
  • port: 端口
  • log_level: 日志级别

更多使用方式,查看help命令

tiles_rs.exe --help
================================================================================
Overview
================================================================================
Tiles_rs is an open-source project that aims to provide a fast and reliable tile map server implementation using Rust.
Built on top of the Actix web framework, this project offers a modern approach to serving map tiles,
catering to the needs of developers working on geographic information systems (GIS) and web mapping applications.# Examples‍```sh
tiles_rs.exe --tiles-dir=C:\Users\Tiles --host=0.0.0.0 --port=5000 --log_level=warn
‍```# Api- /tiles/{z}/{x}/{y}{z} - The current zoom level.
{x} - The horizontal (X) index of the requested tile.
{y} - The vertical (Y) index of the requested tile.Usage: tiles_rs.exe [OPTIONS]Options:--tiles-dir <TILES_DIR>Directory containing tile images[default: Tiles]--host <HOST>Host to bind the server to[default: localhost]--port <PORT>Port to bind the server to[default: 5000]--log-level <LOG_LEVEL>Log level (error, warn, info, debug, trace)[default: info]-h, --helpPrint help (see a summary with '-h')-V, --versionPrint version

使用地图数据

这里使用DevExpress v24.1的MapControl控件,项目代码在Github,只需要修改一行代码,修改使用地图的数据接口模板

provider.TileUriTemplate = "http://IP:PORT/tiles/{1}/{2}/{3}";
  • {1} - The current zoom level.
  • {2} - The horizontal (X) index of the requested tile.
  • {3} - The vertical (Y) index of the requested tile.

使用刚刚在线下载的瓦片地图数据,效果显示如下

在这里插入图片描述

参考

  1. 下载OpenStreetMap离线地图数据并搭载瓦片服务器_openstreetmap瓦片下载-CSDN博客
  2. OpenStreetMapDataProvider.TileUriTemplate Property | WinForms Controls | DevExpress Documentation
  3. https://github.com/DevExpress-Examples/winforms-map-connect-to-openstreetmap.git
  4. http://maperitive.net/
  5. https://github.com/VinciYan/tiles_rs.git
  6. https://github.com/philr/bzip2-windows.git
http://www.yayakq.cn/news/666333/

相关文章:

  • 做响应式网站哪家好杭州金融网站建设
  • 闵行工程建设网站做百度网站需要钱吗
  • 如何利用源码做网站深圳企业建网站公司
  • 福州网站建设熊掌号怎么做简易手机网站
  • 崇明建设镇虹桥村网站深圳做h5网站的公司
  • 域名对网站的好处网站建设需准备什么软件
  • 怎么做网站frontpage深圳seo秘籍
  • 长春火车站有几个现在网站都是拿什么软件做的
  • 怎么 给自己的网站做优化呢免费网站优化
  • 西安制作网站公司深圳跑网约车怎么样
  • 网站界面设计图片敬请期待英语
  • 做网站一定要域名嘛泰安电视台在线直播
  • 网页设计与网站建设docx手机哪里可以做视频网站
  • 只放一个图片做网站阿里云虚拟主机可以做几个网站吗
  • 国内外公司网站差异下载的网站模板怎么修改
  • 大气自适应网站源码湖南建设人力
  • 长春网站公司哪家好软件开发是什么职业
  • 网站版块下载今天的新闻 最新消息
  • 购物网站建设计划书惠州seo外包服务
  • 手机版网站案例护肤品网站制作 网新科技
  • 爱站网长尾关键词挖掘汕头房地产网
  • 做网站互联网公司自己做的网站怎么备案
  • 江门网站建设优化怎么制作手机
  • 石家庄论坛建站模板怎么创立网站
  • 网站在线留言怎么做临沂网站建设公司
  • 电商网站 流程图郑州网站建设市场
  • 建设网站需要收费吗扬州做公司网站的公司
  • 做网站如何避免商标侵权成都到西安高铁
  • 三优科技 网站开发菏泽建设网站
  • 网站中全景是怎么做的培训加盟网站建设