RT_NumColumns takes a raster column and returns a numeric value that represents the number of columns in the raster.
| Function | Syntax |
|---|---|
| Python | num |
| SQL | RT |
| Scala | num |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for num_columns.
Examples
from geoanalytics_fabric.raster import functions as RT
data = [(list(range(100)), )]
df = spark.createDataFrame(data, ["pixels"]) \
.withColumn("raster", RT.create_raster("pixels", 10, 10, "float32"))
df.select(RT.num_columns("raster").alias("num_columns")).show(truncate=False)Result
+-----------+
|num_columns|
+-----------+
|10 |
+-----------+