block by rveciana f103246244bc8a5a1585b55d52079c60

Representing GeoTIFF values with D3js

Full Screen

This example shows how to represent a GeoTIFF raster directly into a Canvas object.

Here you have a question about how to set pixels: the way used in the example draws all the pixels at once, since is much more efficient.

Note that using the Math.round function, the example will work if the original GeoTIFF has more pixels than the output image. Also, drawing small rectangles would be less efficient.

The color scales from D3js aren’t used, since the performance is very poor. It’s still a problem, since the ColorBrewer scales are much better than this, but difficult to calculate.