Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
fungsi
Berlaku untuk:
pemeriksaan Databricks SQL
Databricks Runtime 17.1 ke atas
Important
Fitur ini ada di Pratinjau Publik.
Nota
Fitur ini tidak tersedia di gudang Databricks SQL Classic. Untuk mempelajari selengkapnya tentang gudang Databricks SQL, lihat Jenis gudang SQL.
Mengurai deskripsi input geografi dan mengembalikan nilai yang GEOGRAPHY sesuai, atau NULL jika deskripsi input tidak valid.
Nilai SRID dari nilai yang dikembalikan GEOGRAPHY adalah 4326.
Syntax
try_to_geography ( geoRepExpr )
Arguments
-
geoRepExpr: EkspresiBINARYatauSTRINGmewakili geografi dalam WKB, WKT, GeoJSON, atau Extended WKT (EWKT).
Returns
Nilai jenis GEOGRAPHY(ANY), sesuai dengan deskripsi geografi input.
- Fungsi mengembalikan
NULLjika input adalahNULL. - Fungsi mengembalikan
NULLjika inputBINARYatauSTRINGnilai adalah deskripsi geografi yang tidak valid.
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 geometry is in EWKT format.
> SELECT concat_ws(';', st_srid(g)::STRING, st_asgeojson(g)) FROM (SELECT try_to_geography('SRID=4326;POINT Z (3 4 5)') AS g);
4326;{"type":"Point","coordinates":[3,4,5]}
-- Input value is not the description of a geography.
> SELECT st_astext(try_to_geography('some string that does not represent a geography'));
NULL
Fungsi terkait
-
st_asbinaryfungsi -
st_asewkbfungsi -
st_asewktfungsi -
st_asgeojsonfungsi -
st_astextfungsi -
st_aswkbfungsi -
st_aswktfungsi -
st_geogfromewktfungsi -
st_geogfromgeojsonfungsi -
st_geogfromtextfungsi -
st_geogfromwkbfungsi -
st_geogfromwktfungsi -
st_geomfromewkbfungsi -
st_geomfromewktfungsi -
st_geomfromgeojsonfungsi -
st_geomfromtextfungsi -
st_geomfromwkbfungsi -
st_geomfromwktfungsi -
to_geographyfungsi -
to_geometryfungsi -
try_to_geometryfungsi