Rendering Spatial Data Without Having to Generalize Beforehand

Yesterday I posted about Chris Hogan’s walk-through of generalizing data in PostGIS to make it usable in a web app. Basically he went through the process of finding out what is the sweet spot of quality vs speed. But there are other ways to accomplish this. Mapbox happened to post about a new library called geojson-vt.

Let’s see if Mapbox GL JS can handle loading a 106 MB GeoJSON dataset of US ZIP code areas with 33,000+ features shaped by 5.4+ million points directly in the browser (without server support):

Wait, what?! A few seconds loading the data, and you can browse the whole data set smoothly and seamlessly. But how exactly does that work? Let’s find out

So that’s actually pretty amazing. We all know what GeoJSON does in the browser and how it impacts the speed of maps drawing. 100 MB+ data rendering so quickly? Impressive. Read the whole post to see how they do it and the details on how to start using it. The only limitation is that it requires mapbox-gl-js orMapbox Mobile[footnote]which is actually a big limitation if you think about it[/footnote].UPDATE: Per Tom MacWright:

Still this comes down to using tools that make your mapping products better. Maybe Mapbox does that cheaper and quicker than you could on your own. This kind of on-the-fly simplification is what we’ve all been asking for and Mapbox is really pushing the envelope. This could be what gets people to start using their platform.