Return the spatial reference identifier
SRID(tpoint) → integer
SELECT SRID(tgeompoint 'Point(0 0)@2001-01-01'); -- 0
Set the spatial reference identifier
setSRID(tpoint) → tpoint
SELECT asEWKT(setSRID(tgeompoint '[Point(0 0)@2001-01-01, Point(1 1)@2001-01-02)', 4326)); -- SRID=4326;[POINT(0 0)@2001-01-01, POINT(1 1)@2001-01-02)
Transform to a different spatial reference
transform(tpoint,integer) → tpoint
transform(tpoint,pipeline text,to_srid integer,is_forward bool=true) → tpoint
The transform
function specifies the transformation with a target SRID. An error is raised when the input temporal point has an unknown SRID (represented by 0).
The transformPipeline
function specifies the transformation with a defined coordinate transformation pipeline represented with the following string format: urn:ogc:def:coordinateOperation:AUTHORITY::CODE
. The SRID of the input temporal point is ignored, and the SRID of the output temporal point will be set to zero unless a value is provided via the optional to_srid
parameter. As stated by the last parameter, the pipeline is executed by default in a forward direction; by setting the parameter to false, the pipeline is executed in the inverse direction.
SELECT asEWKT(transform(tgeompoint 'SRID=4326;Point(4.35 50.85)@2001-01-01', 3812)); -- SRID=3812;POINT(648679.018035303 671067.055638114)@2001-01-01
WITH test(tpoint, pipeline) AS ( SELECT tgeogpoint 'SRID=4326;{Point(4.3525 50.846667 100.0)@2001-01-01, Point(-0.1275 51.507222 100.0)@2001-01-02}', text 'urn:ogc:def:coordinateOperation:EPSG::16031' ) SELECT asEWKT(transformPipeline(transformPipeline(tpoint, pipeline, 4326), pipeline, 4326, false), 6) FROM test; /* SRID=4326;{POINT Z (4.3525 50.846667 100)@2001-01-01, POINT Z (-0.1275 51.507222 100)@2001-01-02} */