Group By Field appears in the GeoJSON format settings, but does nothing.
My organization wants to join events to buildings in a one-to-many relationship, and serve this to a map overlay using Views GeoJSON. The event nodes have node references to the building nodes, which have geofields defining their location. Our target output is to have an array of values for each field when grouping is active. I'm currently looking into adding this functionality, but I haven't developed for Views before, and I'm still catching up on the API. Once I've finished, I'll submit a patch. If I'm not successful for whatever reason, the Group By option should be removed from the format options, as per the following:
views_plugin_style.inc, line 184:
Only fields-based views can handle grouping. Style plugins can also exclude themselves from being groupable by setting their "use grouping" definiton key to FALSE.
Comments
Comment #1
jeffschulerAwesome; look forward to the patch. Thanks!
Comment #2
dericke commentedUpdate: we decided that Views Datasource was a better basis than Views GeoJSON. We didn't need valid GeoJSON, just WKT or X/Y somewhere in a JSON endpoint. Our fork is at https://bitbucket.org/wwuweb/views_datasource_wwu. I don't think it would be hard to port my changes to this module, but not understanding how the BBOX functionality works with grouping was a barrier.
Right now, the module works for our purposes, but the code is messy. There's at least one block of code that I copied from Views core without fully understanding what it does. Since this the first module development I've ever done, and it's been mostly through trial and error, it could probably stand to have a more experienced coder look at it. One major known issue: creating a label for the grouping field in the field options breaks the grouping.
Comment #3
jeffschulerGlad you found a solution!
See also #1839462: BBox argument handler doesn't work with GROUP BY.
Comment #4
pol