I am having some issues with queries that combine both attribute expressions (currently in ECQL) and spatial queries when in polar regions, and using layers in EPSG:4326.
The problem with ECQL spatial operators is that the expressions must be in terms of native CRS. Away from the poles, I manage this by splitting any polygon that crosses the 180 in two polygons and adding an AND clause to the query. Splitting a polygon that crosses the 180 AND includes a pole is challenging to say to the least. If someone has an algorithms to do this, then I am all ears.
Conceptually it would be easier to request the polygon in the projected coordinates but cant do that with ECQL. It seems I would have to convert the CQL expression into an OGC filter. Does anyone have existing code for this? Does that actually exist somewhere in the geoserver source code even?
Hi Phil,
ECQL has been supporting expression of filters in whatever CRS since late 2017, you
can specify the geometry in EWKT, for example:
INTERSECTS(the_geom, SRID=4326;POINT (1 2))
See also: https://docs.geotools.org/latest/userguide/library/cql/ecql.html
I’ve updated the GeoServer reference docs to include a mention of that too, still in the build pipe,
should show up in a few hours here, in the geometry literal syntax entry:
https://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#literal
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.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.
Fantastic! I see our production build of 2.15 is with Geotools 21 so that should be supported. I will give it a blast.
···
Hi Phil,
ECQL has been supporting expression of filters in whatever CRS since late 2017, you
can specify the geometry in EWKT, for example:
INTERSECTS(the_geom, SRID=4326;POINT (1 2))
See also: https://docs.geotools.org/latest/userguide/library/cql/ecql.html
I’ve updated the GeoServer reference docs to include a mention of that too, still in the build pipe,
should show up in a few hours here, in the geometry literal syntax entry:
https://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#literal
Cheers
Andrea
On Tue, Oct 22, 2019 at 2:34 AM Phil Scadden <P.Scadden@…1389…> wrote:
I am having some issues with queries that combine both attribute expressions (currently in ECQL) and spatial queries when in polar regions, and using layers in EPSG:4326.
The problem with ECQL spatial operators is that the expressions must be in terms of native CRS. Away from the poles, I manage this by splitting any polygon that crosses the 180 in two polygons and adding an AND clause to the query. Splitting a polygon that crosses the 180 AND includes a pole is challenging to say to the least. If someone has an algorithms to do this, then I am all ears.
Conceptually it would be easier to request the polygon in the projected coordinates but cant do that with ECQL. It seems I would have to convert the CQL expression into an OGC filter. Does anyone have existing code for this? Does that actually exist somewhere in the geoserver source code even?
Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list:
If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
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.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.