different results for ST_Relate with 3 parameters compared to those for ST_Relate with 2 parameters

Paul Ramsey pramsey at cleverelephant.ca
Wed Oct 15 10:28:25 PDT 2025


Maybe you have found an old bug? Running exactly the same SQL as you, I get
two rows from each query.

postgis=# SELECT

            d.id,

                     ST_Relate(d.geom, l.geom) as patternMatrix

                            FROM docks as d, lakes as l

                                     WHERE ST_Relate(d.geom, l.geom,
'1FF00F212');
 id | patternmatrix
----+---------------
  1 | 1FF00F212
  2 | 1FF00F212
(2 rows)

postgis=# SELECT
postgis-#   d.id,
postgis-#   ST_Relate(d.geom, l.geom) as patternMatrix
postgis-# FROM docks as d, lakes as l
postgis-# WHERE ST_Relate(d.geom, l.geom) = '1FF00F212';
 id | patternmatrix
----+---------------
  1 | 1FF00F212
  2 | 1FF00F212
(2 rows)

postgis=#
postgis=# select postgis_full_version();



postgis_full_version



----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.7.0dev 3.6.0rc2-134-g5dc95f1bc" [EXTENSION] PGSQL="180"
GEOS="3.15.0dev-CAPI-1.21.0" PROJ="9.6.2 NETWORK_ENABLED=ON URL_ENDPOINT=
https://cdn.proj.org
USER_WRITABLE_DIRECTORY=/Users/pramsey/Library/Application Support/proj
DATABASE_PATH=/opt/homebrew/Cellar/proj/9.6.2/share/proj/proj.db" (compiled
against PROJ 9.6.2) LIBXML="2.9.13" LIBJSON="0.18" LIBPROTOBUF="1.5.2"
WAGYU="0.5.0 (Internal)" (core procs from "3.7.0dev
3.6.0rc2-125-g747d7732b" need upgrade)

On Wed, Oct 15, 2025 at 9:22 AM Antonio Valanzano <anvalanz at gmail.com>
wrote:

> I am following the "Introduction to PostGIS " tutorial  at
> https://postgis.net/workshops/postgis-intro/
> and for chapter 26 "Dimensionally Extended 9-Intersection Model"  I am
> trying to replicate the examples.
>
> If I use the two different versions of ST_Relate I do not obtain the same
> result
>
> SELECT
>   d.id,
>   ST_Relate(d.geom, l.geom) as patternMatrix
> FROM docks as d, lakes as l
> WHERE ST_Relate(d.geom, l.geom, '1FF00F212') = true;
> -- 1 row
> "id" "patternmatrix"
> 1    "1FF00F212"
>
>
>
> SELECT
>   d.id,
>   ST_Relate(d.geom, l.geom) as patternMatrix
> FROM docks as d, lakes as l
> WHERE ST_Relate(d.geom, l.geom) = '1FF00F212';
> -- 2 rows
> "id" "patternmatrix"
> 1    "1FF00F212"
> 2    "1FF00F212"
>
> Could someone give me an explanation of such a difference ?
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20251015/676c6a3f/attachment.htm>


More information about the postgis-users mailing list