python - 使用 Cartopy 时,几何图形必须是点或线串错误

标签 python cartopy

我正在尝试运行一个简单的 Cartopy 示例:

   import cartopy.crs as ccrs
   import matplotlib.pyplot as plt
   ax = plt.axes(projection=ccrs.PlateCarree())
   ax.coastlines()
   plt.show()

但我收到此错误:

几何图形必须是点或线串
python: geos_ts_c.cpp:4179: int GEOSCoordSeq_getSize_r(GEOSContextHandle_t, const geos::geom::CoordinateSequence*, unsigned int*): 断言0 != cs' failed`。

我使用 miniconda3 安装了 Cartopy: conda install -c conda-forge cartopy 我还尝试使用 pip (在虚拟环境中)安装 Cartopy,但出现了相同的错误。 我的操作系统是 Debian Buster。

有什么想法吗?

最佳答案

问题是 shapely 版本错误,不应该使用 Cartopy 的二进制包,而应该从源代码构建。 这是解释herehere .

所以我做到了:

pip uninstall shapely
pip install shapely --no-binary shapely

关于python - 使用 Cartopy 时,几何图形必须是点或线串错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60111684/

相关文章:

python - 如何禁用 Selenium (Python 3) 上的 geckodriver 日志?

python - 为什么我的谷歌图 block 在 Cartopy map 中看起来很差?

python - Cartopy 范围问题 (free() : invalid size)

python-3.x - 使用 Cartopy 绘制细粒度测地线

python - 颜色条相对于地理轴的正确放置(cartopy)

python - 我如何暗示一个类型与打字具有可比性

python - 如何找到其他两个列表中的每个元素?

python - 使用 psycopg2 和 python 3.4 将数据从 csv 插入到 postgres 表

python - html5lib 的哪个版本是稳定的?

cartopy - 具有特征的面具立方体