I hit some complications with this work, but I started an MR here for further discussion: https://github.com/geotools/geotools/pull/4603
Thanks, Emilio ________________________________ From: Andrea Aime <andrea.a...@geosolutionsgroup.com> Sent: Friday, December 15, 2023 10:41 AM To: Lahr-Vivaz, Emilio <emilio.lahr-vi...@ga-ccri.com> Cc: geoserver-users@lists.sourceforge.net <geoserver-users@lists.sourceforge.net> Subject: Re: [Geoserver-users] -EXT- Conversion meters to kilometers or feet in DWithin filtering WARNING: This message is from an external source. Evaluate the message carefully BEFORE clicking on links or opening attachments. Hi, yes, having it would be useful. Thinking out loud, it should then be used in ContentFeatureSource to pre-process filters for stores that can't implement their own native unit conversions, maybe with a "canConvertUnits" method similar to the already existing ones, "canFilter", "canSort", "canLimit" and so on Cheers Andrea On Fri, Dec 15, 2023 at 4:37 PM Lahr-Vivaz, Emilio <emilio.lahr-vi...@ga-ccri.com<mailto:emilio.lahr-vi...@ga-ccri.com>> wrote: Ah, good to know. We've actually implemented this in GeoMesa[1], using the Geodetic calculator (so it also works in GeoMesa stores, in addition to Postgis and Oracle). Is that something people would be interested in porting over to GeoTools/GeoServer? There's an optimized check for very close and far points that probably only works with EPSG:4326, but maybe could be generalized some (or removed). I'd be happy to rewrite it in Java if it's useful. Thanks, Emilio [1]: https://github.com/locationtech/geomesa/blob/main/geomesa-filter/src/main/scala/org/locationtech/geomesa/filter/expression/FastDWithin.scala ________________________________ From: Andrea Aime <andrea.a...@geosolutionsgroup.com<mailto:andrea.a...@geosolutionsgroup.com>> Sent: Friday, December 15, 2023 9:52 AM To: Lahr-Vivaz, Emilio <emilio.lahr-vi...@ga-ccri.com<mailto:emilio.lahr-vi...@ga-ccri.com>> Cc: geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net> <geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net>> Subject: Re: [Geoserver-users] -EXT- Conversion meters to kilometers or feet in DWithin filtering WARNING: This message is from an external source. Evaluate the message carefully BEFORE clicking on links or opening attachments. Hi Emilio, almost correct, the unit conversion is implemented only in selected data stores, e.g. posgis and oracle, while all other stores are unable to deal with differences in units. The same goes for distances in km with units in degrees, that works I believe only with postgis when using the geography data type. It's been like that for the past 20 years... nobody steps up to do it. It's too large of a task to perform in spare time, and those that may sponsor are typically using postgis and oracle already. Cheers Andrea On Fri, Dec 15, 2023 at 3:17 PM Lahr-Vivaz, Emilio <emilio.lahr-vi...@ga-ccri.com<mailto:emilio.lahr-vi...@ga-ccri.com>> wrote: I believe that dwithin ignores the units, and will always evaluate the distance in the units of the layer's CRS, e.g. for EPSG:4326 it uses degrees. Thanks, Emilio ________________________________ From: geospatial techno <geospatial.techno2...@gmail.com<mailto:geospatial.techno2...@gmail.com>> Sent: Friday, December 15, 2023 8:11 AM To: geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net> <geoserver-users@lists.sourceforge.net<mailto:geoserver-users@lists.sourceforge.net>> Subject: -EXT-[Geoserver-users] Conversion meters to kilometers or feet in DWithin filtering WARNING: This message is from an external source. Evaluate the message carefully BEFORE clicking on links or opening attachments. I have used the WMS service with the CQL filter in GeoServer. Currently, I want to use the "DWithin" spatial operators to filter features by default GeoServer data ("sf:archsites" layer). I specifically need to filter a specific point (593250, 4923867) using a radius of 10,000 meters. I want to substitute meters with something like kilometers. The issue is that these two commands should produce the same results in the output, however in geoserver, it doesn't work this way. Why? Here are the CQL filter codes: - CQL_FILTER=DWithin(the_geom,Point(593250 4923867),10000,meters) - CQL_FILTER=DWithin(the_geom,Point(593250 4923867),10,kilometers) Regards _______________________________________________ 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 Geoserver-users@lists.sourceforge.net<mailto:Geoserver-users@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/geoserver-users -- Regards, Andrea Aime == 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 _______________________________________________ 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 Geoserver-users@lists.sourceforge.net<mailto:Geoserver-users@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/geoserver-users -- Regards, Andrea Aime == 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
_______________________________________________ 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 Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users