---
title: Point Constructors
slug: lo-MRZ668p-9ibVOIvRR8
description: Create points in OcientGeo, fundamental for spatial data analysis and visualization.
docTags: 
createdAt: Mon Aug 01 2022 16:48:54 GMT+0000 (Coordinated Universal Time)
updatedAt: Mon Mar 30 2026 18:52:32 GMT+0000 (Coordinated Universal Time)
---

OcientGeo™ POINT constructors use geospatial data to create a POINT object.&#x20;

# ST\_CENTROID 

Returns a `POINT` that is the geographic center of mass of a specified geospatial object.&#x20;

The geographic center of mass is calculated by taking the average of all points on a three-dimensional sphere, projecting the resultant point onto the sphere, and converting it back to latitude and longitude coordinates.

**Syntax**

```sql
ST_CENTROID( geo [, use_spheroid ] )
```

| **Argument**   | **Data** **Type**                   | **Description**                                                                                                                                                                                             |
| -------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `geo`          | `POINT`, `LINESTRING`, or `POLYGON` | A geospatial object that the function analyzes to compute its geometric center.                                                                                                                             |
| `use_spheroid` | `BOOLEAN`                           | Optional. <br />If this argument is `TRUE`, the function computes the centroid using a spheroid model instead of a spherical model. <br />If you do not specify this value, the value defaults to `FALSE`.  |

**Example**

```sql
SELECT ST_CENTROID(ST_POLYGON('POLYGON((1 1, 2 1, 2 2, 1 1))'));
```

*Output*: `POINT(1.66 1.33) `

# ST\_GEOGPOINT

Alias for `ST_POLYGON(ST_LINESTRING(ARRAY(ST_POINT(lon, lat))))`.

Creates and returns a `POLYGON` geography with a single point, defined by the longitude and latitude specified for the function.&#x20;

**Syntax**

```sql
ST_GEOGPOINT(lon, lat)
```

| **Argument** | **Data** **Type** | **Description**                                                               |
| ------------ | ----------------- | ----------------------------------------------------------------------------- |
| `lon`        | `DOUBLE`          | A longitude coordinate to be used to create a `POLYGON` with a single point.  |
| `lat`        | `DOUBLE`          | A latitude coordinate to be used to create a `POLYGON` with a single point.   |

**Example**

```sql
SELECT ST_GEOGPOINT(41.882548,-87.63922);
```

*Output*: `POLYGON((41.882548 -87.63922))`

# ST\_MAKEPOINT

Alias for [ST\_POINT](./#stpoint).&#x20;

# ST\_POINT

Creates a `POINT` from the specified input arguments.&#x20;

## ST\_POINT(binary)

Alias for ST\_POINTFROMWKB.

Creates a `POINT` from the specified `BINARY` value, which must represent a point in WKB format.&#x20;

**Syntax**

```sql
ST_POINT(binary)
```

| **Argument** | **Data** **Type** | **Description**                                          |
| ------------ | ----------------- | -------------------------------------------------------- |
| `binary`     | `BINARY`          | A binary value in WKB format that represents a `POINT`.  |

**Example**

```sql
SELECT ST_POINT(BINARY('0x0101000000000000000000f03f0000000000000040'));
```

*Output*: `POINT(1 2)`

## ST\_POINT(char)

Creates a `POINT` from a `CHAR` value that represents a point in WKT format.&#x20;

**Syntax**

```sql
ST_POINT(char)
```

| **Argument** | **Data** **Type** | **Description**                                    |
| ------------ | ----------------- | -------------------------------------------------- |
| `char`       | `CHAR`            | A `CHAR` that represents a `POINT` in WKT format.  |

**Example**

```sql
SELECT ST_POINT('POINT(1 2)');
```

*Output*: `POINT(1 2)`

## ST\_POINT(lon, lat)

Creates a `POINT` defined with the values provided for the longitude and latitude coordinates.&#x20;

**Syntax**

```sql
ST_POINT(lon, lat)
```

| **Argument** | **Data** **Type** | **Description**                                           |
| ------------ | ----------------- | --------------------------------------------------------- |
| `lon`        | `DOUBLE`          | A `DOUBLE` value that represents a longitude coordinate.  |
| `lat`        | `DOUBLE`          | A `DOUBLE` value that represents a latitude coordinate.   |

**Example**

```sql
SELECT ST_POINT(87.6386, 41.8843);
```

*Output*: `POINT(87.6386 41.8843)`

# ST\_POINTFROMEWKT

Alias for [ST\_POINT](./#stpoint).

Creates a `POINT` using an EWKT-formatted `CHAR` as an input argument.&#x20;

**Syntax**

```sql
ST_POINTFROMEWKT(srid_char)
```

| **Argument** | **Data** **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `srid_char`  | `CHAR`            | A string that includes a Spatial Reference Identifier (SRID) value and an EWKT-formatted value that represents a `POINT`.<br />Separate the values in the string by a semicolon using this format: <br />`'SRID = value; point_value'`<br />The input string must include the `SRID = value;` component. However, the database ignores this component as all Ocient® geography types are `SRID = 4326`. |

**Example**

```sql
SELECT ST_POINTFROMEWKT('SRID=4326;POINT(1 2)');
```

*Output*: `POINT(1 2)`

# ST\_POINTFROMGEOJSON

Creates a `POINT` represented by the specified GeoJSON value as an input argument. A second optional `BOOLEAN` argument determines if the specified GeoJSON should be converted from a planar to a geodesic representation.&#x20;

If you specify a NULL value for either argument, the function returns NULL.&#x20;

**Syntax**

```sql
ST_POINTFROMGEOJSON(geojson [, geodesic ] )
```

| **Argument** | **Data** **Type** | **Description**                                                                                                                                                                                                                                                                                                                                        |
| ------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `geo_json`   | `STRING`          | A string of a GeoJSON. <br />Valid GeoJSON formats follow IETF® [standards](https://datatracker.ietf.org/doc/rfc7946/), which you can generate using the [ST\_ASGEOJSON](<./Conversion Functions.md>)  function.<br />If you specify an invalid GeoJSON, the behavior of the function is undefined. The function returns NULL if any argument is NULL. |
| `geodesic`   | `BOOLEAN`         | Optional. <br />If you set this argument to `TRUE`, the specified GeoJSON is converted from a planar to a geodesic representation. This does not affect POINT geospatial objects.<br />The default value is `FALSE`.                                                                                                                                   |

**Examples**

In this example, the function captures a `POINT` from an empty GeoJSON representation.&#x20;

```sql
SELECT ST_POINTFROMGEOJSON('{"type":"Point","coordinates":[]}',false);
```

*Output*:  `POINT EMPTY`

In this example, the function captures a `POINT` from a GeoJSON representation.&#x20;

```sql
SELECT ST_POINTFROMGEOJSON('{"type":"Point","coordinates":[1,1]}',false);
```

*Output*:  `POINT(1 1)`

# ST\_POINTFROMGEOHASH

Creates a `POINT` represented by the specified geohash.&#x20;

**Syntax**

```sql
ST_POINTFROMGEOHASH(geohash)
```

| **Argument** | **Data** **Type** | **Description**                                                                                                                                                                                                                                                  |
| ------------ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `geohash`    | `STRING`          | A string of a valid geohash. <br />Valid geohashes contain only the characters `0123456789bcdefghjkmnpqrstuvwxyz`.<br />If you specify an invalid geohash, the function throws an `INVALID_ARGUMENT` error. The function returns NULL if this argument is NULL.  |

**Examples**

```sql
SELECT ST_POINTFROMGEOHASH('c0w3hf1s70w3hf1s70w3');
```

*Output*: `POINT(-126.00000000000003 48.00000000000007)`

```sql
SELECT ST_POINTFROMGEOHASH('kzn21');
```

*Output*: `POINT(42.60498046875 -5.60302734375)`

# ST\_POINTFROMTEXT

Alias for [ST\_POINT(char)](./#stpointchar).

# ST\_POINTFROMWKB

Alias for [ST\_POINT(binary)](./#stpointbinary).

# Related Links

[Geospatial Data Types](<././Data Types.md>)

[Conversion Functions](<./Conversion Functions.md>)

