Skip to content

Instantly share code, notes, and snippets.

@ImreSamu
Created October 4, 2021 21:59
Show Gist options
  • Save ImreSamu/f555523a4e1c00a5343455cda965c5a2 to your computer and use it in GitHub Desktop.
Save ImreSamu/f555523a4e1c00a5343455cda965c5a2 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -Eeuo pipefail
# bash test_st_astext_precision.bash > test_st_astext_precision.log
# related? https://trac.osgeo.org/postgis/ticket/4947
function postgistest {
dockername="$1"
dockerimages="$2"
echo ""
echo "=========================================================================="
echo "test case: ${dockername} + docker image: ${dockerimages} "
echo "=========================================================================="
docker pull ${dockerimages}
docker run --name ${dockername} -e POSTGRES_PASSWORD=mysecretpassword -d ${dockerimages}
sleep 12
docker exec -it ${dockername} psql -U postgres \
-c "select version();" \
-c "select postgis_full_version();" \
-c "SELECT ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(20.2598350247713 45.2828985219965)'),32634) as g;" \
-c "SELECT ST_AsTEXT(ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(20.2598350247713 45.2828985219965)'),32634)) as g;" \
-c "SELECT ST_AsTEXT(ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(20.2598350247713 45.2828985219965)'),32634), 30) as g;" \
-c "SELECT ST_AsEWKT(ST_Transform(ST_GeomFromEWKT('SRID=4326;POINT(20.2598350247713 45.2828985219965)'),32634)) as g;"
docker stop ${dockername}
docker rm ${dockername}
docker image ls ${dockerimages}
}
# testcases:
postgistest pgis9625 postgis/postgis:9.6-2.5 # stretch
postgistest pgis1331 postgis/postgis:11-2.5 # stretch
postgistest pgis1330 postgis/postgis:13-3.0 # buster
postgistest pgis1331 postgis/postgis:13-3.1 # bullseye
postgistest pgis14m postgis/postgis:14-master # bullseye
postgistest pgis1330alpine postgis/postgis:11-2.5-alpine # alpine
postgistest pgis1330alpine postgis/postgis:13-3.0-alpine # alpine
postgistest pgis1331alpine postgis/postgis:13-3.1-alpine # alpine
# test end
==========================================================================
test case: pgis9625 + docker image: postgis/postgis:9.6-2.5
==========================================================================
9.6-2.5: Pulling from postgis/postgis
Digest: sha256:7ab122abb839cbfb15a3354630a388cf944e9209fb5bc174db5fdccbb310a6ab
Status: Image is up to date for postgis/postgis:9.6-2.5
docker.io/postgis/postgis:9.6-2.5
6bb4d60873901708c3b11e1f2cd138eafd8cbad4314ca818b2e387fafbf2c232
version
--------------------------------------------------------------------------------
------------------------------------------------------
PostgreSQL 9.6.23 on x86_64-pc-linux-gnu (Debian 9.6.23-1.pgdg90+1), compiled b
y gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
postgis_full_version
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------------------------------
POSTGIS="2.5.5" [EXTENSION] PGSQL="96" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="
Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.1.2, released 2016/10/24" LIBXML="2.9.4
" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" TOPOLOGY RASTER
(1 row)
g
----------------------------------------------------
01010000207A7F00004F6666E67DF91A418B6CE7031D215341
(1 row)
g
-------------------------------------
POINT(441951.474999999 5014644.061)
(1 row)
g
------------------------------------------------------------------------
POINT(441951.474999998637940734624863 5014644.06099999975413084030151)
(1 row)
g
------------------------------------------------
SRID=32634;POINT(441951.474999999 5014644.061)
(1 row)
pgis9625
pgis9625
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 9.6-2.5 c84d082337a1 17 hours ago 333MB
==========================================================================
test case: pgis1331 + docker image: postgis/postgis:11-2.5
==========================================================================
11-2.5: Pulling from postgis/postgis
Digest: sha256:e176ef2874f37abe23cbcd52ef4c63961c3bf891abfd6d506440b738db4e06bc
Status: Image is up to date for postgis/postgis:11-2.5
docker.io/postgis/postgis:11-2.5
570931f8181f572d38790edb96a0b5da54428f3b2b63e2fa8dd5e373c721e58d
version
--------------------------------------------------------------------------------
----------------------------------------------------
PostgreSQL 11.13 (Debian 11.13-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
postgis_full_version
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------
POSTGIS="2.5.5" [EXTENSION] PGSQL="110" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ=
"Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.1.2, released 2016/10/24" LIBXML="2.9.
4" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" TOPOLOGY RASTER
(1 row)
g
----------------------------------------------------
01010000207A7F00004F6666E67DF91A418B6CE7031D215341
(1 row)
g
-------------------------------------
POINT(441951.474999999 5014644.061)
(1 row)
g
------------------------------------------------------------------------
POINT(441951.474999998637940734624863 5014644.06099999975413084030151)
(1 row)
g
------------------------------------------------
SRID=32634;POINT(441951.474999999 5014644.061)
(1 row)
pgis1331
pgis1331
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 11-2.5 a07fc6741000 17 hours ago 422MB
==========================================================================
test case: pgis1330 + docker image: postgis/postgis:13-3.0
==========================================================================
13-3.0: Pulling from postgis/postgis
Digest: sha256:2909f84f1f06d74c63d8b4c54cab14843fb4d6e2e7272173f03b992cb280e60e
Status: Image is up to date for postgis/postgis:13-3.0
docker.io/postgis/postgis:13-3.0
0a668d1a133b6a6ed3a118d87271a66fb5eafd05299f9c707f9f01ce61b65e9a
version
--------------------------------------------------------------------------------
----------------------------------
PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by g
cc (Debian 8.3.0-6) 8.3.0, 64-bit
(1 row)
postgis_full_version
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------------------------
POSTGIS="3.0.3 6660953" [EXTENSION] PGSQL="130" GEOS="3.7.1-CAPI-1.11.1 27a5e77
1" PROJ="Rel. 5.2.0, September 15th, 2018" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPR
OTOBUF="1.3.1" WAGYU="0.4.3 (Internal)" TOPOLOGY
(1 row)
g
----------------------------------------------------
01010000207A7F00004F6666E67DF91A418B6CE7031D215341
(1 row)
g
-------------------------------------
POINT(441951.474999999 5014644.061)
(1 row)
g
------------------------------------------------------------------------
POINT(441951.474999998637940734624863 5014644.06099999975413084030151)
(1 row)
g
------------------------------------------------
SRID=32634;POINT(441951.474999999 5014644.061)
(1 row)
pgis1330
pgis1330
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 13-3.0 c9d553ffe14f 9 months ago 490MB
==========================================================================
test case: pgis1331 + docker image: postgis/postgis:13-3.1
==========================================================================
13-3.1: Pulling from postgis/postgis
Digest: sha256:1c2217422bcbfb2b059d6c7dfc46a50d43defe653102de5ceec5e9fa450c62cd
Status: Image is up to date for postgis/postgis:13-3.1
docker.io/postgis/postgis:13-3.1
ee8dcc964f6aaeae1c7c9e174e54ccb00bc28eef452afac3c7d414a52fe35749
version
--------------------------------------------------------------------------------
---------------------------------------------
PostgreSQL 13.4 (Debian 13.4-4.pgdg110+1) on x86_64-pc-linux-gnu, compiled by g
cc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
(1 row)
post
gis_full_version
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------
POSTGIS="3.1.4 ded6c34" [EXTENSION] PGSQL="130" GEOS="3.9.0-CAPI-1.16.2" PROJ="
7.2.1" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal
)" TOPOLOGY
(1 row)
g
----------------------------------------------------
01010000207A7F00004E6666E67DF91A418B6CE7031D215341
(1 row)
g
--------------------------------------
POINT(441951.4749999986 5014644.061)
(1 row)
g
--------------------------------------
POINT(441951.4749999986 5014644.061)
(1 row)
g
-------------------------------------------------
SRID=32634;POINT(441951.4749999986 5014644.061)
(1 row)
pgis1331
pgis1331
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 13-3.1 88c6f3b0713f 17 hours ago 567MB
==========================================================================
test case: pgis14m + docker image: postgis/postgis:14-master
==========================================================================
14-master: Pulling from postgis/postgis
Digest: sha256:e3638383b3e7b6617512bdae51abe054dfe73fcfcc790a6e03bc5ad8bcbff399
Status: Image is up to date for postgis/postgis:14-master
docker.io/postgis/postgis:14-master
a393e71986452abac1b386bf67541a176e910f2fa51b84ea7faeda596cc133a9
version
--------------------------------------------------------------------------------
---------------------------------------------
PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by g
cc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
(1 row)
postgis_full_version
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------------
POSTGIS="3.2.0dev 3.2.0alpha1-46-g21c3f2351" [EXTENSION] PGSQL="140" GEOS="3.10
.0dev-CAPI-1.15.0" PROJ="8.2.0" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.
3" WAGYU="0.5.0 (Internal)" TOPOLOGY
(1 row)
g
----------------------------------------------------
01010000207A7F00004E6666E67DF91A418B6CE7031D215341
(1 row)
g
--------------------------------------
POINT(441951.4749999986 5014644.061)
(1 row)
g
--------------------------------------
POINT(441951.4749999986 5014644.061)
(1 row)
g
-------------------------------------------------
SRID=32634;POINT(441951.4749999986 5014644.061)
(1 row)
pgis14m
pgis14m
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 14-master cfd479f4514a 16 hours ago 887MB
==========================================================================
test case: pgis1330alpine + docker image: postgis/postgis:11-2.5-alpine
==========================================================================
11-2.5-alpine: Pulling from postgis/postgis
Digest: sha256:47154abee7dee564931c1b9951c02da56f5fa407b7ac5e05ea3ef48c1b8667d4
Status: Image is up to date for postgis/postgis:11-2.5-alpine
docker.io/postgis/postgis:11-2.5-alpine
909d3e6d537296ed03a88dfb4cb804eeb421339c490eac15e94d0d2639f588ce
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 11.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
(1 row)
postgis_full_version
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="2.5.5" [EXTENSION] PGSQL="110" GEOS="3.8.2-CAPI-1.13.4" PROJ="Rel. 7.2.1, January 1st, 2021" GDAL="GDAL 3.2.3, released 2021/04/27" LIBXML="2.9.12" LIBJSON="0.15" LIBPROTOBUF="1.3.3" TOPOLOGY RASTER
(1 row)
g
----------------------------------------------------
01010000207A7F00004E6666E67DF91A418C6CE7031D215341
(1 row)
g
-------------------------------------
POINT(441951.474999999 5014644.061)
(1 row)
g
------------------------------------------------------------------------
POINT(441951.474999998579733073711395 5014644.06100000068545341491699)
(1 row)
g
------------------------------------------------
SRID=32634;POINT(441951.474999999 5014644.061)
(1 row)
pgis1330alpine
pgis1330alpine
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 11-2.5-alpine 6fda19c48b67 16 hours ago 322MB
==========================================================================
test case: pgis1330alpine + docker image: postgis/postgis:13-3.0-alpine
==========================================================================
13-3.0-alpine: Pulling from postgis/postgis
05e7bc50f07f: Pulling fs layer
b05eb41eecb9: Pulling fs layer
8a37c8fecb6a: Pulling fs layer
ccad999f964e: Pulling fs layer
b2ca942b5238: Pulling fs layer
b39228c90d11: Pulling fs layer
0be8ebd0ef62: Pulling fs layer
976c32ae61dc: Pulling fs layer
ad09df17844e: Pulling fs layer
9ce3bd1610f5: Pulling fs layer
712bebee5811: Pulling fs layer
ccad999f964e: Waiting
976c32ae61dc: Waiting
ad09df17844e: Waiting
b2ca942b5238: Waiting
9ce3bd1610f5: Waiting
712bebee5811: Waiting
b39228c90d11: Waiting
0be8ebd0ef62: Waiting
8a37c8fecb6a: Verifying Checksum
8a37c8fecb6a: Download complete
b05eb41eecb9: Verifying Checksum
b05eb41eecb9: Download complete
05e7bc50f07f: Verifying Checksum
05e7bc50f07f: Download complete
05e7bc50f07f: Pull complete
b05eb41eecb9: Pull complete
8a37c8fecb6a: Pull complete
b2ca942b5238: Verifying Checksum
b2ca942b5238: Download complete
b39228c90d11: Verifying Checksum
b39228c90d11: Download complete
0be8ebd0ef62: Verifying Checksum
0be8ebd0ef62: Download complete
976c32ae61dc: Verifying Checksum
976c32ae61dc: Download complete
9ce3bd1610f5: Verifying Checksum
9ce3bd1610f5: Download complete
712bebee5811: Download complete
ad09df17844e: Verifying Checksum
ad09df17844e: Download complete
ccad999f964e: Download complete
ccad999f964e: Pull complete
b2ca942b5238: Pull complete
b39228c90d11: Pull complete
0be8ebd0ef62: Pull complete
976c32ae61dc: Pull complete
ad09df17844e: Pull complete
9ce3bd1610f5: Pull complete
712bebee5811: Pull complete
Digest: sha256:fd63612adb8911c8f7865e41ddf9e85c02b7761ff62232cb758d6d28d8101e7b
Status: Downloaded newer image for postgis/postgis:13-3.0-alpine
docker.io/postgis/postgis:13-3.0-alpine
e317a5d77e9e5d2b0f030f4a364d926156dfe0a285c0cc36c8c2bbcced15e8e2
version
---------------------------------------------------------------------------------------
PostgreSQL 13.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
(1 row)
postgis_full_version
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="3.0.3 0" [EXTENSION] PGSQL="130" GEOS="3.8.1-CAPI-1.13.3" PROJ="7.0.1" LIBXML="2.9.10" LIBJSON="0.14" LIBPROTOBUF="1.3.3" WAGYU="0.4.3 (Internal)" TOPOLOGY
(1 row)
g
----------------------------------------------------
01010000207A7F00004F6666E67DF91A418C6CE7031D215341
(1 row)
g
-------------------------------------
POINT(441951.474999999 5014644.061)
(1 row)
g
------------------------------------------------------------------------
POINT(441951.474999998637940734624863 5014644.06100000068545341491699)
(1 row)
g
------------------------------------------------
SRID=32634;POINT(441951.474999999 5014644.061)
(1 row)
pgis1330alpine
pgis1330alpine
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 13-3.0-alpine 42431954d6fd 9 months ago 292MB
==========================================================================
test case: pgis1331alpine + docker image: postgis/postgis:13-3.1-alpine
==========================================================================
13-3.1-alpine: Pulling from postgis/postgis
Digest: sha256:d5018d5ea16e95838c816d2a904f2bf510077a8bc4f757add846964bf6336b8d
Status: Image is up to date for postgis/postgis:13-3.1-alpine
docker.io/postgis/postgis:13-3.1-alpine
af28f8e53c910fefc26d4ffbdfbec4e4c1e6947ff53272b9d4096f6b7231e370
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 13.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
(1 row)
postgis_full_version
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="3.1.4 0" [EXTENSION] PGSQL="130" GEOS="3.9.1-CAPI-1.14.2" PROJ="7.2.1" LIBXML="2.9.12" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY
(1 row)
g
----------------------------------------------------
01010000207A7F00004E6666E67DF91A418C6CE7031D215341
(1 row)
g
--------------------------------------------
POINT(441951.4749999986 5014644.061000001)
(1 row)
g
--------------------------------------------
POINT(441951.4749999986 5014644.061000001)
(1 row)
g
-------------------------------------------------------
SRID=32634;POINT(441951.4749999986 5014644.061000001)
(1 row)
pgis1331alpine
pgis1331alpine
REPOSITORY TAG IMAGE ID CREATED SIZE
postgis/postgis 13-3.1-alpine 17db81dc773a 17 hours ago 331MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment