如何从安装在 aws windows ec2 实例上的 s3 存储桶中读取解压缩的 shapefile 并作为地理数据框打开?

问题描述 投票:0回答:0

我有一个解压缩的 shapefile 存储在 s3 存储桶中,该存储桶作为驱动器安装到 ec2 windows 虚拟机上。 s3 bucket挂载为虚拟机上的K盘。我正在尝试从 s3 存储桶中读取 shapefile 并将其作为 jupyter notebook 中的地理数据框打开。这是代码:

将 pandas 导入为 pd

将 geopandas 导入为 gpd

path = r'K:\NY TEST DATA\Counties\NY_Counties.shp'

gdf = gpd.read_file(路径)

gdf

当我运行它时,出现以下错误: DriverError: K:\NY TEST DATA\Counties\NY_Counties.shp: 没有那个文件或目录

我能够将 shapefile 写入映射的 s3 存储桶并且工作正常,但我无法读取存储在存储桶中的 shapefile。有谁知道怎么做?

python amazon-web-services amazon-s3 amazon-ec2 geopandas
© www.soinside.com 2019 - 2024. All rights reserved.