What a fun problem, I think the suggestion is a good one. On Fri, Dec 1, 2023 at 2:31 AM Andrea Aime < andrea.a...@geosolutionsgroup.com> wrote:
> Hi, > I'm working with wind maps, where typically the data contains > (some way to compute) magnitude and directions of the wind vectors. > > Now, the "direction" is an angle that is used to rotate a symbol. > The angle has an assumption... that north is up. However, take a non > trivial projection, like polar ones, and the assumption goes belly up, the > direction of north can change point by point. > > So my plan is to introduce a function, "northFix", that would provide a > correction angle > taking as parameters a CRS and the current point. Something like this: > > <Rotation> > <ogc:Function name="northFix"> > <ogc:Literal>EPSG:3976</ogc:Literal> > <ogc:PropertyName>theGeom</ogc:PropertyName> > <ogc:PropertyName>windDirection</ogc:PropertyName> > </ogc:Function> > </Rotation> > > Parameters in order: > > - The current CRS (in actual app, coming from an env variable, e.g > "wms_crs" in GeoServer) > - The current point > - The angle to be fixed > > So far, so good, I'd say... but in a general SLD, that might still eat > quite some time, in cases where it's not needed, e.g., web mercator, WGS84. > It would be better to recognize the situation right away, and eliminate the > function, replacing it with the wind direction property name directly. > > I have a StyleSimplifier that could do that, but it would also be quite > ad-hoc. Could we have maybe an interface that functions could implement to > test if they are simplifyable at all, and offer a replacement? E.g. > > SimplifyableFunction { > Expression simplify(Function function); > } > > Thoughts? > > Cheers > Andrea > == > > GeoServer Professional Services from the experts! > > Visit http://bit.ly/gs-services-us for more information. > == > > Ing. Andrea Aime > @geowolf > Technical Lead > > GeoSolutions Group > phone: +39 0584 962313 > > fax: +39 0584 1660272 > > mob: +39 339 8844549 > > https://www.geosolutionsgroup.com/ > > http://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 > _______________________________________________ > GeoTools-Devel mailing list > GeoTools-Devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel >
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel