python - 无法使用 geopandas 加载 geojson 文件
问题描述
我正在尝试将 geojson 文件加载到 Jupyter 笔记本中,使用
import geopandas as gpd
country = gpd.read_file(r"path-to-file\svn_border.geojson")
它返回以下错误:
CPLE_OpenFailedError: 'path-to-file\svn_border.geojson' does not exist in the file system, and is not recognized as a supported dataset name.
fiona\ogrext.pyx in fiona.ogrext.Session.start()
fiona\_shim.pyx in fiona._shim.gdal_open_vector()
DriverError: 'path-to-file\svn_border.geojson' does not exist in the file system, and is not recognized as a supported dataset name.
我正在使用 Python 3.6.8、Fiona 1.18、GDAL 3.1.4。即使我尝试将 geojson 文件的内容上传为 json 格式,它也会给出相同的错误。
我这几天一直在处理同样的错误,有人能指出我的错误吗?
编辑:在尝试验证我拥有的 geojson 文件后,结果发现它们已损坏。我使用了一个示例 geojson 文件,效果很好。
解决方案
推荐阅读
- mysql - 为什么mysql不像percona服务器那样实现杀死空闲事务?
- javascript - model.predict is not a function while using TensorflowJS
- javascript - Math.min.apply(Math,Array) return NaN when Array.length = 100
- mysql - MySQL 中的不偏不倚查询
- php - Wordpress - ACF - 带有 x 2 字段过滤器的管理员/用户列表
- python - 用于为返回动态数据的函数编写单元测试的 Python 库
- ios - macOS Swift AVCaptureSession sessionPreset 不起作用
- c# - 在 C# Winforms 中将视频转换为 exe
- android - 如何在android studio中编译一个aosp项目?
- ios - ios应用程序的内存消耗