[postgis-users] ST_Transform weirdness in 3.1.5

Jeff Hoffmann jeff at propertykey.com
Mon Apr 4 09:18:07 PDT 2022


I am running PostgreSQL via Amazon RDS. Here is the version
information for the instance that exhibits the problem:

                                                   version
-------------------------------------------------------------------------------------------------------------
 PostgreSQL 12.8 on aarch64-unknown-linux-gnu, compiled by
aarch64-unknown-linux-gnu-gcc (GCC) 7.4.0, 64-bit
(1 row)

postgis_full_version
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.1.5 0" [EXTENSION] PGSQL="120" GEOS="3.8.2-CAPI-1.13.4"
PROJ="6.2.1" LIBXML="2.9.9" LIBJSON="0.12.99" LIBPROTOBUF="1.3.0"
WAGYU="0.5.0 (Internal)"
(1 row)

Here is an example of a query that produces weird results:


select st_asewkt(st_transform('SRID=4269;POLYGON((-81.11425169432798
25.139365690162226,-79.88375846050846
25.135204935817377,-79.8759485474324
25.97511821217247,-81.11505127181294
25.97943803781699,-81.11425169432798 25.139365690162226))'::geometry,
3087));

        st_asewkt
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 SRID=3087;POLYGON((690648.3378382007 129676.3544158864,Infinity
Infinity,Infinity Infinity,688388.1492655604
222840.53520809134,690648.3378382007 129676.3544158864))
(1 row)

Two of the points are coming up as (Infinty,Infinity).  When I run the
same query using the proj4text found in the spatial_ref_sys table
instead of the srid I get the following output:

select st_asewkt(st_transform('SRID=4269;POLYGON((-81.11425169432798
25.139365690162226,-79.88375846050846
25.135204935817377,-79.8759485474324
25.97511821217247,-81.11505127181294
25.97943803781699,-81.11425169432798 25.139365690162226))'::geometry,
'+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000
+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'));

                     st_asewkt
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POLYGON((690648.3378382007 129676.3544158864,814558.219082916
132733.37665360732,812229.019377012
225881.33726899035,688388.1492655604
222840.53520809134,690648.3378382007 129676.3544158864))
(1 row)

This looks pretty close to right.  What is the disconnect between
using the srid to call the transform vs the proj4text version of
st_transform?

-- 
Jeff Hoffmann
PropertyKey
jeff at propertykey.com


More information about the postgis-users mailing list