Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Importante
La compatibilidad con los valores GEOGRAPHY está en versión preliminar pública. La compatibilidad con valores GEOMETRY está disponible con carácter general.
Devuelve el anillo exterior (shell), como una cadena de líneas, del valor Geography o Geometry de entrada que representa un polígono. Se conservan el SRID y la dimensión.
Para obtener la función SQL de Databricks correspondiente, consulte st_exteriorring function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_exteriorring(col=<col>)
Parámetros
| Parámetro | Tipo | Description |
|---|---|---|
col |
pyspark.sql.Column o str |
Valor Geography o Geometry que representa un polígono. |
Notas
Se espera que el valor de entrada represente un polígono; de lo contrario, se devuelve un error.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POLYGON EMPTY', 'POLYGON((0 0,10 0,0 10,0 0))', 'POLYGON ZM ((0 0 111 -11,10 0 222 -22,0 10 333 -33,0 0 444 -44),(1 1 555 -55,4 1 666 -66,1 4 777 -77,1 1 888 -88))')], ['pgn1', 'pgn2', 'pgn3'])
df.select(dbf.st_asewkt(dbf.st_exteriorring(dbf.st_geomfromtext('pgn1'))).alias('result')).collect()
[Row(result='LINESTRING EMPTY')]
df.select(dbf.st_asewkt(dbf.st_exteriorring(dbf.st_geomfromtext('pgn2', 3857))).alias('result')).collect()
[Row(result='SRID=3857;LINESTRING(0 0,10 0,0 10,0 0)')]
df.select(dbf.st_asewkt(dbf.st_exteriorring(dbf.st_geogfromtext('pgn3'))).alias('result')).collect()
[Row(result='SRID=4326;LINESTRING ZM (0 0 111 -11,10 0 222 -22,0 10 333 -33,0 0 444 -44)')]