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/try_to_geometry below:

Website Navigation


TRY_TO_GEOMETRY | Snowflake Documentation

TRY_TO_GEOMETRY

Parses an input and returns a value of type GEOMETRY.

This function is identical to TO_GEOMETRY except that it returns NULL when TO_GEOMETRY would return an error.

See also:

TO_GEOMETRY

Syntax

Use one of the following:

TRY_TO_GEOMETRY( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )

TRY_TO_GEOMETRY( <binary_expression> [ , <srid> ] [ , <allow_invalid> ] )

TRY_TO_GEOMETRY( <variant_expression> [ , <srid> ] [ , <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.

Optional:

srid

The integer value of the SRID to use.

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 GEOMETRY.

Usage notes Examples

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

select try_to_geometry('INVALID INPUT');

Copy

+--------------------------------------+
| try_to_geometry('INVALID INPUT')     |
|--------------------------------------|
| NULL                                 |
+--------------------------------------+

Copy


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