geo_s2cell_to_central_point()

Applies to: ✅ Azure Data ExplorerAzure MonitorMicrosoft Sentinel

Calculates the geospatial coordinates that represent the center of an S2 cell.

Read more about S2 cell hierarchy.

Syntax

geo_s2cell_to_central_point(s2cell)

Learn more about syntax conventions.

Parameters

Name Type Required Description
s2cell string ✔️ S2 cell token value as it was calculated by geo_point_to_s2cell(). The S2 cell token maximum string length is 16 characters.

Returns

The geospatial coordinate values in GeoJSON Format and of a dynamic data type. If the S2 cell token is invalid, the query will produce a null result.

Note

The GeoJSON format specifies longitude first and latitude second.

Examples

print point = geo_s2cell_to_central_point("1234567")
| extend coordinates = point.coordinates
| extend longitude = coordinates[0], latitude = coordinates[1]

Output

point coordinates longitude latitude
{
"type": "Point",
"coordinates": [
9.86830731850408,
27.468392925827604
]
}
[
9.86830731850408,
27.468392925827604
]
9.86830731850408 27.4683929258276

The following example returns a null result because of the invalid S2 cell token input.

print point = geo_s2cell_to_central_point("a")

Output

point