Python Shapely安装不工作?

2024-10-01 17:41:47 发布

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

有什么想法吗?我试过卸载Shapely并用PIP安装 我有Python和安装菲奥娜罚款和形状似乎罚款。 简单代码:

import fiona
import shapely

dirVar = "C:\\Users\\me\\Desktop\\geocode\\"

with fiona.open(dirVar + "Regions.shp") as fiona_collection:

    shapefile_record = fiona_collection.next()
    shape = shapely.geometry.asShape(shapefile_record['geometry']) #GET ERROR HERE

    point = shapely.geometry.Point(32.398516, -39.754028) # longitude, latitude

    if shape.contains(point):
        print "Found shape for point."

AttributeError: 'module' object has no attribute 'geometry'

当我从Wing IDE看shapely的方法时,我只看到:

^{pr2}$

如果安装正确的话,我想我应该看看几何结构?在

有什么想法吗?在


Tags: pip代码importrecordcollectionpoint形状shapefile

热门问题