在geojson中实现多边形环缠绕顺序的python库

geojson-rewind的Python项目详细描述


GeoJSON倒带

Build StatusCoverage StatusPyPI VersionLicensePython Support

用于在geojson中强制执行多边形环形缠绕顺序的python库

规范要求right hand rule

A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.

这有助于生成兼容多边形和多多边形几何体。

安装

pip install geojson-rewind

用法

>>>input={...'geometry':{'coordinates':[[[100,0],...[100,1],...[101,1],...[101,0],...[100,0]]],...'type':'Polygon'},...'properties':{'foo':'bar'},...'type':'Feature'}>>>fromgeojson_rewindimportrewind>>>output=rewind(input)>>>importpprint>>>pp=pprint.PrettyPrinter(indent=4)>>>pp.pprint(output){'geometry':{'coordinates':[[[100,0],[101,0],[101,1],[100,1],[100,0]]],'type':'Polygon'},'properties':{'foo':'bar'},'type':'Feature'}

致谢

geojson-rewind是mapbox的javascriptgeojson-rewind包的python端口。记入Tom MacWrightcontributors

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Logback和Lombok   Java中的线程本地初始化?   java如何使用XPATH从XML中获取值   java如何从谷歌扳手的变异中获得合适的数据类型值?   java在完成autoIt执行后将控制权返回Selenium测试执行   java在Android Studio中添加新资源文件夹的正确方法?   java矩阵模板类   GetSharedReferences上的java Android SharedReferences NullPointerException   java意外的Maven依赖项中介行为   oop java:确保该类型只有一个实例   java我应该使用什么作为null的哈希代码?   http使用单个操作下载多个文件   java GetMappings在弹性搜索7中发生了变化。十、   java Swing:在generalpath上检测鼠标移动   无验证的java jsoup解析   twitter(安卓应用)中的java无效令牌访问格式   使用HttpServletRequest创建的JSESSIONID cookie的java设置路径。getSession(真)   阿里云Java捕获和提升事件中的错误处理   从节点调用java程序。js应用程序