Skip to content

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.

FunctionSyntax
Pythoninfo(raster_col)
SQLRT_Info(raster_col)
Scalainfo(raster)

For more details, go to the GeoAnalytics Engine API reference for info.

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8

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
Use dark colors for code blocksCopy
1
2
3
4
5
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|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

ReleaseNotes

2.0.0

Python, SQL, and Scala functions introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.