> ## 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_CrossesDateLine

This function determines if a given geometry crosses the International Date Line. It operates by checking if the difference in longitude between any pair of consecutive points in the geometry exceeds 180 degrees. If such a difference is found, it is assumed that the geometry crosses the Date Line. It returns true if the geometry crosses the Date Line, and false otherwise.

<Note>
  The function assumes that the provided geometry is in lon/lat coordinate reference system where longitude values range from -180 to 180 degrees.
</Note>

<Note>
  For multi-geometries (e.g., MultiPolygon, MultiLineString), this function will return true if any one of the geometries within the multi-geometry crosses the International Date Line.
</Note>

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_CrossesDateLine/ST_CrossesDateLine.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=6764f1dc9c7f5b653c77dd3b0006d547" alt="ST_CrossesDateLine" width="500" height="300" data-path="images/sql-functions/ST_CrossesDateLine/ST_CrossesDateLine.svg" />

## Signatures

```sql theme={"system"}
ST_CrossesDateLine(geometry: Geometry)
```

## Parameters

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

## Return type

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

## Examples

```sql theme={"system"}
SELECT ST_CrossesDateLine(ST_GeomFromWKT('LINESTRING(170 30, -170 30)'))
```

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

<Warning>
  For geometries that span more than 180 degrees in longitude without actually crossing the Date Line, this function may still return true, indicating a crossing.
</Warning>
