geo_s2cell_to_polygon()

Vypočítá mnohoúhelník, který představuje obdélníkovou oblast buňky S2.

Syntax

geo_s2cell_to_polygon(s2cell)

Přečtěte si další informace o konvencích syntaxe.

Parametry

Název Typ Vyžadováno Popis
s2cell string ✔️ Hodnota tokenu buňky S2 vypočítaná pomocí geo_point_to_s2cell(). Maximální délka řetězce tokenu buňky S2 je 16 znaků.

Návraty

Mnohoúhelník ve formátu GeoJSON a dynamického datového typu. Pokud je s2cell neplatný, dotaz vytvoří výsledek null.

Poznámka

Okraje buněk S2 jsou sférická geodézie.

Příklady

print s2cellPolygon = geo_s2cell_to_polygon("89c259")

Výstup

s2cellPolygon
{
"type": "Mnohoúhelník",
"souřadnice": [[[-74.030012249838478, 40.8012684339439], [-74.030012249838478, 40.722262918358], [-73.935982114337421, 40.708880489804564], [-73.935982114337421, 40.787917134506841], [-74.030012249838478, 40.8012684339439]]]
}

Následující příklad sestaví geoJSON geometry kolekci S2 Buňky mnohoúhelníky.

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"))

Výstup

Sloupec1
{
"type": "Feature",
"geometrie": {"type": "GeometryCollection", "geometrie": [
{"type": "Mnohoúhelník", "souřadnice": [[[-74.030012249838478, 40.880202851376716], [-74.030012249838478, 40.8012684339439], [-73.935982114337421, 40.787917134506841], [-73.935982114337421, 40.866846163445771], [-74.030012249838478, 40.880202851376716]]]},
{"type": "Mnohoúhelník", "souřadnice": [[[-73.935982114337421, 40.866846163445771], [-73.935982114337421, 40.787917134506841], [-73.841906340776248, 40.774477568182071], [-73.841906340776248, 40.853401155678846], [-73.935982114337421, 40.866846163445771]]]},
{"type": "Mnohoúhelník", "souřadnice": [[[-74.030012249838478, 40.8012684339439], [-74.030012249838478, 40.722262918358], [-73.935982114337421, 40.708880489804564], [-73.935982114337421, 40.787917134506841], [-74.030012249838478, 40.8012684339439]]]}]
},
"properties": {"name": "S2 Cell polygons collection"}
}

Následující příklad vrátí výsledek null z důvodu neplatného vstupu tokenu s2cell.

print s2cellPolygon = geo_s2cell_to_polygon("a")

Výstup

s2cellPolygon