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

对 shapely >= 2.0.* 版本的支持 #106

Open
Clarmy opened this issue Aug 11, 2023 · 5 comments
Open

对 shapely >= 2.0.* 版本的支持 #106

Clarmy opened this issue Aug 11, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@Clarmy
Copy link
Member

Clarmy commented Aug 11, 2023

目前对地图多边形对象是直接继承 shapely.geometry.MultiPolygon 对象。而在 shapely >= 2.0.* 版本以后不再支持这种继承,目前的解决方法是在构建的时候限制 shapely 的版本号必须低于2.0,但是长期这样会导致未来在其他依赖不断迭代的的过程中,如果出现不支持 shapely < 2.0 的依赖限制时,则 cnmaps 可能会难以迭代。因此需要尽快重构部分代码以适配 shapely 2.0 及以上版本的兼容。

@Clarmy Clarmy self-assigned this Aug 11, 2023
@Clarmy Clarmy added the enhancement New feature or request label Aug 11, 2023
@huddao
Copy link

huddao commented Jan 17, 2024

请问使用maskout的时候报错AttributeError: 'MultiPolygon' object has no attribute 'maskout'也是这个原因吗,shapely的版本是2.0.2

@Clarmy
Copy link
Member Author

Clarmy commented May 13, 2024

请问使用maskout的时候报错AttributeError: 'MultiPolygon' object has no attribute 'maskout'也是这个原因吗,shapely的版本是2.0.2

是的。

@Clarmy
Copy link
Member Author

Clarmy commented May 20, 2024

对于 shapely>=2.0 无法继承子类的一个解决方案参考:shapely/shapely#1233 (comment)

@huddao
Copy link

huddao commented Aug 27, 2024

请问近期还有支持shapely >= 2.0.* 版本的更新计划吗?

@Clarmy
Copy link
Member Author

Clarmy commented Aug 28, 2024

@huddao 我之前尝试过做兼容,但是目前核心还没解决。如果要强行兼容,有可能需要整体重构很多方法,有些方法可能就用不了了(比如加减合并的功能)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants