ST_Densify

ST_Densify takes a geometry column and a numeric max_segment_length value and returns a geometry column. This function adds vertices along linestrings or polygons such that every segment within the geometry is no longer than max_segment_length, using planar distance calculation. The max_segment_length parameter is in the same units as the input geometry and should be greater than zero. For example, if your input geometry is in a spatial reference that uses meters, you should specify the max_segment_length in meters.

To densify geometry using geodesic distance calculation, use ST_GeodesicDensify.

FunctionSyntax
Pythondensify(geometry, max_segment_length)
SQLST_Densify(geometry, max_segment_length)
Scaladensify(geometry, maxSegmentLength)

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

Examples

PythonPythonSQLScala
1
2
3
4
5
6
7

from geoanalytics_fabric.sql import functions as ST

df = spark.createDataFrame([("LINESTRING (0 0, 10 0)",)], ['wkt']) \
        .withColumn("line", ST.line_from_text("wkt"))

df.select(ST.densify("line", 2.5).alias("densified")).show(truncate = False)
Result
1
2
3
4
5
+------------------------------------------------+
|densified                                       |
+------------------------------------------------+
|{"paths":[[[0,0],[2.5,0],[5,0],[7.5,0],[10,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.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close