RT_Info takes a raster column and returns a struct column. This struct includes information about this raster, such as number of rows and columns, cell size, cell type, number of bands, extent, srid and spatial reference.
| Function | Syntax |
|---|---|
| Python | info(raster |
| SQL | RT |
| Scala | info(raster) |
For more details, go to the GeoAnalytics Engine API reference for info.
Examples
from geoanalytics.raster import functions as RT
data = [([1,2,3,4], )]
df = spark.createDataFrame(data, ["pixels"]) \
.withColumn("raster", RT.srid(RT.create_raster("pixels", 2, 2, "float32"), 4326))
df.select(RT.info("raster").alias("info")).show(truncate=False)Result
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|info |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|{2, 2, 1, 1.0, 1.0, Float32, 4326, GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]], [-0.5, -1.5, 1.5, 0.5]}|
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+Version table
| Release | Notes |
|---|---|
2.0.0 | Python, SQL, and Scala functions introduced |