[postgis-tickets] [PostGIS] #5355: PostGIS 3, ST_DWithin Query - "lwgeom_distance_spheroid returned negative!" by changing third arg? Postgres 11, Ubuntu 20.04

PostGIS trac at osgeo.org
Wed Mar 15 12:50:45 PDT 2023


#5355: PostGIS 3, ST_DWithin Query - "lwgeom_distance_spheroid returned negative!"
by changing third arg? Postgres 11, Ubuntu 20.04
----------------------+---------------------------
  Reporter:  dchun    |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.3.3
 Component:  postgis  |    Version:  3.3.x
Resolution:           |   Keywords:
----------------------+---------------------------
Comment (by robe):

 I think this might be an issue with your proj version.

 On My PostgreSQL 11, 3.3.2 I do not get any errors.


 {{{
 PostgreSQL 11.17, compiled by Visual C++ build 1914, 64-bit
 POSTGIS="3.3.2 3.3.2" [EXTENSION] PGSQL="110" GEOS="3.11.1-CAPI-1.17.1"
 PROJ="7.2.1" GDAL="GDAL 3.4.3, released 2022/04/22" LIBXML="2.9.9"
 LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)" RASTER
 }}}

 For the following queries output


 {{{

 #  SELECT ST_DWithin('SRID=4326;POINT(-74.8456
 40.1752)','SRID=4326;POINT(-118.493 34.0172)', 111113754219.6, tru
 e) as is_within;
  is_within
 -----------
  t
 (1 row)


 #  SELECT ST_DWithin('SRID=4326;POINT(-74.8456
 40.1752)','SRID=4326;POINT(-118.493 34.0172)', 3754219.5, true) as
  is_within;
  is_within
 -----------
  f
 }}}


 The difference between 2.5 and 3 series I think is when we flipped to
 using the proj.db that shipped with proj instead of relying on what
 spatial_ref_sys told us.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5355#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list