PostgreSQL 变换几何

PostgreSQL Transform Geometries

我有一个 table 满 Easting/Northing 个点,我想将其转换为 SRID:27700 中的一列。 我正在使用安装了 postgis 的 Postgres。

我正在尝试这个:

alter table ua
add column location geometry(point,27700);

UPDATE ua 
    SET "location" = 'SRID=27700;POINT(' || ua."Easting" || ' ' || ua."Northing" || ')';

当然这个 returns easting/northing 中的位置,但是当我尝试首先使用 ST_Transform 转换点时,它 returns

SQL Error [42883]: ERROR: function st_transform(character varying, integer) does not exist

我不知道如何超越这个!

ST_Transform 获取其中一组参数,其中 none 获取字符作为第一个参数类型,而您将字符作为第一个参数传递,将 int 作为第二个参数传递!

geometry ST_Transform(geometry g1, integer srid);
geometry ST_Transform(geometry geom, text to_proj);
geometry ST_Transform(geometry geom, text from_proj, text to_proj);
geometry ST_Transform(geometry geom, text from_proj, integer to_srid);

我认为这应该可行:

update ua 
set "east/north" = ST_GeomFromText('POINT(' || ua."Easting" ||' '|| ua."Northing" || ')',27700)