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

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将Map<String,String>传递给需要Map<String,Object>   java在循环中使用字符串而不是StringBuilder是否会造成内存损失?   jnlp如何更新java控制台JRE?   java更改、修改和重新打包CXFAPI源文件   JavaFXJava应用程序在Fedora上运行一段时间后关闭   使用来自不同类的方法的java   java如何通过ant脚本在linux中使用subst?   java在使用camunda modeler进行base64编码/解码时出错   获取java。netbeans、weblogic和fastswap设置为true时的lang.NoSuchMethodError   java如何提高FinalizerThread在GC中收集对象的优先级   java检测具有相同根的单词   netbeans crud应用程序中的java错误