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

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第三方库


热门话题
在reducer中迭代自定义可写组件时出现java问题   属性文件中属性的java命名约定   任务链关闭的java Executor服务   java从Eclipse中的字段生成多个构造函数   java通过继承读取Json   java在不知道密钥的情况下解析json   java camel cxf如何在电子邮件中发送soap请求响应   java程序似乎跳过了if语句的一部分,在移回正确位置之前先移到else语句   测试简单的Java加密/解密inputFileName不存在   java从Jenkins REST API获取所有作业的所有构建的构建细节   java基本包装器和静态“类型”类对象   在WebSphere8.5上部署java代码   java对象相等(对象引用“=”)   java MongoDB整型字段到枚举的转换   每次我重新导入gradle时,IntelliJ都会不断重置Java设置   类型使用键或索引从Java中的数据类型检索值   在Java的列表接口中需要listIterator()和iterator()是什么?