Nota
O acesso a esta página requer autorização. Podes tentar iniciar sessão ou mudar de diretório.
O acesso a esta página requer autorização. Podes tentar mudar de diretório.
Devolve a união pontual de todas as geometrias na coluna, ou None se a coluna tiver zero linhas, ou contiver apenas None valores.
Para a função SQL do Databricks correspondente, veja st_union_agg função.
Sintaxe
from pyspark.databricks.sql import functions as dbf
dbf.st_union_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_union_agg(dbf.st_geomfromtext('wkt', 4326))).alias('result')).collect()
[Row(result='SRID=4326;GEOMETRYCOLLECTION(MULTIPOINT((-1 8),(5 6)),POLYGON((0 0,10 0,0 10,0 0)))')]