azavea/geotrellis — pull request #230 by lossyrob (2012-11-21 16:03:34+00:00)
Title: Refactor of focal operations.

Refactored and the focal operation framework.

Implemented Aspect and Slope focal operations. Currently the tests for these
are ignored as the output does not match gdaldem for slope and aspect (although
the same calculation is used for Hillshade, which agrees with gdaldem hillshade).

- Currently there are two seperate frameworks involved, one which is
a refactor of the old framework, and other that defines FocalOp1 in
a new way that borrows from the old code but is mostly new.
- A new way of letting focal operations be designed, in which a
'cursor' which describes the neighbors of a focus can be operated on
in order to derive a value for that focus point, is implemented.
- The Cursor can include a mask, so that other shapes of neighborhoods can
be implemented (i.e. the Circle neighborhood provides a mask that masks
neighbors in the bounding box outside of the radius).
- Benchmarking was done as a comparison; the new Cellwise operation is of
equivalent speed to the old method in Mean. The Cursor method outperforms
the 'Default' method in the old framework for Sqaure neighborhoods on Min. The
Circle neighborhood in the new Cursor method underperforms in comparison to
the old Default method for Min. The masking needs to be optimized.
- Scalar Moran's I needs to be reimplemented.