H3 directed edges are themselves 64-bit identifiers (encoded differently from cell identifiers, isValidDirectedEdge distinguishes them). The MobilityDB th3index type carries directed edges by convention: the same type, interpreted through edge-specific accessors.
Return a temporal boolean stating whether two temporal cells are grid neighbours at each instant. The two operands are synchronised.
th3AreNeighborCells(th3index,th3index) → tbool
SELECT th3AreNeighborCells( th3index '880326b885fffff@2001-01-01', th3index '880326b88dfffff@2001-01-01'); -- t@2001-01-01
Return a temporal directed-edge identifier from an origin/destination pair of temporal cells
th3CellsToDirectedEdge(th3index,th3index) → th3index
SELECT th3CellsToDirectedEdge(th3index '871fa44a8ffffff@2001-01-01',
th3index '871fa44aeffffff@2001-01-01');
-- 1671fa44a8ffffff@2001-01-01
Return a temporal boolean stating at each instant whether the value is a valid H3 directed edge
isValidDirectedEdge(th3index) → tbool
SELECT isValidDirectedEdge(th3CellsToDirectedEdge(th3index '871fa44a8ffffff@2001-01-01',
th3index '871fa44aeffffff@2001-01-01'));
-- t@2001-01-01
SELECT isValidDirectedEdge(th3index '871fa44a8ffffff@2001-01-01');
-- f@2001-01-01
Return the temporal origin or destination cell of a temporal directed edge
th3GetDirectedEdgeOrigin(th3index) → th3index
th3GetDirectedEdgeDestination(th3index) → th3index
SELECT th3GetDirectedEdgeOrigin(th3CellsToDirectedEdge(th3index '871fa44a8ffffff@2001-01-01',
th3index '871fa44aeffffff@2001-01-01'));
-- 871fa44a8ffffff@2001-01-01
SELECT th3GetDirectedEdgeDestination(th3CellsToDirectedEdge(th3index '871fa44a8ffffff@2001-01-01',
th3index '871fa44aeffffff@2001-01-01'));
-- 871fa44aeffffff@2001-01-01
Return the temporal polygon boundary of each directed edge in a trajectory, as a temporal geography
th3DirectedEdgeToBoundary(th3index) → tgeography
SELECT ST_NPoints(getValue(th3DirectedEdgeToBoundary(
th3CellsToDirectedEdge(th3index '871fa44a8ffffff@2001-01-01',
th3index '871fa44aeffffff@2001-01-01')))::geometry);
-- 3