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 11:59:21 PDT 2025
Sorry, I still cannot replicate. My 3.5 build still returns both results.
Maybe update to PostGIS 3.5.4 and GEOS 3.13.1 ?
P.
On Wed, Oct 15, 2025 at 11:25 AM Antonio Valanzano <anvalanz at gmail.com>
wrote:
> Here is the details of my installation:
>
> "postgis_full_version"
> "POSTGIS=""3.5.2 3.5.2"" [EXTENSION] PGSQL=""170""
> GEOS=""3.13.0-CAPI-1.19.0"" PROJ=""8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=
> https://cdn.proj.org
> USER_WRITABLE_DIRECTORY=C:\Windows\ServiceProfiles\NetworkService\AppData\Local/proj
> DATABASE_PATH=C:\Program
> Files\PostgreSQL\17\share\contrib\postgis-3.5\proj\proj.db"" (compiled
> against PROJ 8.2.1) LIBXML=""2.12.5"" LIBJSON=""0.12""
> LIBPROTOBUF=""1.2.1"" WAGYU=""0.5.0 (Internal)"""
>
> Antonio
>
>
>
> Il giorno mer 15 ott 2025 alle ore 19:28 Paul Ramsey <
> pramsey at cleverelephant.ca> ha scritto:
>
>> 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/eb481557/attachment.htm>
More information about the postgis-users
mailing list