WKT2 in PostGIS

Regina Obe lr at pcorp.us
Wed Sep 9 08:47:43 PDT 2026


Javier,

 

We’ve been hesitant to touch this table to increase it. I know someone else requested this.

Our feeling is the proj.db should be the authoritative source for most of these.

 

I there a reason you wouldn’t add this to proj directly?  The issue with putting it in postgis spatial_ref_sys is if you use your system beyond postgis

You’d have to duplicate the entry anyway.

 

But I am and I think others were concerned for many users especially those who don’t need these defs elsewhere, it’s easier to edit postgis.spatial_ref_sys,

 

PostGIS for since I think 3.0 has delegated most stuff to the proj.db table and just uses spatial_ref_sys auth_srid to look up the record in proj.db and largely ignores what is in srtext/proj4text columns.

 

I have to check the auth_name.  I think we used to ignore what was in auth_name and assumed any auth_srid matched up with auth_name = epsg, but that I think changed somewhere across the line.

 

Paul,

 

If per chance you have remember or have the energy to chime in on this, that would be much appreciated.

 

Thanks,

Regina

 

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/0fb03f22/attachment.htm>


More information about the postgis-devel mailing list