繁体   English   中英

使用 cartopy 绘制地图会产生错误

[英]Plotting a map with cartopy generates an error

当我尝试运行以下代码时:

#!/usr/bin/env python3
import matplotlib.path as mpath
import matplotlib.pyplot as plt
import numpy as np

import cartopy.crs as ccrs
import cartopy.feature as cfeature
import shapely


ax=plt.axes(projection=ccrs.NorthPolarStereo())
ax.add_feature(cfeature.LAND,facecolor='green')

plt.show()

我收到以下错误: python3: LineString.cpp:125: const geos::geom::CoordinateSequence* geos::geom::LineString::getCoordinatesRO() const: Assertion `nullptr != points.get()' failed. Aborted python3: LineString.cpp:125: const geos::geom::CoordinateSequence* geos::geom::LineString::getCoordinatesRO() const: Assertion `nullptr != points.get()' failed. Aborted

我不确定问题是否来自 cartopy 本身。 我在 Linux (Debian 10) 上运行代码,python 版本是 3.7.3,匀称版本 1.7.1,cartopy 版本是 0.18.0,libgeos 版本是 3.7.1

感谢您的帮助。

问题解决了,我已经通过 pip 安装了 cartopy,我通过从 git 存储库中的最新版本编译它来重新安装它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM