Bug#1035921: postgresql-13-postgis-3: Inverted x-y-coordinates for EPSG:31466 when transforming coordinates since 3.1.1+dfsg-1+deb11u1

Stephan Großberndt s.grossberndt at sidebysite.de
Thu May 11 09:02:18 BST 2023


Package: postgresql-13-postgis-3
Version: 3.1.1+dfsg-1+deb11u1
Severity: important

Dear Maintainer,

after applying the minor update from 3.1.1+dfsg-1 to 3.1.1+dfsg-1+deb11u1 the transformation
of coordinates for EPSG:31466 no longer works correctly, the values for x and
y are inverted which broke applications on a production server relying on the correct order.

This behaviour was probably a unwanted side effect of
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031392


The steps to reproduce this issue are:

  - create a test "bullseye" system (e.g. in vagrant)
  - ensure the system is up to date:
    `sudo apt update && sudo apt upgrade`
  - install Postgres with the PostGIS extensions:
    `sudo apt install -y postgresql-13-postgis-3`
  - create a test database:
    `sudo -u postgres createdb -E UTF8 -T template0 test_db`
  - create the PostGIS extension on the test database:
    `sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS postgis;" test_db`
  - start `psql` and transform a test point from epsg:3857 to epsg:31466

```
sudo -u postgres psql -d test_db
psql (13.10 (Debian 13.10-0+deb11u1))
Type "help" for help.

test_db=# select ST_AsEWKT(ST_Transform(ST_GeomFromEWKT('SRID=3857;POINT(730249 6518693)'), 31466));
                       st_asewkt
--------------------------------------------------------
 SRID=31466;POINT(5586868.886276492 2539841.4544491787)
(1 row)
```

The expected output as from
- PostgresQL 11 with PostGIS 2.5.1+dfsg-1 from Debian Sources
- PostgresQL 11 with PostGIS 2.5.5+dfsg-1.pgdg100+2 from PostgreSQL Sources
- PostgresQL 13 with PostGIS 3.1.1+dfsg-1 from Debian Sources
- PostgresQL 13 with PostGIS 3.3.2+dfsg-1.pgdg110+1 from PostgreSQL Sources

is:

```
sudo -u postgres psql -d test_db
psql (13.10 (Debian 13.10-1.pgdg110+1))
Type "help" for help.

[test_db] # select ST_AsEWKT(ST_Transform(ST_GeomFromEWKT('SRID=3857;POINT(730249 6518693)'), 31466));
                       st_asewkt
--------------------------------------------------------
 SRID=31466;POINT(2539841.4544491787 5586868.886276492)
(1 row)
```

As one can see, the point values are inverted.


-- System Information:
Debian Release: 11.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-20-amd64 (SMP w/4 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages postgresql-13-postgis-3 depends on:
ii  libc6                            2.31-13+deb11u6
ii  libgcc-s1                        10.2.1-6
ii  libgdal28                        3.2.2+dfsg-2+deb11u2
ii  libgeos-c1v5                     3.9.0-1
ii  libjson-c5                       0.15-2
ii  libpcre3                         2:8.39-13
ii  libproj19                        7.2.1-1
ii  libprotobuf-c1                   1.3.3-1+b2
ii  libsfcgal1                       1.3.9-2
ii  libstdc++6                       10.2.1-6
ii  libxml2                          2.9.10+dfsg-6.7+deb11u4
ii  postgresql-13                    13.10-0+deb11u1
ii  postgresql-13-postgis-3-scripts  3.1.1+dfsg-1+deb11u1

postgresql-13-postgis-3 recommends no packages.

Versions of packages postgresql-13-postgis-3 suggests:
pn  postgis  <none>

-- no debconf information



More information about the Pkg-grass-devel mailing list