<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">If you would like to see what your “boxes” actually look like, try wrapping them in ST_Segmentize() before viewing them on a flat map.<div class=""><br class=""></div><div class="">select st_asgeojson(st_segmentize('SRID=4326;POLYGON ((-167.51953125 8.841651120809145, 1.23046875 8.841651120809145, 1.23046875 63.35212928507874, -167.51953125 63.35212928507874, -167.51953125 8.841651120809145))'::geography,500000))</div><div class=""><br class=""></div><div class="">Past that into <a href="http://geojson.io/" class="">GeoJSON.io</a> and see what it looks like. All will become clear.</div><div class=""><br class=""></div><div class="">P<br class=""><br class=""><img apple-inline="yes" id="DA7BC06C-FC59-4216-802E-9EB54812AF05" src="cid:6DD52CFE-746C-4402-867D-7DE9D1A23016@gv.shawcable.net" class=""><br class=""><br class=""><blockquote type="cite" class="">On Mar 5, 2020, at 2:41 PM, Wayne Rowcliffe <<a href="mailto:wayne@priority5.com" class="">wayne@priority5.com</a>> wrote:<br class=""><br class="">Hi,<br class=""><br class="">I've attached a file containing sample queries that reproduce what I am seeing.<br class=""><br class="">Basically, we have an application that shows data on the globe. We are filtering the results to those within the current window viewport. What I am seeing is that depending on where the map is, I'll either get results or I won't, even when there should be data visible.<br class=""><br class="">While investigating, I switched to calling ST_Distance and noticed that when using geometry the results were always accurate. However, when using geography (like we do in our application), we will sometimes get the correct result, and other times it will say a point within the bounding geometry is actually hundreds of thousands of meters away.<br class=""><br class="">This is my version string using the query on the postgis webpage:<br class="">PostgreSQL 10.9 (Ubuntu 10.9-1.pgdg16.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit POSTGIS="2.5.2 r17328" [EXTENSION] PGSQL="100" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3" LIBJSON="0.11.99" LIBPROTOBUF="1.2.1" TOPOLOGY RASTER<br class=""><br class="">The closest bug I could find was this: <a href="https://trac.osgeo.org/postgis/ticket/4480" class="">https://trac.osgeo.org/postgis/ticket/4480</a> <br class="">It seems potentially different though since the bounding area of my query is less than 180 degrees.<br class=""><br class="">Wayne Rowcliffe<br class="">Software Engineer, Priority5 Holdings<br class=""><a href="mailto:wayne@priority5.com" class="">E-mail: wayne@priority5.com</a><br class=""><br class=""><br class=""><span id="cid:f_k7fc33ed0" class=""><postgis_distanct.txt></span>_______________________________________________<br class="">postgis-users mailing list<br class="">postgis-users@lists.osgeo.org<br class="">https://lists.osgeo.org/mailman/listinfo/postgis-users<br class=""></blockquote><br class=""></div></div></body></html>