Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: slow add_shp in cartopy v0.23 #116

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

ZhaJiMan
Copy link
Contributor

@ZhaJiMan ZhaJiMan commented Jul 11, 2024

cartopy<=0.22FeatureArtist.draw 只会投影和绘制与 GeoAxesextent 方框有交点的几何对象,但 0.23 的 PR#2323 新增了判断分支:如果 featureShapelyFeature,那么不会做跳过方框外的几何对象的处理,会对 city.shp 里的所有内容做投影和绘制,而等距圆柱投影到等距方位投影的转换特别耗时。

提交的修改是在 cinrad.visualize.utils 里复制一份功能跟 ShapelyFeature 相同,但类型不一样的 Feature 类,这样就能触发跳过方框外几何对象的分支,让画图速度恢复到 cartopy<=0.22 的水平。

@CyanideCN
Copy link
Owner

非常感谢!

@CyanideCN CyanideCN merged commit 65091fd into CyanideCN:master Jul 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants