Azure地图性能改进 [英] Azure Maps Performance Improvement

查看:96
本文介绍了Azure地图性能改进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个地图,在美国显示从shp文件转换为geojson文件的区域,该文件将数据列为多边形。 geojson文件大约为165 Mb,大约需要1.50-2分钟来处理并实际显示
地图上的形状。

I am creating a map to display zones in the U.S. that are translated from an shp file to a geojson file, which lists the data as polygons. The geojson file is about 165 Mb and takes roughly 1.50-2 minutes to process and actually display the shapes on the map.

我已经阅读了文档中列出的示例。我能找到的最适用的是(https://azuremapscodesamples.azurewebsites.net/?sample=Load%20large%20Shapefiles%20using%20a%20Web%20Worker),但文件大小和加载时间类似
我正在经历的事情。

I have read through the documentation the listed examples. The most applicable one I could find was here (https://azuremapscodesamples.azurewebsites.net/?sample=Load%20large%20Shapefiles%20using%20a%20Web%20Worker), but the file size and load times are similar to what I am experiencing.

如果有任何方法可以提高性能并减少加载时间,请告诉我。

Please let me know if there are any ways to improve performance and reduce load times.

推荐答案

对于浏览器,165MB是大量数据,大多数地图平台在10mb后崩溃。 Azure Maps能够处理这么多数据,但浏览器需要花费大量时间来处理。对于大型数据集,最好的方法是将您的数据转换为
两种格式之一:

For a browser, 165MB is a massive amount of data, most map platforms crash after 10mb. Azure Maps is able to handle this much data, but it takes a lot of time for the browser to process. For large data sets the best approach is to convert your data into one of two formats:

1。矢量切片 - 这是一种新的数据格式,可将数据分解为与地图的切片方案对齐的数据块。每个图块都根据缩放级别进行优化和压缩。每个图块都是原始数据
集(通常大约12kb)的一小部分,加载速度要快得多。这是一个关于如何将shapefile转换为矢量图块的博客:  https://openmaptiles.org/docs/generate/custom-vector-from-shapefile-geojson/

1. Vector Tiles - This is a new data format when breaks your data up into blocks of data that align with the tiling schema of the map. Each tile is optimized and compressed based on zoom level. Each tile is a small fraction of the size of your original data set (usually around 12kb) and loads significantly faster. Here is a blog on how to convert shapefiles into vector tiles: https://openmaptiles.org/docs/generate/custom-vector-from-shapefile-geojson/

2。图像切片 - 这是一种较旧的方法,包括将数据转换为图像并将其作为切片覆盖在地图上。它类似于方法1,但使用图像切片而不是矢量切片。这对于渲染数据很有用,但如果你想与数据交互,则需要
更多的工作。总的来说,这种方法需要大量的工作。如果你想采用这种方法,我确实可以找到我能找到的代码示例,但推荐第一种方法。

2. Image tiles - This is an older approach which consists of converting your data into a image and overlaying it on the map as tiles. Its similar to approach 1, but uses an image tiles instead of vector tiles. This is good for rendering data but requires a lot more work if you want to interact with the data. Overall this approach requires a lot of work. If you want to go this approach, I do have code samples kicking around somewhere that I can find, but recommend the first approach.


这篇关于Azure地图性能改进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆