TileReduce is our scalable open source framework for these challenging tasks. It uses the built-in segmentation of vector tiles to run analyses across multiple CPU cores. From the outset, TileReduce changed the kinds of problems we could solve, and did so very quickly. Today we’re releasing a new version that increases its performance even further.
TileReduce 3 includes a range of optimizations that reduce the overhead of individual tasks, make better usage of multiple CPU cores, and dramatically increase overall performance. Highlights:
Fetching & parsing vector tiles and converting them into GeoJSON is parallelized across many CPU cores. This both makes it much faster and reduces the overhead of sending data between processes.
There’s an option to parse vector tiles lazily, avoiding the slow process of unpacking geometries if they aren’t needed.
The working area is streamed into a job tile by tile. This avoids storing the whole scope of work in memory.
Simpler, streamlined API and extensive test coverage.
With TileReduce 3 and OSM QA Tiles, calculating the difference between US Census roads and OpenStreetMap takes 11 minutes on a Macbook Pro, down from up to a day on a high-powered EC2. OpenStreetMap Coverage and Sidewalk scripts each take under 25 minutes to run for the whole world.
The new performance opens up lots of new possibilities for geospatial data analysis, and we can’t wait to see more cool uses of TileReduce from the community — let’s talk about this!
Hit up Morgan, Tim and me on Twitter if you have any questions or ideas, check out the code, docs and examples for the new release, and stay tuned for more posts about analysis at Mapbox this week.