我尝试在Arcpy中使用FromGeohash方法,但是失败了。下面是我的代码:
import arcpy
spatial_reference = arcpy.SpatialReference(4326)
print spatial_reference
extent = arcpy.FromGeohash('9q8yyx')它给了我一个错误:
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'有人能告诉我这是什么原因吗?Arcpy似乎已正确导入。
发布于 2019-05-17 21:43:38
看起来FromGeohash函数只在ArcPy的ArcPro版本中可用。对于ArcMap版本(10.6),如果我尝试导入,则会出现错误:
from arcpy import FromGeohash
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: cannot import name FromGeohash另外,我能找到的唯一的FromGeohash文档是ArcGIS专业版的。我在ArcMap文档中唯一能找到的关于Geohash的内容是针对Data Interoperability extension的。
因此,看起来您要么需要使用ArcGIS Pro python解释器,要么需要使用不同的模块来解码geohash。看起来这个Python module可能行得通?
https://stackoverflow.com/questions/56154787
复制相似问题