I have in my table column geom
with geometry, data type of this column is geometry(Point,102067)
. I want to change SRID
from 102067
to 5514
, but if I use this command
select UpdateGeometrySRID('my_schema', 'table', 'geom', 5514) ;
docs say: ERROR: invalid SRID: 5514 not found in spatial_ref_sys
CONTEXT: SQL statement "SELECT UpdateGeometrySRID('',$1,$2,$3,$4)"
I found, that EPSG:5514 = EPSG:102067 (both is S-JTSK_Krovak_East_North), but in second table I have EPSG:5514, and for example comand ST_Contains
says: Operation on mixed SRID geometries.
Best Answer
The error happened because EPSG:5514 is no added in spatal_ref_sys table. So you can add it using the following query.
Source: https://epsg.io/5514
Click on the side menu under PostGIS to see the insert query.
Check if SRID-5514 is inserted using:
Once you have inserted it, you can then change the SRID of your geometry column using the code:
You can then check the change using: