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.
Clase para representar un valor Geography en Python.
Syntax
from pyspark.databricks.sql.types import Geography
Geography(wkb=<wkb>, srid=<srid>)
Parámetros
| Parámetro | Tipo | Description |
|---|---|---|
wkb |
bytes | Los bytes que representan el WKB de la Geografía |
srid |
entero | Valor entero que representa el SRID de Geografía |
Methods
| Método | Description |
|---|---|
getBytes() |
Devuelve el WKB de Geography. |
getSrid() |
Devuelve el SRID de Geography. |
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([{'geogwkt': 'POINT(17 7)'}])
g = df.select(dbf.st_geogfromwkt(df.geogwkt).alias("geog")).head().geog
g.getBytes().hex()
'010100000000000000000031400000000000001c40'
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([{'geogwkt': 'POINT(17 7)'}])
g = df.select(dbf.st_geogfromwkt(df.geogwkt).alias("geog")).head().geog
g.getSrid()
4326