Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

ST_IsValidTrajectory

Introduction: This function checks if a geometry is a valid trajectory representation. For a trajectory to be considered valid, it must be a LineString that includes measure (M) values. The key requirement is that the M values increase from one vertex to the next as you move along the line.

ST_IsValidTrajectory

Format: ST_IsValidTrajectory(geom: Geometry)

Return type: Boolean

Since: v1.6.1

SQL Example:

SELECT ST_IsValidTrajectory(
               ST_GeomFromText('LINESTRING M (0 0 1, 0 1 2)')
)

Output:

true

SQL Example:

SELECT ST_IsValidTrajectory(
               ST_GeomFromText('LINESTRING M (0 0 1, 0 1 0)')
)

Output:

false