st_exteriorring
info
Aperçu
La prise en charge des valeurs GEOGRAPHY est en aperçu public. La prise en charge des valeurs GEOMETRY est généralement disponible.
Renvoie l’anneau extérieur (shell), en tant que linestring, de la valeur d’entrée Géographie ou Géométrie représentant un polygone. Le SRID et la dimension sont conservés.
Pour la fonction Databricks SQL correspondante, consultez la fonctionst_exteriorring.
Syntaxe
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_exteriorring(col=<col>)
parameter
Notes
La valeur d'entrée devrait représenter un polygone, sinon une erreur est renvoyée.
Exemples
Python
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()
Output
[Row(result='LINESTRING EMPTY')]
Python
df.select(dbf.st_asewkt(dbf.st_exteriorring(dbf.st_geomfromtext('pgn2', 3857))).alias('result')).collect()
Output
[Row(result='SRID=3857;LINESTRING(0 0,10 0,0 10,0 0)')]
Python
df.select(dbf.st_asewkt(dbf.st_exteriorring(dbf.st_geogfromtext('pgn3'))).alias('result')).collect()
Output
[Row(result='SRID=4326;LINESTRING ZM (0 0 111 -11,10 0 222 -22,0 10 333 -33,0 0 444 -44)')]