st_geomfromwkb
Analyse la description WKB d’entrée et renvoie la valeur de Géométrie correspondante.
Pour la fonction Databricks SQL correspondante, consultez la fonctionst_geomfromwkb.
Syntaxe
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_geomfromwkb(col1=<col1>, col2=<col2>)
parameter
parameter | Type | Description |
|---|---|---|
|
| Une valeur BINAIRE au format WKB, représentant une valeur Géométrie. |
|
| La valeur SRID facultative de la géométrie. default est 0. |
Exemples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(bytes.fromhex('010200000002000000000000000000144000000000000018400000000000001c4000000000000020c0'),)], ['wkb'])
df.select(dbf.st_asewkt(dbf.st_geomfromwkb('wkb')).alias('result')).collect()
Output
[Row(result='LINESTRING(5 6,7 -8)')]
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(bytes.fromhex('010200000002000000000000000000144000000000000018400000000000001c4000000000000020c0'), 4326,)], ['wkb', 'srid'])
df.select(dbf.st_asewkt(dbf.st_geomfromwkb('wkb', 'srid')).alias('result')).collect()
Output
[Row(result='SRID=4326;LINESTRING(5 6,7 -8)')]