Planar and Geodetic Computations

The coordinates of a temporal geometry (tgeometry or tgeompoint) are interpreted in the plane of their spatial reference system, and those of a temporal geography (tgeography or tgeogpoint) as longitudes and latitudes on the WGS 84 ellipsoid. Which operations a temporal geography supports, and how exactly, follows from three rules.

  1. An operation is available for geographies when it is defined on the ellipsoid. This is the case of the metric operations, such as the distance, the distance within, the length, the area, the azimuth, or the centroid, which are computed on the WGS 84 spheroid, or on the sphere, faster, when their argument spheroid is false. It is also the case of the intersection and the disjointness, since two geographies intersect when their distance is zero. It is not the case of contains, covers, and touches, which are defined by the dimensionally extended nine-intersection model of planar topology, nor of the planar constructions, such as the union or the intersection of two geometries, which PostGIS does not define for geographies either. These functions raise an error for geographies.

  2. The ever, always, and temporal versions of an operation available for geographies are computed exactly. The value of a temporal geography, and of a temporal geography point with discrete or step interpolation, is constant between two instants, so the operation is evaluated at each instant. A temporal geography point with linear interpolation moves along a great circle between two instants, and the result of a temporal relationship changes at the instants at which its geodetic distance to the other argument crosses the given distance. These instants are computed when the other argument is a geography point or a temporal geography point. For other geographies, such as lines and polygons, the temporal relationships tIntersects, tDisjoint, and tDwithin of a temporal geography point with linear interpolation raise an error.

  3. A temporal relationship available for geographies accepts a geography or a temporal geography on either side, as its planar version accepts a geometry or a temporal geometry.

A temporal geometry in SRID 4326 is converted into a temporal geography with the same values by the cast ::tgeography, and back by the cast ::tgeometry. The function transform reprojects it instead into a planar spatial reference system whose unit is the meter, in which distances and areas are planar.

SELECT round(nearestApproachDistance(tgeometry 'SRID=4326;[Polygon((4.35 50.84,
  4.40 50.84,4.40 50.88,4.35 50.84))@2001-01-01, Point(4.37 50.85)@2001-01-02]',
  geometry 'SRID=4326;Point(4.45 50.84)')::numeric, 4);
-- 0.0500
SELECT round(nearestApproachDistance(tgeometry 'SRID=4326;[Polygon((4.35 50.84,
  4.40 50.84,4.40 50.88,4.35 50.84))@2001-01-01, Point(4.37 50.85)@2001-01-02]'
  ::tgeography, geography 'Point(4.45 50.84)')::numeric, 1);
-- 3521.9