[postgis-tickets] [PostGIS] #4604: ST_Intersects discrepancy between 2.5.3 and 3.0.0

PostGIS trac at osgeo.org
Fri Dec 13 16:21:15 PST 2019


#4604: ST_Intersects discrepancy between 2.5.3 and 3.0.0
----------------------+---------------------------
  Reporter:  paf31    |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.0.1
 Component:  postgis  |    Version:  3.0.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by robe):

 I confirm that I also get false on PostgreSQL 12.1 + PostGIS 3.0.0 on
 windows but PostgreSQL 11 + PostGIS 3.0.0 returns true.
 I did an ST_Distance and _ST_DistanceTree on the two and got the same
 answer -- did we flip to using _ST_DistanceTree for 12?

 {{{
 SELECT postgis_full_version() || ' ' ||  version();
 SELECT
   ST_Intersects(
     ST_GeographyFromText('SRID=4326;POINT(-11.0 0.00005)'),
     ST_GeographyFromText('SRID=4326;LINESTRING(-11.0 0.0,-11.0 0.0001)')
   );
 }}}
  Outputs

 {{{
 POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 "
 PROJ="Rel. 5.2.0, September 15th, 2018" LIBXML="2.9.9" LIBJSON="0.12"
 LIBPROTOBUF="1.2.1" WAGYU="0.4.3 (Internal)" PostgreSQL 12.1, compiled by
 Visual C++ build 1914, 64-bit

 false

 0       3.9548627765821976e-10
 }}}

 However

 On windows PostgreSQL 11,  3.0.0 -- I get the same answer of false.
 {{
 SELECT postgis_full_version() || ' ' ||  version();
 SELECT
   ST_Intersects(
     ST_GeographyFromText('SRID=4326;POINT(-11.0 0.00005)'),
     ST_GeographyFromText('SRID=4326;LINESTRING(-11.0 0.0,-11.0 0.0001)')
   );

 SELECT
   ST_Distance(
     ST_GeographyFromText('SRID=4326;POINT(-11.0 0.00005)'),
     ST_GeographyFromText('SRID=4326;LINESTRING(-11.0 0.0,-11.0 0.0001)')
   ) AS dist,
   _ST_DistanceTree(
     ST_GeographyFromText('SRID=4326;POINT(-11.0 0.00005)'),
     ST_GeographyFromText('SRID=4326;LINESTRING(-11.0 0.0,-11.0 0.0001)')
   ) AS tree_dist;

 }}

 However testing on windows PostgreSQL 11, 3.0.0 - I get the old answer of
 true.
 outputs
 {{
 POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="110" GEOS="3.8.0-CAPI-1.13.1 "
 PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.4.3, released
 2019/10/28" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.4.3
 (Internal)" RASTER PostgreSQL 11.6, compiled by Visual C++ build 1914,
 64-bit

 true

 0       3.9548627765822e-10

 }}}

 2.5.3 is also true.

 However testing on windows PostgreSQL 11, 2.5.3 - I get the old answer of
 true.
 outputs
 {{
 POSTGIS="2.5.3 r17699" [EXTENSION] PGSQL="110" GEOS="3.7.2-CAPI-1.11.0
 3.7.2" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, released
 2018/03/19" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER
 PostgreSQL 11.6, compiled by Visual C++ build 1914, 64-bit

 true

 0       3.9548627765822e-10

 }}}

 I thought that ST_Distance and _ST_DistanceTree are supposed to agree with
 each other - in all cases they do not agree (2.5 or 3.0) regardless of
 PostgreSQL version

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4604#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