polygonarea.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:qgis-shapetools-plugin 作者: NationalSecurityAgency 项目源码 文件源码
def _transitdirect(lon1, lon2):
    """Count crossings of prime meridian for AddEdge."""
    # We want to compute exactly
    #   int(floor(lon2 / 360)) - int(floor(lon1 / 360))
    # Since we only need the parity of the result we can use std::remquo but
    # this is buggy with g++ 4.8.3 and requires C++11.  So instead we do
    lon1 = math.fmod(lon1, 720.0); lon2 = math.fmod(lon2, 720.0)
    return ( (0 if ((lon2 >= 0 and lon2 < 360) or lon2 < -360) else 1) -
             (0 if ((lon1 >= 0 and lon1 < 360) or lon1 < -360) else 1) )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号