Consider the following queries:
SELECT ST_GeomFromEWKT('SRID=32632;POINT(10 20)')::varchar
UNION ALL
SELECT ST_GeomFromEWKT('SRID=4326;POINT(10 20)')::varchar;
UNION ALL
SELECT ST_AsEWKT(ST_GeomFromEWKT('SRID=32632;POINT(10 20)'))
UNION ALL
SELECT ST_AsEWKT(ST_GeomFromEWKT('SRID=4326;POINT(10 20)'))
(Note: the UNION ALL
is just so you can copy and paste the whole thing easily)
Results:
0101000020787F000000000000000024400000000000003440
0101000020E610000000000000000024400000000000003440
SRID=32632;POINT(10 20)
SRID=4326;POINT(10 20)
According to the PostGIS documentation, ST_GeomFromEWKT
returns a ST_Geometry
object. From my first two queries it looks like the resulting objects are identical. They are not, however (see queries 3 and 4).
Now my question is, where is this additional information stored and how can I access the "complete" ST_Geometry
object (so all data that are contained in it)?
Version info:
PostgreSQL
: PostgreSQL 10.3 (Debian 10.3-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bitPostGIS
: POSTGIS="2.4.3 r16312" PGSQL="100" GEOS="3.5.1-CAPI-1.9.1 r4246" SFCGAL="1.3.0" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.2, released 2017/09/15" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" (core procs from "2.4.1 r16012" need upgrade) TOPOLOGY (topology procs from "2.4.1 r16012" need upgrade) RASTER (raster procs from "2.4.1 r16012" need upgrade) (sfcgal procs from "2.4.1 r16012" need upgrade)