Skip to main content

FromGeohash

Résumé

Converts a geohash string to an Extent object in WGS 1984 coordinates that represents the corresponding bounding box in the geohash grid.

Syntaxe

FromGeohash(geohash_string)

Le paramètre Explication Type de données

geohash_string

The geohash string used to obtain the extent in WGS 1984 coordinates.

String

Valeur de retour

Type de données Explication

Extent

FromGeohash returns an Extent object in WGS 1984 coordinates of the geohash string.

Exemple de code

FromGeohash example 1

Return an Extent object from a geohash string.

import arcpy
extent = arcpy.FromGeohash('dp1k05k8')
FromGeohash example 2

Get point geometry at the center of the Extent object converted from the geohash string.

import arcpy

# Spatial reference set to GCS_WGS_1984
spatial_reference = arcpy.SpatialReference(4326)

extent = arcpy.FromGeohash('dp1k05k8')
extent_x = (extent.XMax + extent.XMin) / 2
extent_y = (extent.YMax + extent.YMin) / 2

pnt = arcpy.Point(extent_x, extent_y)
pnt_geom = arcpy.PointGeometry(pnt, spatial_reference)