適用対象:
Databricks SQL
Databricks Runtime 17.1 以降" とマークされているチェック
Important
この機能は パブリック プレビュー段階です。
注
この機能は、Databricks SQL クラシック ウェアハウスでは使用できません。 Databricks SQL ウェアハウスの詳細については、 SQL ウェアハウスの種類に関するページを参照してください。
geography の入力説明を解析し、対応する GEOGRAPHY 値を返します。入力の説明が無効な場合は NULL します。
返される GEOGRAPHY 値の SRID 値は 4326 です。
Syntax
try_to_geography ( geoRepExpr )
Arguments
-
geoRepExpr:BINARY、STRING、または GeoJSON の geography を表す式または式。
Returns
入力 geography の説明に対応する GEOGRAPHY(ANY)型の値。
- 入力が
NULL場合、この関数はNULLを返します。 - 入力
NULLまたはBINARY値が地理の無効な説明である場合、この関数はSTRINGを返します。
Examples
-- Input geography is in WKT format.
> SELECT st_asgeojson(try_to_geography('POINT Z (3 4 5)'));
{"type":"Point","coordinates":[3,4,5]}
-- Input geography is in GeoJSON format.
> SELECT st_asewkt(try_to_geography('{"type":"Point","coordinates":[3,4,5]}'));
SRID=4326;POINT Z (3 4 5)
-- Input geography is in WKB format.
> SELECT st_astext(try_to_geography(X'01b90b0000000000000000084000000000000010400000000000001440000000000000f0bf'))
POINT ZM (3 4 5 -1)
-- Input value is not the description of a geography.
> SELECT st_astext(try_to_geography('some string that does not represent a geography'))
NULL
関連する関数
-
st_asbinary関数 -
st_asewkb関数 -
st_asewkt関数 -
st_asgeojson関数 -
st_astext関数 -
st_aswkb関数 -
st_aswkt関数 -
st_geogfromgeojson関数 -
st_geogfromtext関数 -
st_geogfromwkb関数 -
st_geogfromwkt関数 -
st_geomfromewkb関数 -
st_geomfromgeojson関数 -
st_geomfromtext関数 -
st_geomfromwkb関数 -
st_geomfromwkt関数 -
to_geography関数 -
to_geometry関数 -
try_to_geometry関数