geotrellis/geotrellis — pull request #675 by lossyrob (2013-12-14 00:06:17+00:00)
Title: Benchmarking. IO changes. Png changes. Warp.

This PR has a lot of changes that fell out of benchmarking for the 0.9 release, including:

- Revamping ArgReader. Before there was a warping operation (cropping and\or changing cell width and cell height) on every read. For loading full rasters or full tiles, this was way slower then just mapping the file to memory and converting the byte buffer into RasterData. Using this method results in up to 100x speedup in reading large rasters in some cases.

- To supplant the warping that ArgReader was doing, the Warp class was created and benchmarked thoroughly. This Warp works on ByteBuffer -> RasterData (in the case of warping right on load) and also from RasterData -> RasterData, so the warp code can be reused on rasters that are already in memory. So now warping a raster is as easy as

```scala
val r = RasterSource("someStore","someRaster")
r.warp(newRasterExtent)
```

if you know the raster extent you want to warp to and can warp on load, the equivalent but more efficient way to do this is:

```scala
val r = RasterSource("someStore","someRaster",newRasterExtent)
```

- Changed the way local operations reduce over a sequence or rasters. There was a RasterReducer class in 0.8 that benchmarked way faster than the way it is implemented now, so that is used instead.

- Included a RasterSourceSeq for performing local combinatorial operations (reducing local ops) across a sequence of rasters.

- ColorMap can take a histogram that will allow itself to cache the color values for faster performance. SimpleRenderPng does this, because in order to create the color breaks it needs a histogram, and the histogram contains the set of values of the raster, so that data can be reused to cache the color map and increase rendering speed (this is why in 0.8 the Renderer took a histogram as a required param).

- Improved error messages for when loading a raster...instead of 'can't do it', it gives a more useful error like, 'that file doesn't exist'.

- Generally cleaned up the Benchmark project and ran everything...0.9 is looking pretty fast.

Fixes #414. Fixes #658. Fixes #660.