-1

I recently upgraded my Amazon PostgreSQL RDS to version 10.3 but while fetching the projections I am getting error:

ERROR:  transform_geom: couldn't parse proj4 output string: '3857': projection not named
CONTEXT:  SQL function "st_transform" statement 1

Same records i am able to fetch prior to version 9.5.xx

My PostGIS version is 2.4.2 which is compatible to RDS intance.

Derrick
  • 3,669
  • 5
  • 35
  • 50

1 Answers1

2

I perhaps faced the same problem after upgrading from postgis 2.2 to 2.3, some of my queries did no work anymore.

Old-query:

SELECT ST_X(ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT($1,$2),$3),$4));

query-params $1...$4:
602628,6663367,3857,3857

error message:
"transform_geom: couldn't parse proj4 output string: '3857': projection not named"

Reason:
ST_TRANSFORM comes in multiple flavours, two of them:

  • public.st_transform(geometry, integer)
  • public.st_transform(geometry, text)

Latter one, I assume new in postgis 2.3, caused my problem, because $4 (3857) was regarded as (proj4-) string and not as (SRID-) integer.

Workaround in my case: type-hint for param $4

SELECT ST_X(ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT($1,$2),$3),$4::int));
ludwig
  • 488
  • 4
  • 8