geo_geohash_to_polygon()

Calcola il poligono che rappresenta l'area rettangolare geohash.

Altre informazioni su geohash.

Sintassi

geo_geohash_to_polygon(geohash)

Altre informazioni sulle convenzioni di sintassi.

Parametri

Nome Tipo Obbligatoria Descrizione
geohash string ✔️ Valore geohash calcolato da geo_point_to_geohash(). La stringa geohash deve essere compresa tra 1 e 18 caratteri.

Restituisce

Poligono in formato GeoJSON e di un tipo di dati dinamico . Se il geohash non è valido, la query genererà un risultato Null.

Nota

I bordi geohash sono linee rette e non sono geodesici. Se il poligono geohash fa parte di un altro calcolo, è consigliabile densificarlo con geo_polygon_densify().

Esempio

print GeohashPolygon = geo_geohash_to_polygon("dr5ru");

Output

GeohashPolygon
{
"type": "Polygon",
"coordinate": [
[[-74.00390625, 40.7373046875], [-73.9599609375, 40.7373046875], [-73.9599609375, 40.78125], [-74.00390625, 40.78125], [-74.00390625, 40.7373046875]]]
}

Nell'esempio seguente viene assemblata la raccolta geometry GeoJSON dei poligoni geohash.

// Geohash GeoJSON collection
datatable(lng:real, lat:real)
[
    -73.975212, 40.789608,
    -73.916869, 40.818314,
    -73.989148, 40.743273,
]
| project geohash = geo_point_to_geohash(lng, lat, 5)
| project geohash_polygon = geo_geohash_to_polygon(geohash)
| summarize geohash_polygon_lst = make_list(geohash_polygon)
| project bag_pack(
    "type", "Feature",
    "geometry", bag_pack("type", "GeometryCollection", "geometries", geohash_polygon_lst),
    "properties", bag_pack("name", "Geohash polygons collection"))

Output

Colonna 1
{
"type": "Feature",
"geometry": {"type": "GeometryCollection","geometries": [
{"type": "Polygon", "coordinate": [[-74.00390625, 40.78125], [-73.9599609375, 40.78125], [-73.9599609375, 40.8251953125],[ -74.00390625, 40.8251953125], [ -74.00390625, 40.78125]]]},
{"type": "Polygon", "coordinate": [[[ -73.9599609375, 40.78125], [-73.916015625, 40.78125], [-73.916015625, 40.8251953125], [-73.959609609375, 40.8251953125], [-73.9599609375, 40.78125]]]},
{"type": "Polygon", "coordinate": [[-74.00390625, 40.7373046875], [-73.9599609375, 40.7373046875], [-73.959609609375, 40.78125], [-74.00390625, 40.78125], [-74.00390625, 40.7373046875]]]]}]
},
"properties": {"name": "Insieme poligoni Geohash"
}}

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

print GeohashPolygon = geo_geohash_to_polygon("a");

Output

GeohashPolygon