geo_s2cell_to_polygon()

Calcola il poligono che rappresenta l'area rettangolare della cella S2.

Sintassi

geo_s2cell_to_polygon(s2cell)

Altre informazioni sulle convenzioni di sintassi.

Parametri

Nome Tipo Obbligatoria Descrizione
s2cell string ✔️ Valore del token di cella S2 calcolato da geo_point_to_s2cell(). La lunghezza massima della stringa del token di cella S2 è di 16 caratteri.

Restituisce

Poligono in Formato GeoJSON e di un tipo di dati dinamico . Se s2cell non è valido, la query genera un risultato Null.

Nota

I bordi della cella S2 sono geodesici sferici.

Esempio

print s2cellPolygon = geo_s2cell_to_polygon("89c259")

Output

s2cellPolygon
{
"type": "Polygon",
"coordinate": [[-74.030012249838478, 40.801268439439], [-74.030012249838478, 40.7222262918358], [-73.9359821437421, 40.708880489804564], [-73.93598211437421, 40.787917134506841], [-74.030012249838478, 40.801268439439439]]
}

Nell'esempio seguente viene assemblata l'insieme geometry GeoJSON dei poligoni celle S2.

datatable(lng:real, lat:real)
[
    -73.956683, 40.807907,
    -73.916869, 40.818314,
    -73.989148, 40.743273,
]
| project s2_hash = geo_point_to_s2cell(lng, lat, 10)
| project s2_hash_polygon = geo_s2cell_to_polygon(s2_hash)
| summarize s2_hash_polygon_lst = make_list(s2_hash_polygon)
| project bag_pack(
    "type", "Feature",
    "geometry", bag_pack("type", "GeometryCollection", "geometries", s2_hash_polygon_lst),
    "properties", bag_pack("name", "S2 Cell polygons collection"))

Output

Colonna 1
{
"type": "Feature",
"geometry": {"type": "GeometryCollection", "geometrie": [
{"type": "Polygon", "coordinate": [[-74.030012249838478, 40.880202851376716], [-74.030012249838478, 40.8012643943939], [-73.935982114337421, 40.787917134506841], [-73.93598211437421, 40.86684616345771], [-74.030012249838478, 40.880202851376716],
{"type": "Polygon", "coordinate": [[-73.93598214337421, 40.86684616345771], [-73.93598211437421, 40.787917134506841], [-73.841906340776248, 40.774477568182071], [-73.841906340776248, 40.853401155678846], [-73598211437421, 40.8668461634571]]},
{"type": "Polygon", "coordinate": [[-74.030012249838478, 40.801268439439], [-74.030012249838478, 40.7222262918358], [-73.9359821437421, 40.708880489804564], [-73.93598211437421, 40.787917134506841], [-74.030012249838478, 40.80126439439439]]]]
},
"properties": {"name": "S2 Cell polygons collection"}
}

Nell'esempio seguente viene restituito un risultato Null a causa dell'input del token s2cell non valido.

print s2cellPolygon = geo_s2cell_to_polygon("a")

Output

s2cellPolygon