转换(英国)军械测量国家网格和经纬度坐标的库

OSGridConverter的Python项目详细描述


说明

这个软件包允许用户操作地球表面的坐标。 在两个主要坐标系中:纬度/经度以度为单位, 以及制图系统,以东距和北距测量, 基于地球大地水准面的局部椭球近似。

特别是,它提供了处理coordinates的工具 (形式为ab 12345 12345)基于National Grid,定义 英国军械调查局。有关详细信息,请参阅军械测量局的 国家电网FAQ page

包提供了基本的函数来转换 纬度/经度国家网格反之亦然。然而, 下面是一个全面的系统,用于在 不同的co-ordinate systems,包括英国,爱尔兰共和国, 法国、北美和日本。

简单转换

OSGridConverter。latlong2gridlatitudelongitudetag='wgs84'

Converts from latitude / longitude to an OS Grid Reference.

latitude:The latitude of the point, expressed in decimal degrees North
longitude:The longitude of the point, expressed in decimal degrees East
tag:The name of the datum used in the conversion; default is WGS84, referring to the standard datum used by Ordnance Survey

返回值是一个osgridreference对象。为了简单起见 重要的是,g的转换就是这样一个对象,然后g.eg.n分别表示其东距和北距,单位为米,以及 str(g)返回格式化的国家网格引用。

示例:

>>> from OSGridConverter import latlong2grid
>>> g=latlong2grid(52.657977,1.716038)
>>> (g.E,g.N)
(651408, 313177)
>>> str(g)
'TG 51408 13177'

OSGridConverter。grid2latlonggridtag='wgs84'

Converts from an OS Grid Reference to latitude / longitude.

grid:The point to be converted. Either an OSGridReference object, or a string formatted as an Ordnance Survey grid reference, e.g. ‘TG 51408 13177’
tag:The name of the mapping datum used in the conversion; default is WGS84, referring to the standard datum used by Ordnance Survey

返回值是一个latlong对象。为了简单起见 重要的是,l的转换就是这样一个对象,然后l.latitude 它的纬度表示为十进制的北纬度,g。经度是 它的经度以东边的十进制度数表示。

示例:

>>> from OSGridConverter import grid2latlong
>>> l=grid2latlong('TG 51408 13177')
>>> (l.latitude,l.longitude)
(52.65798005789814, 1.7200761111093394)

OSGridConverter。标记

A list of strings: names of the standing mapping Data that the package is aware of and can convert between. Its members are the valid values that can be used in the tag field of the conversion functions.

TagDetails
WSG84UK
OSGB36Former UK standard (replaced by WGS84)
ED50UK; used for oil and gas exploration
Irl1975Republic of Ireland
NTFFrance
TokyoJapanJapan
NAD83North America; very similar to WGS84

For more information (and more examples of mapping Data) see the Wikipedia page on Geodetic Datum.

注释

从lat/long转换为grid并返回lat/long通常不 以原始值结束。这是由于内部舍入的组合 误差,加上国家网格将点分解为10米x 10米的正方形。 在上面的例子中,前后纬度相差约1.0e-5 经度大约是3.0e-3,这是典型的。

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

推荐PyPI第三方库


热门话题
java ProcessBuilder在使用多个参数时运行不正常   java如何使用Spring数据ORM/JPA创建EntityManagerFactory?   将Velocity宏转换为Java指令   internet上的Java TCP/IP服务器客户端通信   java为什么JDK 8允许一个局部内部类(在方法内部)访问封闭方法的非最终局部变量?   基于Java的比率算法   java应用程序在选择列表首选项时出错   java保存对象以供以后使用   java如何使用MySQL JDBC驱动程序连接Android和MySQL   java Zipkin可以用于控制台应用程序   java单击刷新Servlet页面显示重复内容   java如何递归地反转字符串数组?   java如何使用inputStream作为outputStream的文本?   java扩展令牌选择操作符   java在映射中使用通用枚举类   arraylist如何使用JAVA流从对象列表中查找平均值   windows将FileInputStream和FileOutputStream传递给ffmpeg进行转码(使用JAVEJava音频视频编码)   java Ant脚本在执行CVS签出后找不到目标   重复值情况下的java插入排序,双链表ADT   java如何在Accumulo中获取数据库查询计数