RT_NumRows takes a raster column and returns a numeric value that represents the number of rows in the raster.
| Function | Syntax |
|---|---|
| Python | num |
| SQL | RT |
| Scala | num |
For more details, go to the GeoAnalytics Engine API reference for num_rows.
Examples
from geoanalytics.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_rows("raster").alias("num_rows")).show(truncate=False)Result
+--------+
|num_rows|
+--------+
|10 |
+--------+Version table
| Release | Notes |
|---|---|
2.0.0 | Python, SQL, and Scala functions introduced |