ST_GEOGPOINT

Geography Function.

Description

Creates a GEOGRAPHY with a single point. ST_GEOGPOINT creates a point from the specified FLOAT64 longitude (in degrees, negative west of the Prime Meridian, positive east) and latitude (in degrees, positive north of the Equator, negative south) parameters and returns that point in a GEOGRAPHY value.

For more information, please refer to ST_GEOGPOINT function.

The function ST_GEOGPOINT is translated to ST_POINT in Snowflake.

Grammar Syntax

ST_GEOGPOINT(longitude, latitude)

Sample Source

Input Code:

SELECT ST_GEOGPOINT(-122.0838, 37.3860);

Output Code:

SELECT ST_POINT(-122.0838, 37.3860);

Please keep in mind that the default output format for geography data types is WKT (Well-Known Text) and in Snowflake WKB (Well-Known Binary). You can use the ST_ASWKT function or set the GEOGRAPHY_OUTPUT_FORMAT format if you want to view the data in WKT format.

Using ST_POINT function to insert geography data

This function is not allowed in the values clause and is not required in Snowflake.

Input Code:

CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
);

INSERT INTO test.geographyType
VALUES (ST_GEOGPOINT(-122.0838, 37.3860));

Output Code:

CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "bigquery",  "convertedOn": "04/03/2025",  "domain": "test" }}';

INSERT INTO test.geographyType
VALUES (
--** SSC-FDM-BQ0010 - THE FUNCTION 'ST_GEOGFROMTEXT' IS NOT REQUIRED IN SNOWFLAKE. **
'POINT(122.0838 37.3860)');
  1. SSC-FDM-BQ0010: Geography function is not required in Snowflake.

Last updated