ST_MaxZ

ST_MaxZ takes a geometry column and returns a double column. The output column contains the maximum z-coordinate of each input geometry. If the input geometry does not have z-coordinates the function will return NaN.

FunctionSyntax
Pythonmax_z(geometry)
SQLST_MaxZ(geometry)
ScalamaxZ(geometry)

For more details, go to the GeoAnalytics for Microsoft Fabric API reference for max_z.

Examples

PythonPythonSQLScala
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
from geoanalytics_fabric.sql import functions as ST

line_json = '{"paths": [[[0, 51, 801, 5],[1, 51, 129, 6],[2, 52, 206, 4]]], "hasM":true, "hasZ":true}'

df = spark.createDataFrame([(line_json, )], ["line_json"]) \
    .withColumn("geometry", ST.line_from_esri_json("line_json"))

df.select(ST.max_z("geometry").alias("max_z")).show()
Result
Use dark colors for code blocksCopy
1
2
3
4
5
+-----+
|max_z|
+-----+
|801.0|
+-----+

Version table

ReleaseNotes

1.0.0-beta

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.