Geotrellis, get the points that fall in a polygon grid Rdd

Viewed 725

I need to calculate the average of the values of points that fall in a polygon grid.

Is like a join one to many based in condition Polyogon.contains(point)

//In:
val pointValueRdd : RDD[Feature[Point,Double]] 

val squareGridRdd : RDD[Feature[Polygon]]

//Needed Out:

val squareGridRdd : RDD[Feature[Polygon,(accum:Double,count:Int)]]
//or
val squareGridRdd : RDD[Feature[Polygon,average:Double]]

is possible to use some quadtree index ?

I read:clip to grid but i don not if it is the right tool.

http://geotrellis.readthedocs.io/en/latest/guide/vectors.html#cliptogrid

The next image show the grid in blue, and the points

enter image description here

Some advice we welcome

1 Answers
Related