WKT2 in PostGIS
Regina Obe
lr at pcorp.us
Wed Sep 9 10:01:57 PDT 2026
My main question is – is PostGIS really the right place to do that or should it be done in PROJ_AUX_DB as we had discussed here - https://lists.osgeo.org/pipermail/postgis-users/2025-May/046796.html
But I’m fine with changing srtext to text.
It might create some minor upgrade issues mostly if for some reason someone has decided to create a view against spatial_ref_sys which I suspect few people have.
From: Javier Jimenez Shaw <j1 at jimenezshaw.com>
Sent: Wednesday, September 9, 2026 7:09 AM
To: postgis-devel at lists.osgeo.org
Subject: WKT2 in PostGIS
Hi
In the new PROJ release 9.9.0 that will be released soon, the latest version of EPSG is included.
All European realizations are included in the WKT2 of any CRS using the ETRS89 datum ensemble.
This is an example of EPSG:25830, with 4264 chars.
https://epsg.org/crs/wkt/id/25830
If you format it a bit nicely it goes up to 4874. And this is just an example.
I know that this one can be expressed just with the code. However some people (including me) need to define a CRS that is not defined in EPSG. For that we are using WKT2.
I realized today that in PostGIS the table containing the CRS has fields limited to 2048 chars, in particular "srtext".
https://postgis.net/docs/using_postgis_dbmanagement.html#spatial_ref_sys_table
CREATE TABLE spatial_ref_sys (
srid INTEGER NOT NULL PRIMARY KEY,
auth_name VARCHAR(256),
auth_srid INTEGER,
srtext VARCHAR(2048),
proj4text VARCHAR(2048)
)
If I have to define a CRS with WKT2 because I need some features only available in WKT2, it may not work in PostGIS. Am I right?
Thank you.
Javier.
PS this was first asked in https://lists.osgeo.org/pipermail/proj/2026-September/012183.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20260909/9b5aabb6/attachment.htm>
More information about the postgis-devel
mailing list