2

I have a fairly large data set, about 5 million features, that I need to display on the web using Google Maps API. I am currently processing the file in QGis with XYZ Tiles, and using the generated tiles to display on the web.

This method works, and benefits are:

  • Super fast load time on the web
  • Free to use
  • Works with Google Maps API

However, the cons are:

  • A lot of overhead in processing time
  • A lot of space required for multiple zoom levels (Turns a ~2GB file into ~200GB directory)

For my purposes, only a small portion of the map will need to be displayed at one time (~1km x 1km), but the entire area covers all of Ontario (~1,600km x 1,500km). I also need to regenerate these tiles monthly based on an updated vector file

So my question is, what other options do I have to display this data? I only need to show a small portion of the map at a time, so is there a way to filter the vector file to display only what's needed?

2 Answers 2

2

You should look at using vector tiles. I dont know much about Google Maps API but I found this:

https://landtechnologies.github.io/Mapbox-vector-tiles-basic-js-renderer/debug/basic/google

which was mentioned here:

https://stackoverflow.com/questions/27284251/vector-tiles-with-google-maps-v3

Here is something you can use with OpenLayers or Leaflet https://github.com/mapbox/geojson-vt

3
  • Currently looking into using vector tiles as I think it's my best option. I think the rendering portion with Google I'm comfortable with, but the tricky part is creating the tiles themselves on the back end. Before I was using XYZ Tiles, and now I'm working on a custom script in QGIS
    – Mackija
    Commented Jan 7, 2020 at 17:00
  • Any chance you can add the script you are using for Qgis to this post?
    – GreyHippo
    Commented Jan 7, 2020 at 17:33
  • For sure, once I finish I'll add it as an answer for future users
    – Mackija
    Commented Jan 7, 2020 at 17:39
0

A library to load vector tiles in Google Maps: https://github.com/techjb/Vector-Tiles-Google-Maps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.