locationtech/geomesa — pull request #148 by aannex-ccri (2014-07-23 21:30:05+00:00)
Title: GEOMESA-108 Density Iterator support for non-point geoms

Made more fixes as per WIP comments, added GridSnapTest(s). The intent of this ticket was to allow for polygons and line strings to be *rasterized* as point geometries are in the density iterator. However, currently results are inaccurate due to intersections between the geoms and the geohashes being counted twice. This will need to be looked into further.

Polygons are handled by creating a polygon grid corresponding to the raster cells in the density iterator, for each of the *rectangles* that intersect the target geometry the corresponding cell in the raster is increased by one. Due to rounding errors, the number of returned cells covering a given bbox may be lower than the expected number.

Linestrings are handled by generating a sequence of points between any two given vertices that fall into raster cells via the Bresenham Line Algorithm

MultiPolygons, Multilinestrings, and Multipoints are also handled by iterating over the available geometries in the given multigeom.

A small set of tests were written for GridSnap, however this will likely need to be improved and expanded.