Okay, I have been experimenting with this and definitely not getting result I had hoped for. I had hoped query in projected coordinate might side step pole and 180 problem.
Firstly, the SRID works – I can specify a polygon in a particular projection, and it queries against that fine – so long as the polygon does not cross the 180. Apparently, server side, it is converting the polygon into native SRS and then doing the query. When I think about, I can see that spatial index on the underlying database is never going to allow a spatial query in anything other than native. Sigh. Back to splitting the polygon into multipolygon. Is there a foolproof way to do this topologically when the polygon a/ crosses 180 line (that bit is easy) and b/ includes a pole? From: Andrea Aime <[email protected]> Sent: Tuesday, 22 October 2019 19:09 To: Phil Scadden <[email protected]> Cc: geoserver-users <[email protected]> Subject: Re: [Geoserver-users] ECQL and polar regions. Convert CQL to OGC filter?? 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 <[email protected]<mailto:[email protected]>> 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: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html 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 [email protected]<mailto:[email protected]> 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. 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: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html 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 [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
