On Tue, Jan 21, 2020 at 10:30 AM Nuno Oliveira < nuno.olive...@geo-solutions.it> wrote:
> 2) Do you need more information to handle the query efficiently? I had > for some time wished to see a "java view" created with a UI similar to "sql > view" making use of the transform process. Sadly this is a little complex > due to the need to reverse any transformation, mapping a query back to the > original data source. Does your " RetypeFeatureTypeCallback" also need to > process queries? > > > Yes, with this extension point you will be able to define a > transformation, in the FeatureSource wrapper, that can handle queries and > map them has needed to the real attributes. > > One of the use case I have for this is the following: > > Often we deal with databases were for a reason or another simple > latitudes\longitudes are used and no spatial indexing is available, one > option here would be to create an SQL view but there is several cons, e.g. > no good indexing, negative impacts on heavily written tables, ... > I will later propose a community module that will make use of this > extension point,and will give us the option when configuring a layer to > generate a new geometry attribute on the fly from the latitudes and > longitudes: > > - Clients will see a valid geometry attribute; > - GeoServer will translate the queries, transforming the geometry to > latitudes and longitudes ranged queries; > - This will give us the best of two worlds, GIS clients will see > geometries, the database will see latitudes \ longitudes (with the proper > indexes) > > One way to implement this would be to use the TransformFeatureSource, already used in ResourcePool, along with a definition function that builds a point, something like "ToPointFunction" present in app-schema already. Along maybe with a generic way to go back from the function result to its parameters, I'm thinking out loud here: public interface InvertibleFunction { List<Expression> getParameters(Object result); } which would allow for a generic support of function transformations in TransformFeatureSource. That said, just an idea. Cheers Andrea == 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.it 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.*
_______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-devel