把所有的航海计算都记在这里。

nautical-calculations的Python项目详细描述


航海计算

nautical-calculations is a Python library used for dealing with some basic Geospatial calculations on the geographic coordinate system.

It is developed to act as an interface for performing calculations like the nautical distance (Great Circle distance), Rhumb line distance and bearing angle. It explores the possiblitity of using these basic terms in performing operations like:

  • Finding all the coordinates which lie on the great circle line joining any two points on the map
  • Finding the coordinates of a point at a particular angle and distance from the given point.
  • Finding the coordinates of midpoint on the great circle line joining any two points on the map.

The main idea is to save the time of defining your own functions to derive these terms, thus making the project development easier.

example 1example2example 3

安装

使用包管理器pip安装航海计算。在

pip install nautical-calculations

使用

^{pr2}$

或者

fromnautical_calculations.basicimportget_distancefromnautical_calculations.basicimportget_bearingfromnautical_calculations.basicimportrhumb_linefromnautical_calculations.operationsimportget_pointfromnautical_calculations.operationsimportget_midpointfromnautical_calculations.operationsimportdivide_by_intervalfromnautical_calculations.operationsimportdivide_by_number

使用示例:

I)航程(km)

get_distance(lat1,long1,lat2,long2)# returns the nautical distance (in km) between two coordinates (lat1,long1) and (lat2,long2)

II)方位(度)

get_bearing(lat1,long1,lat2,long2)# returns the bearing between two coordinates (lat1,long1) and (lat2,long2)

III)恒线(km)

rhumb_line(lat1,long1,lat2,long2)# returns rhumb line distance (in km) between two given coordinates

IV)点(纬度、经度)

get_point(lat,long,azimuth,distance)# returns the coordinate (lat1,long1) at a particular distance and angle (azimuth) from the given point (lat,long)

V)中间点(按数量)

divide_by_number(lat1,long1,lat2,long2,number)# returns a list containing all points in between the two specified coordinate pairs (lat-long) given the number value

VI)中间点(按间隔)

divide_by_interval(lat1,long1,lat2,long2,interval)# returns a list containing all points in between the two specified coordinate pairs (lat-long) given the interval value

VII)中点

get_midpoint(lat1,long1,lat2,long2)#Returns the coordinates of midpoint on the rhumb line joining the given endpoint coordinates (lat1,long1,lat2,long2)

VIII)转换

fromnautical_calculations.operationsimportconvert_to_radians,convert_to_miles,convert_to_kilometres,convert_to_degress
convert_to_miles(distance)#converts distance in kms to miles
convert_to_kilometres(distance)#converts distance in miles to kms
convert_to_radians(angle)#converts angle in degrees to radians
convert_to_degress(angle)#converts angle in radians to degrees

Github存储库链接

https://github.com/AmeyHengle/nautical_calculations.git

贡献

欢迎拉取请求。对于重大变化,请先打开一个问题,讨论您希望更改的内容。在

请确保根据需要更新测试。在

参考文献

  1. http://mathforum.org/library/drmath/view/51879.html
  2. http://www.edwilliams.org/avform.htm#Intermediate
  3. http://mathforum.org/library/drmath/view/55417.html
  4. http://mathforum.org/library/drmath/view/51822.html

许可证

MIT

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

推荐PyPI第三方库


热门话题
java基于条件如何创建StringBuffers并向其添加数据   java如何用UNC路径解决“不表示可正确访问的目录”异常?   在执行提取方法重构后,java代码的速度降低了6倍   java如何修改LDAPCertStore中用于X509证书链验证的LDAP连接属性   awt如何在Java中捕获鼠标光标?   字符串如何设置Java输出流   java NumberFormatException:用于输入字符串:“8:00”   unix/linux“tail f”的Java IO文件实现   java打印输出。带有JOptionPane的txt文件   java解组总是显示0和null   使用MySQL的windows java JavaFX自包含应用程序打包   JavaSpring:方法getBean(String…)是如何实现的根据输入字符串查找bean?   java高效地更新RecyclerView网格或以其他方式显示复杂网格   java向ArrayList添加对象(String、String、int、int)   java在一组文档上使用ForkJoinPool