none
Azure Maps Performance Improvement RRS feed

  • Question

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

    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.

    Wednesday, March 6, 2019 10:40 PM

All replies

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

    Wednesday, March 6, 2019 11:18 PM
  • I have converted the data file into an MBTiles file, but I am not sure how to read the data from the file and load onto my map. It looks like the only way to load vector tiles is through an http url, is there any way to load the tiles directly from my file system?
    Wednesday, March 13, 2019 10:30 PM
  • Currently tiles need to be loaded through a URL. If you are using visual studio and run your web app, it hosts it on localhost for you (IIS express) and you can use the localhost URL. 
    Thursday, March 14, 2019 1:00 AM