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

# ST_GeogFromText

> Constructs a native GEOGRAPHY value from WKT.

Constructs a native `GEOGRAPHY` value from Well-Known Text (WKT).

## Syntax

```sql theme={null}
GEOGRAPHY ST_GeogFromText(VARCHAR wkt)
GEOGRAPHY ST_GeogFromText(VARCHAR wkt, INT srid)
```

## Parameters

* `wkt`: A two-dimensional OGC WKT value. All seven OGC geometry families and `EMPTY` members are supported.
* `srid`: Optional. The spatial reference identifier. Only `4326` is supported; when omitted, it defaults to `4326`.

Coordinates use spherical `OGC:CRS84` semantics: longitude must be in `[-180, 180]` and latitude in `[-90, 90]`.

## Return value

Returns a `GEOGRAPHY` value. Returns `NULL` if an argument is `NULL`, the WKT is invalid, a coordinate is outside the supported range, or `srid` is not `4326`.

In queries, compatible native geo values can be used as `ARRAY` elements, `MAP` values, or `STRUCT` fields. You can construct these containers, read elements and fields, use `cardinality` or `array_length`, expand arrays with `UNNEST`, and use `array_map`, `array_filter`, or unordered `array_agg` and `map_agg` without `DISTINCT`.

A `MAP` key cannot contain geo values. Operations that require geo equality, ordering, or hashing are rejected, including comparisons, sorting, and deduplication. Saved SQL definitions, including views, materialized views, SQL UDFs, generated columns, SQL plan baselines, and pipes, cannot use nested geo expressions.

To return a container to the client, convert its geo elements or fields with `ST_AsText` or `ST_AsBinary` first. Scalar `GEOGRAPHY` can be returned directly. Scalar `GEOMETRY` also requires explicit conversion.

```sql theme={null}
SELECT array_map(x -> ST_AsText(x), [ST_GeogFromText('POINT (1 2)')]);
```

## Examples

```SQL theme={null}
SELECT ST_AsText(ST_GeogFromText('LINESTRING (1 2, 3 4)', 4326));
```

```text theme={null}
LINESTRING (1 2, 3 4)
```

```SQL theme={null}
SELECT ST_AsText(ST_GeogFromText('POINT EMPTY'));
```

```text theme={null}
POINT EMPTY
```

## Keywords

ST\_GEOGFROMTEXT, GEOGRAPHY, WKT

## Related data types

[GEOGRAPHY](/documents/4.2/sql-reference/data-types/spatial-types/GEOGRAPHY.md), [VARCHAR](/documents/4.2/sql-reference/data-types/string-type/VARCHAR.md), [INT](/documents/4.2/sql-reference/data-types/numeric/INT.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.