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

> Reference material for ST_GEOGFROMGEOJSON function

# ST_GEOGFROMGEOJSON

Constructs a `GEOGRAPHY` object from a [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) string.

The [GeoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946) specifies that GeoJSON points are WGS 84 coordinates, and GeoJSON line segments are planar edges, meaning straight cartesian lines. However, contrary to that, in Firebolt, the line segments are interpreted as geodesic arcs.

The following image shows an extreme case of the difference between these.
Both lines show the LineString from the GeoJSON string `{"coordinates": [[-0.12457505963581639,51.5006710219584],[-74.04448100812115,40.68923977267272]],"type": "LineString"}` that connect the Statue of Liberty in New York City and Big Ben in London. The gray line represents the LineString as a straight Cartesian line, following the GeoJSON standard. In contrast, the red line interprets the LineString as a geodesic arc, consistent with Firebolt's approach.

<img src="https://mintcdn.com/firebolt/2dZYiQcds9pQFLHr/assets/images/geography/geojson_difference.png?fit=max&auto=format&n=2dZYiQcds9pQFLHr&q=85&s=684e99ec3d8d9fefcccd23e5a76f5d2f" alt="An example showing the interpretation of a GeoJSON string according to the GeoJSON standard and in Firebolt." width="600" data-path="assets/images/geography/geojson_difference.png" />

[Normalization](/reference-sql/data-types/geography#normalization) and [invalid input handling](/reference-sql/data-types/geography#invalid-inputs) are applied as described in the [GEOGRAPHY type documentation](/reference-sql/data-types/geography).

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ST_GEOGFROMGEOJSON(<GeoJSON>)
```

## Parameters

| Parameter   | Description                                       | Supported input types |
| :---------- | :------------------------------------------------ | :-------------------- |
| `<GeoJSON>` | GeoJSON text representing the `GEOGRAPHY` object. | `TEXT`                |

## Return Type

`ST_GEOGFROMGEOJSON` returns a value of type `GEOGRAPHY`.

## Example

The following code example constructs a Point from a GeoJSON string describing a Point at specified longitude and latitude coordinates and converts it to WKT format:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT ST_ASTEXT(ST_GEOGFROMGEOJSON('{"type":"Point","coordinates":[-73.98551041593687,40.75793403395676]}')) AS result
```

**Returns**

| result (TEXT)                                 |
| :-------------------------------------------- |
| 'POINT(-73.98551041593687 40.75793403395676)' |
