Partilhar via


st_envelope_agg

Importante

Este recurso está no Public Preview.

Retorna o envelope de todas as geometrias presentes na coluna, ou None caso a coluna tenha zero linhas, ou contenha apenas valores None.

Para a função SQL do Databricks correspondente, veja st_envelope_agg função.

Sintaxe

from pyspark.databricks.sql import functions as dbf

dbf.st_envelope_agg(col=<col>)

Parâmetros

Parâmetro Tipo Description
col pyspark.sql.Column ou str Um valor de Geometria.

Examples

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('MULTIPOINT(EMPTY,4 3,5 6,-1 8)',), ('POLYGON((0 0,10 0,0 10,0 0))',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.st_envelope_agg(dbf.st_geomfromtext('wkt', 4326))).alias('result')).collect()
[Row(result='SRID=4326;POLYGON((-1 0,-1 10,10 10,10 0,-1 0))')]