0

I'm trying to use FromGeohash method in Arcpy but it is failing. Here's my code:

import arcpy
spatial_reference = arcpy.SpatialReference(4326)
print spatial_reference
extent = arcpy.FromGeohash('9q8yyx')

It's giving me the error:

    Traceback (most recent call last):
  File "C:/Python27/ArcGIS10.7/Scripts/Geohash_Converter.py", line 4, in <module>
    extent = arcpy.FromGeohash('9q8yyx')
AttributeError: 'module' object has no attribute 'FromGeohash'

Can anyone tell me what's causing this? Arcpy seems to have been imported correctly.

DiamondJoe12
  • 1,879
  • 7
  • 33
  • 81

1 Answers1

2

It looks like the FromGeohash function is only available in the ArcPro version of ArcPy. With the ArcMap version (10.6) if I try to import that I get an error:

from arcpy import FromGeohash

Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: cannot import name FromGeohash

Also the only documentation I can find for FromGeohash is for ArcGIS Pro. The only mention of Geohash I can find in the ArcMap documentation is for the Data Interoperability extension.

So it looks like you will either need to use the ArcGIS Pro python interpreter or else use a different module for decoding the geohash. It looks like this Python module might work?

BigGerman
  • 525
  • 3
  • 11