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) )
polygonarea.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录