fix: slow add_shp in cartopy v0.23 #116
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cartopy<=0.22
时FeatureArtist.draw
只会投影和绘制与GeoAxes
的extent
方框有交点的几何对象,但 0.23 的 PR#2323 新增了判断分支:如果feature
是ShapelyFeature
,那么不会做跳过方框外的几何对象的处理,会对city.shp
里的所有内容做投影和绘制,而等距圆柱投影到等距方位投影的转换特别耗时。提交的修改是在
cinrad.visualize.utils
里复制一份功能跟ShapelyFeature
相同,但类型不一样的Feature
类,这样就能触发跳过方框外几何对象的分支,让画图速度恢复到cartopy<=0.22
的水平。