简体   繁体   English

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

[英]Plotting a map with cartopy generates an error

when I try to run the following code:当我尝试运行以下代码时:

#!/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()

I get the following error: 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 python3: LineString.cpp:125: const geos::geom::CoordinateSequence* geos::geom::LineString::getCoordinatesRO() const: Assertion `nullptr != points.get()' failed. Aborted

I'm not sure the problem is coming from cartopy itself.我不确定问题是否来自 cartopy 本身。 I'm running the code on Linux (Debian 10), python version is 3.7.3, shapely version 1.7.1, cartopy version is 0.18.0, libgeos version is 3.7.1我在 Linux (Debian 10) 上运行代码,python 版本是 3.7.3,匀称版本 1.7.1,cartopy 版本是 0.18.0,libgeos 版本是 3.7.1

Thank you for your help.感谢您的帮助。

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

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

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