Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
Aplica-se a:
Databricks SQL
Databricks Runtime 17.1 e superior
Important
O suporte para valores de GEOGRAFIA está disponível em Pré-visualização Pública. O suporte para valores GEOMETRY está geralmente disponível.
Observação
Esse recurso não está disponível nos armazéns Databricks SQL Classic. Para saber mais sobre os armazéns SQL do Databricks, consulte Tipos de armazém SQL.
Devolve um novo valor GEOGRAPHY ou GEOMETRY, cujo SRID é o valor especificado.
Syntax
st_setsrid ( geo, srid )
Arguments
-
geo: um valorGEOGRAPHYouGEOMETRY. -
srid: O novo valor SRID da geometria.
Returns
Um valor do tipo GEOGRAPHY ou GEOMETRY, representando um novo valor geográfico ou geométrico cujo SRID é o valor especificado do SRID.
A função retorna NULL se qualquer uma das entradas for NULL.
Examples
-- Sets SRID to 3857 and returns the new SRID value.
> SELECT st_srid(st_setsrid(ST_GeomFromText('POINT(4 5)', 4326), 3857));
3857
-- Returns the original geometry with the new SRID value.
> SELECT st_asewkt(st_setsrid(st_geomfromtext('POINT(1 2)'), 4326));
SRID=4326;POINT(1 2)
-- Returns the original geography with the new SRID value.
> SELECT st_asewkt(st_setsrid(to_geography('POINT(1 2)'), 4326));
SRID=4326;POINT(1 2)
-- When invoking st_setsrid with a literal for the SRID value, the output geography type inherits the SRID value.
> SELECT typeof(st_setsrid(to_geography('POINT(1 2)'), 4326));
geography(4326)
-- When invoking st_setsrid with a literal for the SRID value, the output geometry type inherits the SRID value.
> SELECT typeof(st_setsrid(to_geometry('POINT(1 2)'), 3857));
geometry(3857)