> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_IsValidTrajectory

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.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_IsValidTrajectory/ST_IsValidTrajectory.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=6f97eddcdb52f40188ffb46df0ca7376" alt="ST_IsValidTrajectory" width="400" height="130" data-path="images/sql-functions/ST_IsValidTrajectory/ST_IsValidTrajectory.svg" />

## Signatures

```sql theme={"system"}
ST_IsValidTrajectory(geom: Geometry)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

## Return type

<ResponseField type="Boolean">
  Returns `true` or `false`.
</ResponseField>

## Examples

```sql theme={"system"}
SELECT ST_IsValidTrajectory(
               ST_GeomFromText('LINESTRING M (0 0 1, 0 1 2)')
)
```

```
true
```

```sql theme={"system"}
SELECT ST_IsValidTrajectory(
               ST_GeomFromText('LINESTRING M (0 0 1, 0 1 0)')
)
```

```sql theme={"system"}
false
```
