RIght now PolygonLayer.aggregate has a callback that takes a single point and a list of polygons that contain this point. This is wrong conceptually and bad for performance. Better would be to loop through each polygon and return a list of points contained in that polygon. Points would be in a LayerSelector, the polygon would not. The callback function signature should be function (Polygon, LayerSelector[Points]). Points may appear in multiple polygons by being pushed onto multiple lists by the PolygonLayer.
RIght now PolygonLayer.aggregate has a callback that takes a single point and a list of polygons that contain this point. This is wrong conceptually and bad for performance. Better would be to loop through each polygon and return a list of points contained in that polygon. Points would be in a LayerSelector, the polygon would not. The callback function signature should be function (Polygon, LayerSelector[Points]). Points may appear in multiple polygons by being pushed onto multiple lists by the PolygonLayer.