Skip to content

Vector tiles are too large #34

@knutole

Description

@knutole

Goal

The goal here is to create animations with snow-rasters. We have GeoTIFF's of snow coverage, one raster per day, for fifteen years back. We want to be able to play animation of this coverage - preferably from any given period.

screen shot 2016-03-16 at 4 22 43 am

Vector tile size

Working on "snow-raster" datasets, vector tiles are up to several megabytes (which is kind of insane, given the original raster is a mere 1.6MB.) Should be optimized as much as possible, preferably down to a few kB per tile, although this might be but a dream...

It seems that the vectorized dataset is much larger than the original raster, when vectorized from pixels to polygons. A single vector tile can be as much as 10MB from this 1.6MB raster file.

Having second thoughts about the whole approach.

Possible solutions

1. Points instead of polygons

Vectorizing the raster into points instead of polygons should save us some space. However, the points would have to be represented as squares, and it seems messy.

2. GIF-tiles

Crazy idea, creating 256x256 GIF's on demand on server, and playing them as tiled images in browser. Problems: hard to control playback (if at all possible); stupid solution in general; no dynamic control of style, nor querying of data.

3. Playing raster tiles with transition

Perhaps the easiest solution, after all, but hard to say if it will work without having tried. Seems the size of raster tiles might be smaller than vector tiles (contrary to intuition), so at least an improvement in that regard. Also, no dependency on GL.

4. Heavy simplification of polygons.

Currently simplification of polygons are not really working, perhaps because all polygons are perfect squares, so not much to simplify without dropping polygon altogether. Another way to simplify polygons, would be to combine four of them into one large polygon (with average value). This will lose a lot of the resolution, however - but something's gotta give!

5. TopoJSON?

Instead of storing all four corners of polygons, perhaps store only one corner (similar to what TopoJSON does). This is feasible for vectorized rasters, and will cut size - in theory - by a factor of four. (Which is not enough, however.) It seems there's a lot to gain with simplification in general, though.

6. D3.js

Eureka: The polygons are always the same - only the value val changes in the timeseries! Thus, no need to have several representations of polygons, only need the val and id. This saves massive bytes.

The geometry of the datacube (2D datasets over time) could be represented as a TopoJSON, created from vectorized raster - then all the values (val) of each polygon (id) for each slice (of the timeseries) could be queried at will and colored in by d3.js.

Tests and debug tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions