I’m writing to propose the creation of a new vector rendering transformation and have your feedback about it. The following listing shows how it would appear:
the groupByAttributes parameter allows to define the feature’s attributes to produce the groups on which do aggregation;
the aggregator parameter specifies the aggregation to perform (eg. min/max);
the aggregationAttribute provides the feature attribute used for the aggregation.
For instance, in case of a min aggregation, the rendering transformation will allow to return only the feature, for each group, having the minimum value for the aggregationAttribute.
Moreover, in order to give a consistent result, the rendering transformation will need to be fed with sorted features.
This would allow to overcome issues that would arise if sorting is handled inside the RT:
FeatureCollection sort method accepts only one SortBy object, while the RT would allow to define more grouping attributes.
The FeatureCollection sort method doesn’t support ComplexFeatures.
In case the RT is issued through a sld, the sortBy attributes can be defined through the vendorOption, while in case of a WPS process, they can be provided through the Query object.
The output of the rendering transformation will be a FeatureCollection wrapper, and the necessary computation will be performed in the hasNext method of the corresponding FeatureIterator.
It seems like such a rendering transformation would be very handy.
One question that I’d have is if there’s an obvious way to let DataStores push down the aggregations to the underlying databases? Maybe there could be a GroupingVisitor that could carry out the computation or represent the work that the DataStore would have to do for the FeatureCollection?
As a second thought/question, could aggregationAttribute be an expression or would it need to be an attribute in the SimpleFeatureType?
In GeoMesa, we added a WPS process to compute statistics. This is making me think of that process a little bit and some of the optimizations which can be applied. So yeah, big plus one to this idea; having this as rendering transformation should open up some interesting styling options!
Cheers,
Jim
···
On 9/29/20 5:19 AM, Marco Volpini wrote:
Dear all,
I’m writing to propose the creation of a new vector rendering transformation and have your feedback about it. The following listing shows how it would appear:
the groupByAttributes parameter allows to define the feature’s attributes to produce the groups on which do aggregation;
the aggregator parameter specifies the aggregation to perform (eg. min/max);
the aggregationAttribute provides the feature attribute used for the aggregation.
For instance, in case of a min aggregation, the rendering transformation will allow to return only the feature, for each group, having the minimum value for the aggregationAttribute.
Moreover, in order to give a consistent result, the rendering transformation will need to be fed with sorted features.
This would allow to overcome issues that would arise if sorting is handled inside the RT:
FeatureCollection sort method accepts only one SortBy object, while the RT would allow to define more grouping attributes.
The FeatureCollection sort method doesn’t support ComplexFeatures.
In case the RT is issued through a sld, the sortBy attributes can be defined through the vendorOption, while in case of a WPS process, they can be provided through the Query object.
The output of the rendering transformation will be a FeatureCollection wrapper, and the necessary computation will be performed in the hasNext method of the corresponding FeatureIterator.
Best regards,
Marco Volpini
_______________________________________________
Geoserver-devel mailing list
[Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-devel](https://lists.sourceforge.net/lists/listinfo/geoserver-devel)
Is this not similar to the aggregate process already implemented? You may be able to get a similar result by allowing aggregationAttribute to have multiple values.
this does not compute an aggregate, first groups and then selects one of the features in the group. It’s a filtering process, the grouping
is just an aspect of how the filtering is implemented. E.g., “return the feature with the min value of X, among all those having the same Y”
Cheers
Andrea
···
Regards, Andrea Aime
== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.ithttp://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.