ArcPy AttributeError:“module”对象没有属性“FromGeohash”

2024-07-05 14:18:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在Arcpy中使用FromGeohash方法,但它失败了。我的代码是:

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

它给了我一个错误:

^{pr2}$

谁能告诉我是什么引起的?Arcpy似乎导入正确。在


Tags: 方法代码import错误extentspatialreferenceprint
1条回答
网友
1楼 · 发布于 2024-07-05 14:18:42

看起来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 Pro。我在ArcMap文档中能找到的关于Geohash的唯一提及是针对Data Interoperability extension。在

因此,您可能需要使用ArcGIS Pro python解释器,或者使用不同的模块来解码geohash。看起来这个Python module可能有用吗?在

相关问题 更多 >