Chapter 8. Temporal Geometry Types (Part 2)

Table of Contents

Spatial Reference System
Bounding Box Operations
Distance Operations
Spatial Relationships
Ever and Always Spatial Relationships
Temporal Spatial Relationships

Spatial Reference System

  • Return or set the spatial reference identifier

    SRID(tspatial) → integer

    setSRID(tspatial) → tspatial

    SELECT SRID(tgeompoint 'Point(0 0)@2001-01-01');
    -- 0
    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 spatial reference identifier

    transform(tspatial,integer) → tspatial

    transformPipeline(tspatial,pipeline text,to_srid integer,is_forward bool=true) → tspatial

    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(tgeo, 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(tgeo, 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} */