A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/to_geography below:

Website Navigation


TO_GEOGRAPHY | Snowflake Documentation

Categories:

Geospatial functions, Conversion functions

TO_GEOGRAPHY

Parses an input and returns a value of type GEOGRAPHY.

See also:

TRY_TO_GEOGRAPHY , ST_GEOGRAPHYFROMWKB , ST_GEOGRAPHYFROMWKT

Syntax

Use one of the following:

TO_GEOGRAPHY( <varchar_expression> [ , <allow_invalid> ] )

TO_GEOGRAPHY( <binary_expression> [ , <allow_invalid> ] )

TO_GEOGRAPHY( <variant_expression> [ , <allow_invalid> ] )

TO_GEOGRAPHY( <geometry_expression> [ , <allow_invalid> ] )

Copy

Arguments

Required:

varchar_expression

The argument must be a string expression that represents a valid geometric object in one of the following formats:

binary_expression

The argument must be a binary expression in WKB or EWKB format.

variant_expression

The argument must be an OBJECT in GeoJSON format.

geometry_expression

The argument must be an expression of type GEOMETRY with the SRID 4326.

Optional:

allow_invalid

If TRUE, specifies that the function should return a GEOGRAPHY or GEOMETRY object, even when the input shape is invalid and cannot be repaired. For details, refer to Specifying how invalid geospatial shapes are handled.

Returns

The function returns a value of type GEOGRAPHY.

Usage notes Examples

This shows a simple use of the TO_GEOGRAPHY function with VARCHAR data:

select TO_GEOGRAPHY('POINT(-122.35 37.55)');

Copy

+--------------------------------------+
| TO_GEOGRAPHY('POINT(-122.35 37.55)') |
|--------------------------------------|
| POINT(-122.35 37.55)                 |
+--------------------------------------+

The following example returns the GEOGRAPHY object for a geospatial object with a Z coordinate described in WKT format:

select TO_GEOGRAPHY('POINTZ(-122.35 37.55 30)');

Copy

+------------------------------------------+
| TO_GEOGRAPHY('POINTZ(-122.35 37.55 30)') |
|------------------------------------------|
| POINTZ(-122.35 37.55 30)                 |
+------------------------------------------+

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4