简体   繁体   中英

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

I'm not sure the problem is coming from cartopy itself. 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

Thank you for your help.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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