Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_GLocal

Introduction: Runs Getis and Ord's G Local (Gi or Gi*) statistic on the geometry given the weights and level.

Getis and Ord's Gi and Gi* statistics are used to identify data points with locally high values (hot spots) and low values (cold spots) in a spatial dataset.

The ST_WeightedDistanceBand and ST_BinaryDistanceBand functions can be used to generate the weights column.

Format: ST_GLocal(geom: Geometry, weights: Struct, level: Int)

Since: v1.7.1

SQL Example

ST_GLocal(myVariable, ST_BinaryDistanceBandColumn(geometry, 1.0, true, true, false, struct(myVariable, geometry)), true)

Output:

{0.5238095238095238, 0.4444444444444444, 0.001049802637104223, 2.4494897427831814, 0.00715293921771476}