如何在 python 或 Javascript 中从 UTM 转换为 LatLng

发布于 2024-07-09 12:54:50 字数 383 浏览 8 评论 0原文

我有一堆带有 UTM 形式坐标的文件。 对于每个坐标,我都有东距、北距和区域。 我需要将其转换为 LatLng 以便与 Google Map API 一起使用以在地图中显示信息。

我找到了一些可以执行此操作的在线计算器,但没有实际的代码或库。 http://trac.osgeo.org/proj4js/ 是一个 Javascript 投影库,但是看看该演示不包括 UTM 投影。

我对整个 GIS 领域还很陌生,所以我想要的是:

(lat,lng) = transform(easting, northing, zone)

I have a bunch of files with coordinates in UTM form. For each coordinate I have easting, northing and zone. I need to convert this to LatLng for use with Google Map API to show the information in a map.

I have found some online calculators that does this, but no actual code or libraries. http://trac.osgeo.org/proj4js/ is a projection library for Javascript, but looking at the demo it doesn't include UTM projection.

I am still pretty fresh to the entire GIS domain, so what I want is something ala:

(lat,lng) = transform(easting, northing, zone)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

╰つ倒转 2024-07-16 12:54:50

我最终找到了 IBM 的 java 代码来解决这个问题: http:// /www.ibm.com/developerworks/java/library/j-coordconvert/index.html

仅供参考,这是我所需方法的 python 实现:

import math

def utmToLatLng(zone, easting, northing, northernHemisphere=True):
    if not northernHemisphere:
        northing = 10000000 - northing

    a = 6378137
    e = 0.081819191
    e1sq = 0.006739497
    k0 = 0.9996

    arc = northing / k0
    mu = arc / (a * (1 - math.pow(e, 2) / 4.0 - 3 * math.pow(e, 4) / 64.0 - 5 * math.pow(e, 6) / 256.0))

    ei = (1 - math.pow((1 - e * e), (1 / 2.0))) / (1 + math.pow((1 - e * e), (1 / 2.0)))

    ca = 3 * ei / 2 - 27 * math.pow(ei, 3) / 32.0

    cb = 21 * math.pow(ei, 2) / 16 - 55 * math.pow(ei, 4) / 32
    cc = 151 * math.pow(ei, 3) / 96
    cd = 1097 * math.pow(ei, 4) / 512
    phi1 = mu + ca * math.sin(2 * mu) + cb * math.sin(4 * mu) + cc * math.sin(6 * mu) + cd * math.sin(8 * mu)

    n0 = a / math.pow((1 - math.pow((e * math.sin(phi1)), 2)), (1 / 2.0))

    r0 = a * (1 - e * e) / math.pow((1 - math.pow((e * math.sin(phi1)), 2)), (3 / 2.0))
    fact1 = n0 * math.tan(phi1) / r0

    _a1 = 500000 - easting
    dd0 = _a1 / (n0 * k0)
    fact2 = dd0 * dd0 / 2

    t0 = math.pow(math.tan(phi1), 2)
    Q0 = e1sq * math.pow(math.cos(phi1), 2)
    fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * math.pow(dd0, 4) / 24

    fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * math.pow(dd0, 6) / 720

    lof1 = _a1 / (n0 * k0)
    lof2 = (1 + 2 * t0 + Q0) * math.pow(dd0, 3) / 6.0
    lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * math.pow(Q0, 2) + 8 * e1sq + 24 * math.pow(t0, 2)) * math.pow(dd0, 5) / 120
    _a2 = (lof1 - lof2 + lof3) / math.cos(phi1)
    _a3 = _a2 * 180 / math.pi

    latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / math.pi

    if not northernHemisphere:
        latitude = -latitude

    longitude = ((zone > 0) and (6 * zone - 183.0) or 3.0) - _a3

    return (latitude, longitude)

在这里我认为它很简单,例如 easting*x+zone*y 之类的。

I ended up finding java code from IBM that solved it: http://www.ibm.com/developerworks/java/library/j-coordconvert/index.html

Just for reference, here is my python implementation of the method I needed:

import math

def utmToLatLng(zone, easting, northing, northernHemisphere=True):
    if not northernHemisphere:
        northing = 10000000 - northing

    a = 6378137
    e = 0.081819191
    e1sq = 0.006739497
    k0 = 0.9996

    arc = northing / k0
    mu = arc / (a * (1 - math.pow(e, 2) / 4.0 - 3 * math.pow(e, 4) / 64.0 - 5 * math.pow(e, 6) / 256.0))

    ei = (1 - math.pow((1 - e * e), (1 / 2.0))) / (1 + math.pow((1 - e * e), (1 / 2.0)))

    ca = 3 * ei / 2 - 27 * math.pow(ei, 3) / 32.0

    cb = 21 * math.pow(ei, 2) / 16 - 55 * math.pow(ei, 4) / 32
    cc = 151 * math.pow(ei, 3) / 96
    cd = 1097 * math.pow(ei, 4) / 512
    phi1 = mu + ca * math.sin(2 * mu) + cb * math.sin(4 * mu) + cc * math.sin(6 * mu) + cd * math.sin(8 * mu)

    n0 = a / math.pow((1 - math.pow((e * math.sin(phi1)), 2)), (1 / 2.0))

    r0 = a * (1 - e * e) / math.pow((1 - math.pow((e * math.sin(phi1)), 2)), (3 / 2.0))
    fact1 = n0 * math.tan(phi1) / r0

    _a1 = 500000 - easting
    dd0 = _a1 / (n0 * k0)
    fact2 = dd0 * dd0 / 2

    t0 = math.pow(math.tan(phi1), 2)
    Q0 = e1sq * math.pow(math.cos(phi1), 2)
    fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * math.pow(dd0, 4) / 24

    fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * math.pow(dd0, 6) / 720

    lof1 = _a1 / (n0 * k0)
    lof2 = (1 + 2 * t0 + Q0) * math.pow(dd0, 3) / 6.0
    lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * math.pow(Q0, 2) + 8 * e1sq + 24 * math.pow(t0, 2)) * math.pow(dd0, 5) / 120
    _a2 = (lof1 - lof2 + lof3) / math.cos(phi1)
    _a3 = _a2 * 180 / math.pi

    latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / math.pi

    if not northernHemisphere:
        latitude = -latitude

    longitude = ((zone > 0) and (6 * zone - 183.0) or 3.0) - _a3

    return (latitude, longitude)

And here I thought it was something simple like easting*x+zone*y or something.

痴情 2024-07-16 12:54:50

我发现的是以下网站: http://home.hiwaay.net /~taylorc/toolbox/geography/geoutm.html
它有一个 javascript 转换器,你应该检查那里的算法。 从页面:

程序员:本文档中的 JavaScript 源代码可以不受限制地复制和重复使用。

What I found is the following site: http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html
It has a javascript converter, you should check the algorithm there. From the page:

Programmers: The JavaScript source code in this document may be copied and reused without restriction.

一萌ing 2024-07-16 12:54:50

根据此页面,proj4js 支持 UTM。

http://trac.osgeo.org/proj4js/wiki/UserGuide#Supportedprojectionclasses

您可能还想查看 GDAL。 gdal 库具有出色的 python 支持,但如果您只进行投影转换,它可能有点矫枉过正。

According to this page, UTM is supported by proj4js.

http://trac.osgeo.org/proj4js/wiki/UserGuide#Supportedprojectionclasses

You may also want to take a look at GDAL. The gdal library has excellent python support, though it may be a bit overkill if you're only doing projection conversion.

泪冰清 2024-07-16 12:54:50

Staale 答案的 Javascript 版本

function utmToLatLng(zone, easting, northing, northernHemisphere){
        if (!northernHemisphere){
            northing = 10000000 - northing;
        }

        var a = 6378137;
        var e = 0.081819191;
        var e1sq = 0.006739497;
        var k0 = 0.9996;

        var arc = northing / k0;
        var mu = arc / (a * (1 - Math.pow(e, 2) / 4.0 - 3 * Math.pow(e, 4) / 64.0 - 5 * Math.pow(e, 6) / 256.0));

        var ei = (1 - Math.pow((1 - e * e), (1 / 2.0))) / (1 + Math.pow((1 - e * e), (1 / 2.0)));

        var ca = 3 * ei / 2 - 27 * Math.pow(ei, 3) / 32.0;

        var cb = 21 * Math.pow(ei, 2) / 16 - 55 * Math.pow(ei, 4) / 32;
        var cc = 151 * Math.pow(ei, 3) / 96;
        var cd = 1097 * Math.pow(ei, 4) / 512;
        var phi1 = mu + ca * Math.sin(2 * mu) + cb * Math.sin(4 * mu) + cc * Math.sin(6 * mu) + cd * Math.sin(8 * mu);

        var n0 = a / Math.pow((1 - Math.pow((e * Math.sin(phi1)), 2)), (1 / 2.0));

        var r0 = a * (1 - e * e) / Math.pow((1 - Math.pow((e * Math.sin(phi1)), 2)), (3 / 2.0));
        var fact1 = n0 * Math.tan(phi1) / r0;

        var _a1 = 500000 - easting;
        var dd0 = _a1 / (n0 * k0);
        var fact2 = dd0 * dd0 / 2;

        var t0 = Math.pow(Math.tan(phi1), 2);
        var Q0 = e1sq * Math.pow(Math.cos(phi1), 2);
        var fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * Math.pow(dd0, 4) / 24;

        var fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * Math.pow(dd0, 6) / 720;

        var lof1 = _a1 / (n0 * k0);
        var lof2 = (1 + 2 * t0 + Q0) * Math.pow(dd0, 3) / 6.0;
        var lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * Math.pow(Q0, 2) + 8 * e1sq + 24 * Math.pow(t0, 2)) * Math.pow(dd0, 5) / 120;
        var _a2 = (lof1 - lof2 + lof3) / Math.cos(phi1);
        var _a3 = _a2 * 180 / Math.PI;

        var latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / Math.PI;

        if (!northernHemisphere){
          latitude = -latitude;
        }

        var longitude = ((zone > 0) && (6 * zone - 183.0) || 3.0) - _a3;

        var obj = {
              latitude : latitude,
              longitude: longitude
        };


        return obj;
      }

A Javascript version of Staale answer

function utmToLatLng(zone, easting, northing, northernHemisphere){
        if (!northernHemisphere){
            northing = 10000000 - northing;
        }

        var a = 6378137;
        var e = 0.081819191;
        var e1sq = 0.006739497;
        var k0 = 0.9996;

        var arc = northing / k0;
        var mu = arc / (a * (1 - Math.pow(e, 2) / 4.0 - 3 * Math.pow(e, 4) / 64.0 - 5 * Math.pow(e, 6) / 256.0));

        var ei = (1 - Math.pow((1 - e * e), (1 / 2.0))) / (1 + Math.pow((1 - e * e), (1 / 2.0)));

        var ca = 3 * ei / 2 - 27 * Math.pow(ei, 3) / 32.0;

        var cb = 21 * Math.pow(ei, 2) / 16 - 55 * Math.pow(ei, 4) / 32;
        var cc = 151 * Math.pow(ei, 3) / 96;
        var cd = 1097 * Math.pow(ei, 4) / 512;
        var phi1 = mu + ca * Math.sin(2 * mu) + cb * Math.sin(4 * mu) + cc * Math.sin(6 * mu) + cd * Math.sin(8 * mu);

        var n0 = a / Math.pow((1 - Math.pow((e * Math.sin(phi1)), 2)), (1 / 2.0));

        var r0 = a * (1 - e * e) / Math.pow((1 - Math.pow((e * Math.sin(phi1)), 2)), (3 / 2.0));
        var fact1 = n0 * Math.tan(phi1) / r0;

        var _a1 = 500000 - easting;
        var dd0 = _a1 / (n0 * k0);
        var fact2 = dd0 * dd0 / 2;

        var t0 = Math.pow(Math.tan(phi1), 2);
        var Q0 = e1sq * Math.pow(Math.cos(phi1), 2);
        var fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * Math.pow(dd0, 4) / 24;

        var fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * Math.pow(dd0, 6) / 720;

        var lof1 = _a1 / (n0 * k0);
        var lof2 = (1 + 2 * t0 + Q0) * Math.pow(dd0, 3) / 6.0;
        var lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * Math.pow(Q0, 2) + 8 * e1sq + 24 * Math.pow(t0, 2)) * Math.pow(dd0, 5) / 120;
        var _a2 = (lof1 - lof2 + lof3) / Math.cos(phi1);
        var _a3 = _a2 * 180 / Math.PI;

        var latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / Math.PI;

        if (!northernHemisphere){
          latitude = -latitude;
        }

        var longitude = ((zone > 0) && (6 * zone - 183.0) || 3.0) - _a3;

        var obj = {
              latitude : latitude,
              longitude: longitude
        };


        return obj;
      }
黎歌 2024-07-16 12:54:50

我也是新手,最近一直在研究这个主题。

这是我使用 python gdal pacakge (osr 包)找到的方法包含在 gdal 中)。 gdal 包非常强大,但文档还可以更好。

这是从这里的讨论得出的:
http://www.mail-archive.com/< span class="__cf_email__" data-cfemail="f493909598d9909182b4989d878087da9b8793919bda9b8693">[email protected]/msg12398.html

import osr

def transform_utm_to_wgs84(easting, northing, zone):
    utm_coordinate_system = osr.SpatialReference()
    utm_coordinate_system.SetWellKnownGeogCS("WGS84") # Set geographic coordinate system to handle lat/lon
    is_northern = northing > 0    
    utm_coordinate_system.SetUTM(zone, is_northern)

    wgs84_coordinate_system = utm_coordinate_system.CloneGeogCS() # Clone ONLY the geographic coordinate system 

    # create transform component
    utm_to_wgs84_transform = osr.CoordinateTransformation(utm_coordinate_system, wgs84_coordinate_system) # (<from>, <to>)
    return utm_to_wgs84_transform.TransformPoint(easting, northing, 0) # returns lon, lat, altitude

这是从 wgs84 中的纬度、经度转换的方法(大多数 gps 单位报告的内容) )到 utm:

def transform_wgs84_to_utm(lon, lat):    
    def get_utm_zone(longitude):
        return (int(1+(longitude+180.0)/6.0))

    def is_northern(latitude):
        """
        Determines if given latitude is a northern for UTM
        """
        if (latitude < 0.0):
            return 0
        else:
            return 1

    utm_coordinate_system = osr.SpatialReference()
    utm_coordinate_system.SetWellKnownGeogCS("WGS84") # Set geographic coordinate system to handle lat/lon  
    utm_coordinate_system.SetUTM(get_utm_zone(lon), is_northern(lat))

    wgs84_coordinate_system = utm_coordinate_system.CloneGeogCS() # Clone ONLY the geographic coordinate system 

    # create transform component
    wgs84_to_utm_transform = osr.CoordinateTransformation(wgs84_coordinate_system, utm_coordinate_system) # (<from>, <to>)
    return wgs84_to_utm_transform.TransformPoint(lon, lat, 0) # returns easting, northing, altitude    

我还发现,如果您已经安装了 django/gdal 并且您知道 EPSG 代码,您只需使用 Point() transform() 方法。

from django.contrib.gis.geos import Point
utm2epsg = {"54N": 3185, ...}
p = Point(lon, lat, srid=4326) # 4326 = WGS84 epsg code
p.transform(utm2epsg["54N"])

I'm new to this as well and have been studying up on the subject recently.

Here's a method I found using the python gdal pacakge (the osr package is included in gdal). The gdal package is pretty powerful, but the documentation could be better.

This is derived from a discussion here:
http://www.mail-archive.com/[email protected]/msg12398.html

import osr

def transform_utm_to_wgs84(easting, northing, zone):
    utm_coordinate_system = osr.SpatialReference()
    utm_coordinate_system.SetWellKnownGeogCS("WGS84") # Set geographic coordinate system to handle lat/lon
    is_northern = northing > 0    
    utm_coordinate_system.SetUTM(zone, is_northern)

    wgs84_coordinate_system = utm_coordinate_system.CloneGeogCS() # Clone ONLY the geographic coordinate system 

    # create transform component
    utm_to_wgs84_transform = osr.CoordinateTransformation(utm_coordinate_system, wgs84_coordinate_system) # (<from>, <to>)
    return utm_to_wgs84_transform.TransformPoint(easting, northing, 0) # returns lon, lat, altitude

And here's the method for converting from a lat, lon in wgs84 (what most gps units report) to utm:

def transform_wgs84_to_utm(lon, lat):    
    def get_utm_zone(longitude):
        return (int(1+(longitude+180.0)/6.0))

    def is_northern(latitude):
        """
        Determines if given latitude is a northern for UTM
        """
        if (latitude < 0.0):
            return 0
        else:
            return 1

    utm_coordinate_system = osr.SpatialReference()
    utm_coordinate_system.SetWellKnownGeogCS("WGS84") # Set geographic coordinate system to handle lat/lon  
    utm_coordinate_system.SetUTM(get_utm_zone(lon), is_northern(lat))

    wgs84_coordinate_system = utm_coordinate_system.CloneGeogCS() # Clone ONLY the geographic coordinate system 

    # create transform component
    wgs84_to_utm_transform = osr.CoordinateTransformation(wgs84_coordinate_system, utm_coordinate_system) # (<from>, <to>)
    return wgs84_to_utm_transform.TransformPoint(lon, lat, 0) # returns easting, northing, altitude    

I also found that if you've already got django/gdal installed and you know the EPSG code for the UTM zone you're working on, you can just use the Point() transform() method.

from django.contrib.gis.geos import Point
utm2epsg = {"54N": 3185, ...}
p = Point(lon, lat, srid=4326) # 4326 = WGS84 epsg code
p.transform(utm2epsg["54N"])
养猫人 2024-07-16 12:54:50

有一个Python库(utm)“Bi Direction UTM-WGS84 converter for python”可以管理单个坐标点或系列。

将(纬度、经度)元组转换为 UTM 坐标:

>>> utm.from_latlon(51.2, 7.5)

结果

(395201.3103811303, 5673135.241182375, 32, 'U')

返回的形式为 (EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER)

如果使用系列,结果 EASTING 和 NORTHING 将具有相同的形状。

>>> utm.from_latlon(np.array([51.2, 49.0]), np.array([7.5, 8.4]))

相反

(array([395201.31038113, 456114.59586214]), array([5673135.24118237, 5427629.20426126]), 32, 'U')

,将 UTM 坐标转换为(纬度、经度)元组:

>>> utm.to_latlon(340000, 5710000, 32, 'U')
(51.51852098408468, 6.693872395145327)

使用语法 utm.to_latlon(EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER)。 如果要使用系列,则在这种情况下也是如此。
根据文档,传递一系列函数比对函数进行多个单点调用更快。

There is a library for Python (utm) "Bidirectional UTM-WGS84 converter for python" that can manage single coordinate points or series.

Convert a (latitude, longitude) tuple into an UTM coordinate:

>>> utm.from_latlon(51.2, 7.5)

resulting

(395201.3103811303, 5673135.241182375, 32, 'U')

The return has the form (EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER).

If series are used, in the result EASTING and NORTHING will have the same shape.

>>> utm.from_latlon(np.array([51.2, 49.0]), np.array([7.5, 8.4]))

resulting

(array([395201.31038113, 456114.59586214]), array([5673135.24118237, 5427629.20426126]), 32, 'U')

And for the opposite, convert an UTM coordinate into a (latitude, longitude) tuple:

>>> utm.to_latlon(340000, 5710000, 32, 'U')
(51.51852098408468, 6.693872395145327)

with the syntax utm.to_latlon(EASTING, NORTHING, ZONE_NUMBER, ZONE_LETTER). Same in this case if series are to be used.
According to the documentation is faster to pass a series than multiple one point calls to the function.

绮烟 2024-07-16 12:54:50

您可以使用 Proj4js,如下所示。

使用 链接从 GitHub 下载 Proj4JS。

以下代码将从 UTM 转换为经度纬度

<html>
<head>
  <script src="proj4.js"></script>

  <script>
    var utm = "+proj=utm +zone=32";
    var wgs84 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
    console.log(proj4(utm,wgs84,[539884, 4942158]));
  </script>
</head>
<body>

</body>
</html>

在此代码中,UTM 区域为 32,这应该是显而易见的。 东经是 539884,北经是 4942158。结果是:

[9.502832656648073, 44.631671014204365] 

也就是说 44.631671014204365N,9.502832656648073E。 我有 已验证正确。

如果您需要其他投影,可以在此处找到它们的字符串。

You could use Proj4js, as follows.

Download Proj4JS from GitHub, using this link.

The following code will convert from UTM to longitude latitude

<html>
<head>
  <script src="proj4.js"></script>

  <script>
    var utm = "+proj=utm +zone=32";
    var wgs84 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
    console.log(proj4(utm,wgs84,[539884, 4942158]));
  </script>
</head>
<body>

</body>
</html>

In this code, the UTM zone is 32, as should be obvious. The Easting is 539884, and the Northing is 4942158. The result is:

[9.502832656648073, 44.631671014204365] 

Which is to say 44.631671014204365N, 9.502832656648073E. Which I have verified is correct.

If you need other projections, you can find their strings here.

画中仙 2024-07-16 12:54:50
////////////////////////////////////////////////////////////////////////////////////////////
//
// ToLL - function to compute Latitude and Longitude given UTM Northing and Easting in meters
//
//  Description:
//    This member function converts input north and east coordinates
//    to the corresponding Northing and Easting values relative to the defined
//    UTM zone.  Refer to the reference in this file's header.
//
//  Parameters:
//    north   - (i) Northing (meters)
//    east    - (i) Easting (meters)
//    utmZone - (i) UTM Zone of the North and East parameters
//    lat     - (o) Latitude in degrees 
//    lon     - (o) Longitude in degrees
//
function ToLL(north,east,utmZone)
{ 
  // This is the lambda knot value in the reference
  var LngOrigin = DegToRad(utmZone * 6 - 183)

  // The following set of class constants define characteristics of the
  // ellipsoid, as defined my the WGS84 datum.  These values need to be
  // changed if a different dataum is used.    

  var FalseNorth = 0.  // South or North?
  //if (lat < 0.) FalseNorth = 10000000.  // South or North?
  //else          FalseNorth = 0.   

  var Ecc = 0.081819190842622       // Eccentricity
  var EccSq = Ecc * Ecc
  var Ecc2Sq = EccSq / (1. - EccSq)
  var Ecc2 = Math.sqrt(Ecc2Sq)      // Secondary eccentricity
  var E1 = ( 1 - Math.sqrt(1-EccSq) ) / ( 1 + Math.sqrt(1-EccSq) )
  var E12 = E1 * E1
  var E13 = E12 * E1
  var E14 = E13 * E1

  var SemiMajor = 6378137.0         // Ellipsoidal semi-major axis (Meters)
  var FalseEast = 500000.0          // UTM East bias (Meters)
  var ScaleFactor = 0.9996          // Scale at natural origin

  // Calculate the Cassini projection parameters

  var M1 = (north - FalseNorth) / ScaleFactor
  var Mu1 = M1 / ( SemiMajor * (1 - EccSq/4.0 - 3.0*EccSq*EccSq/64.0 -
    5.0*EccSq*EccSq*EccSq/256.0) )

  var Phi1 = Mu1 + (3.0*E1/2.0 - 27.0*E13/32.0) * Math.sin(2.0*Mu1)
    + (21.0*E12/16.0 - 55.0*E14/32.0)           * Math.sin(4.0*Mu1)
    + (151.0*E13/96.0)                          * Math.sin(6.0*Mu1)
    + (1097.0*E14/512.0)                        * Math.sin(8.0*Mu1)

  var sin2phi1 = Math.sin(Phi1) * Math.sin(Phi1)
  var Rho1 = (SemiMajor * (1.0-EccSq) ) / Math.pow(1.0-EccSq*sin2phi1,1.5)
  var Nu1 = SemiMajor / Math.sqrt(1.0-EccSq*sin2phi1)

  // Compute parameters as defined in the POSC specification.  T, C and D

  var T1 = Math.tan(Phi1) * Math.tan(Phi1)
  var T12 = T1 * T1
  var C1 = Ecc2Sq * Math.cos(Phi1) * Math.cos(Phi1)
  var C12 = C1 * C1
  var D  = (east - FalseEast) / (ScaleFactor * Nu1)
  var D2 = D * D
  var D3 = D2 * D
  var D4 = D3 * D
  var D5 = D4 * D
  var D6 = D5 * D

  // Compute the Latitude and Longitude and convert to degrees
  var lat = Phi1 - Nu1*Math.tan(Phi1)/Rho1 *
    ( D2/2.0 - (5.0 + 3.0*T1 + 10.0*C1 - 4.0*C12 - 9.0*Ecc2Sq)*D4/24.0
     + (61.0 + 90.0*T1 + 298.0*C1 + 45.0*T12 - 252.0*Ecc2Sq - 3.0*C12)*D6/720.0 )

  lat = RadToDeg(lat)

  var lon = LngOrigin + 
    ( D - (1.0 + 2.0*T1 + C1)*D3/6.0
      + (5.0 - 2.0*C1 + 28.0*T1 - 3.0*C12 + 8.0*Ecc2Sq + 24.0*T12)*D5/120.0) / Math.cos(Phi1)

  lon = RadToDeg(lon)

  // Create a object to store the calculated Latitude and Longitude values
  var sendLatLon = new PC_LatLon(lat,lon)

  // Returns a PC_LatLon object
  return sendLatLon
}

////////////////////////////////////////////////////////////////////////////////////////////
//
//  RadToDeg - function that inputs a value in radians and returns a value in degrees
//
function RadToDeg(value)
{
  return ( value * 180.0 / Math.PI )
}

////////////////////////////////////////////////////////////////////////////////////////////
//
// PC_LatLon - this psuedo class is used to store lat/lon values computed by the ToLL 
//  function.
//
function PC_LatLon(inLat,inLon)
{
  this.lat       = inLat     // Store Latitude in decimal degrees
  this.lon       = inLon     // Store Longitude in decimal degrees
}
////////////////////////////////////////////////////////////////////////////////////////////
//
// ToLL - function to compute Latitude and Longitude given UTM Northing and Easting in meters
//
//  Description:
//    This member function converts input north and east coordinates
//    to the corresponding Northing and Easting values relative to the defined
//    UTM zone.  Refer to the reference in this file's header.
//
//  Parameters:
//    north   - (i) Northing (meters)
//    east    - (i) Easting (meters)
//    utmZone - (i) UTM Zone of the North and East parameters
//    lat     - (o) Latitude in degrees 
//    lon     - (o) Longitude in degrees
//
function ToLL(north,east,utmZone)
{ 
  // This is the lambda knot value in the reference
  var LngOrigin = DegToRad(utmZone * 6 - 183)

  // The following set of class constants define characteristics of the
  // ellipsoid, as defined my the WGS84 datum.  These values need to be
  // changed if a different dataum is used.    

  var FalseNorth = 0.  // South or North?
  //if (lat < 0.) FalseNorth = 10000000.  // South or North?
  //else          FalseNorth = 0.   

  var Ecc = 0.081819190842622       // Eccentricity
  var EccSq = Ecc * Ecc
  var Ecc2Sq = EccSq / (1. - EccSq)
  var Ecc2 = Math.sqrt(Ecc2Sq)      // Secondary eccentricity
  var E1 = ( 1 - Math.sqrt(1-EccSq) ) / ( 1 + Math.sqrt(1-EccSq) )
  var E12 = E1 * E1
  var E13 = E12 * E1
  var E14 = E13 * E1

  var SemiMajor = 6378137.0         // Ellipsoidal semi-major axis (Meters)
  var FalseEast = 500000.0          // UTM East bias (Meters)
  var ScaleFactor = 0.9996          // Scale at natural origin

  // Calculate the Cassini projection parameters

  var M1 = (north - FalseNorth) / ScaleFactor
  var Mu1 = M1 / ( SemiMajor * (1 - EccSq/4.0 - 3.0*EccSq*EccSq/64.0 -
    5.0*EccSq*EccSq*EccSq/256.0) )

  var Phi1 = Mu1 + (3.0*E1/2.0 - 27.0*E13/32.0) * Math.sin(2.0*Mu1)
    + (21.0*E12/16.0 - 55.0*E14/32.0)           * Math.sin(4.0*Mu1)
    + (151.0*E13/96.0)                          * Math.sin(6.0*Mu1)
    + (1097.0*E14/512.0)                        * Math.sin(8.0*Mu1)

  var sin2phi1 = Math.sin(Phi1) * Math.sin(Phi1)
  var Rho1 = (SemiMajor * (1.0-EccSq) ) / Math.pow(1.0-EccSq*sin2phi1,1.5)
  var Nu1 = SemiMajor / Math.sqrt(1.0-EccSq*sin2phi1)

  // Compute parameters as defined in the POSC specification.  T, C and D

  var T1 = Math.tan(Phi1) * Math.tan(Phi1)
  var T12 = T1 * T1
  var C1 = Ecc2Sq * Math.cos(Phi1) * Math.cos(Phi1)
  var C12 = C1 * C1
  var D  = (east - FalseEast) / (ScaleFactor * Nu1)
  var D2 = D * D
  var D3 = D2 * D
  var D4 = D3 * D
  var D5 = D4 * D
  var D6 = D5 * D

  // Compute the Latitude and Longitude and convert to degrees
  var lat = Phi1 - Nu1*Math.tan(Phi1)/Rho1 *
    ( D2/2.0 - (5.0 + 3.0*T1 + 10.0*C1 - 4.0*C12 - 9.0*Ecc2Sq)*D4/24.0
     + (61.0 + 90.0*T1 + 298.0*C1 + 45.0*T12 - 252.0*Ecc2Sq - 3.0*C12)*D6/720.0 )

  lat = RadToDeg(lat)

  var lon = LngOrigin + 
    ( D - (1.0 + 2.0*T1 + C1)*D3/6.0
      + (5.0 - 2.0*C1 + 28.0*T1 - 3.0*C12 + 8.0*Ecc2Sq + 24.0*T12)*D5/120.0) / Math.cos(Phi1)

  lon = RadToDeg(lon)

  // Create a object to store the calculated Latitude and Longitude values
  var sendLatLon = new PC_LatLon(lat,lon)

  // Returns a PC_LatLon object
  return sendLatLon
}

////////////////////////////////////////////////////////////////////////////////////////////
//
//  RadToDeg - function that inputs a value in radians and returns a value in degrees
//
function RadToDeg(value)
{
  return ( value * 180.0 / Math.PI )
}

////////////////////////////////////////////////////////////////////////////////////////////
//
// PC_LatLon - this psuedo class is used to store lat/lon values computed by the ToLL 
//  function.
//
function PC_LatLon(inLat,inLon)
{
  this.lat       = inLat     // Store Latitude in decimal degrees
  this.lon       = inLon     // Store Longitude in decimal degrees
}
仙气飘飘 2024-07-16 12:54:50

我在使用 proj4js 时遇到的一个问题是它需要精确的区域,正如 @Richard 指出的那样。 我在这里找到了一个很棒的资源,它可以将WGS转换为UTM并写道JavaScript 中更简洁的包装器:

https://github.com/urbanetic/utm-converter

One problem I had with using proj4js was that it needed the exact zone as @Richard points out. I found a great resource here which can convert WGS to UTM and wrote a cleaner wrapper in JavaScript:

https://github.com/urbanetic/utm-converter

南冥有猫 2024-07-16 12:54:50

通过 CPAN 有一个名为 Geography::NationalGrid 的 Perl 模块,它可以将东向/北向转换为纬度/经度。 这可能有帮助。

另外,可移动类型网站上有很多脚本让您可以转换纬度/经度和东距/北距。

There is a perl module via CPAN called Geography::NationalGrid which can convert easting/northing to lat/longs. That may help.

Alternatively there are lots of scripts on the movable-type site that let you convert lat/long and easting/northings.

辞别 2024-07-16 12:54:50

Staale 的答案对我有用,做了一些小小的修改 -
数学模块无法处理 Pandas Series,因此我用 numpy 替换了所有数学函数。

然而,在 QGIS 中检查,我发现 UTM 和 LAT/LON 坐标之间有大约 4m 的差异。

代码如下:

import numpy as np

def utmToLatLng(zone, easting, northing, northernHemisphere=True):
    if not northernHemisphere:
        northing = 10000000 - northing

a = 6378137
e = 0.081819191
e1sq = 0.006739497
k0 = 0.9996

arc = northing / k0
mu = arc / (a * (1 - np.power(e, 2) / 4.0 - 3 * np.power(e, 4) / 64.0 - 5 * np.power(e, 6) / 256.0))

ei = (1 - np.power((1 - e * e), (1 / 2.0))) / (1 + np.power((1 - e * e), (1 / 2.0)))

ca = 3 * ei / 2 - 27 * np.power(ei, 3) / 32.0

cb = 21 * np.power(ei, 2) / 16 - 55 * np.power(ei, 4) / 32
cc = 151 * np.power(ei, 3) / 96
cd = 1097 * np.power(ei, 4) / 512
phi1 = mu + ca * np.sin(2 * mu) + cb * np.sin(4 * mu) + cc * np.sin(6 * mu) + cd * np.sin(8 * mu)

n0 = a / np.power((1 - np.power((e * np.sin(phi1)), 2)), (1 / 2.0))

r0 = a * (1 - e * e) / np.power((1 - np.power((e * np.sin(phi1)), 2)), (3 / 2.0))
fact1 = n0 * np.tan(phi1) / r0

_a1 = 500000 - easting
dd0 = _a1 / (n0 * k0)
fact2 = dd0 * dd0 / 2

t0 = np.power(np.tan(phi1), 2)
Q0 = e1sq * np.power(np.cos(phi1), 2)
fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * np.power(dd0, 4) / 24

fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * np.power(dd0, 6) / 720

lof1 = _a1 / (n0 * k0)
lof2 = (1 + 2 * t0 + Q0) * np.power(dd0, 3) / 6.0
lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * np.power(Q0, 2) + 8 * e1sq + 24 * np.power(t0, 2)) * np.power(dd0, 5) / 120
_a2 = (lof1 - lof2 + lof3) / np.cos(phi1)
_a3 = _a2 * 180 / np.pi

latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / np.pi

if not northernHemisphere:
    latitude = -latitude

longitude = ((zone > 0) and (6 * zone - 183.0) or 3.0) - _a3

return (latitude, longitude)

这样我就可以直接这样做:

df['LAT'], df['LON']=utmToLatLng(31, df['X'], df['Y'], northernHemisphere=True)

The answer by Staale worked for me with a small modification -
The math module cannot handle Pandas Series, so I replaced all math functions with numpy.

However, checking in QGIS, I see about 4m difference between the UTM and LAT/LON coordinates.

Code below:

import numpy as np

def utmToLatLng(zone, easting, northing, northernHemisphere=True):
    if not northernHemisphere:
        northing = 10000000 - northing

a = 6378137
e = 0.081819191
e1sq = 0.006739497
k0 = 0.9996

arc = northing / k0
mu = arc / (a * (1 - np.power(e, 2) / 4.0 - 3 * np.power(e, 4) / 64.0 - 5 * np.power(e, 6) / 256.0))

ei = (1 - np.power((1 - e * e), (1 / 2.0))) / (1 + np.power((1 - e * e), (1 / 2.0)))

ca = 3 * ei / 2 - 27 * np.power(ei, 3) / 32.0

cb = 21 * np.power(ei, 2) / 16 - 55 * np.power(ei, 4) / 32
cc = 151 * np.power(ei, 3) / 96
cd = 1097 * np.power(ei, 4) / 512
phi1 = mu + ca * np.sin(2 * mu) + cb * np.sin(4 * mu) + cc * np.sin(6 * mu) + cd * np.sin(8 * mu)

n0 = a / np.power((1 - np.power((e * np.sin(phi1)), 2)), (1 / 2.0))

r0 = a * (1 - e * e) / np.power((1 - np.power((e * np.sin(phi1)), 2)), (3 / 2.0))
fact1 = n0 * np.tan(phi1) / r0

_a1 = 500000 - easting
dd0 = _a1 / (n0 * k0)
fact2 = dd0 * dd0 / 2

t0 = np.power(np.tan(phi1), 2)
Q0 = e1sq * np.power(np.cos(phi1), 2)
fact3 = (5 + 3 * t0 + 10 * Q0 - 4 * Q0 * Q0 - 9 * e1sq) * np.power(dd0, 4) / 24

fact4 = (61 + 90 * t0 + 298 * Q0 + 45 * t0 * t0 - 252 * e1sq - 3 * Q0 * Q0) * np.power(dd0, 6) / 720

lof1 = _a1 / (n0 * k0)
lof2 = (1 + 2 * t0 + Q0) * np.power(dd0, 3) / 6.0
lof3 = (5 - 2 * Q0 + 28 * t0 - 3 * np.power(Q0, 2) + 8 * e1sq + 24 * np.power(t0, 2)) * np.power(dd0, 5) / 120
_a2 = (lof1 - lof2 + lof3) / np.cos(phi1)
_a3 = _a2 * 180 / np.pi

latitude = 180 * (phi1 - fact1 * (fact2 + fact3 + fact4)) / np.pi

if not northernHemisphere:
    latitude = -latitude

longitude = ((zone > 0) and (6 * zone - 183.0) or 3.0) - _a3

return (latitude, longitude)

That way I can do this directly:

df['LAT'], df['LON']=utmToLatLng(31, df['X'], df['Y'], northernHemisphere=True)
千鲤 2024-07-16 12:54:50

将 @TreyA 转换为 kotlin(java 库中的一些数学函数),只是为了它的情况。 似乎比@Staale 和@sandino 更准确一些


fun utmToLatLng2(
    north:Double?,
    east:Double?,
    zone:Long,
    northernHemisphere: Boolean
):LatLng?{

    if((north==null)||(east == null)) return null

    val lngOrigin = Math.toRadians(zone*6.0 - 183.0)
    val falseNorth = if(northernHemisphere) 0.toDouble() else 10000000.toDouble()

    val ecc = 0.081819190842622
    val eccSq = ecc*ecc
    val ecc2Sq = eccSq / (1.0 - eccSq)
    //var ecc2 = sqrt(ecc2Sq) //not in use ?
    val e1 = (1.0 - sqrt(1.0-eccSq))/(1.0 + sqrt(1-eccSq))
    val e12 = e1*e1
    val e13 = e12*e1
    val e14 = e13*e1

    val semiMajor = 6378137.0
    val falseEast = 500000.0
    val scaleFactor = 0.9996

    //Cassini

    val m1 = (north - falseNorth) / scaleFactor
    val mu1 = m1 / (semiMajor * (1.0 - eccSq/4.0 - 3.0*eccSq*eccSq/64.0 - 5.0*eccSq*eccSq*eccSq/256.0))

    val phi1 = mu1 +
            (3.0 * e1 / 2.0 - 27.0 * e13 / 32.0) * sin(2.0 * mu1) +
            (21.0 * e12 / 16.0 - 55.0 * e14 / 32.0) * sin(4.0 * mu1) +
            (151.0 * e13 / 96.0) * sin(6.0 * mu1) +
            (1097.0 * e14 / 512.0) * sin( 8.0 * mu1)

    val sin2phi1 = sin(phi1) * sin(phi1)
    val rho1 = (semiMajor * (1.0-eccSq)) / (1.0 - eccSq * sin2phi1).pow(1.5)
    val nu1 = semiMajor / sqrt(1.0-eccSq*sin2phi1)

    //POSC

    val t1 = tan(phi1)*tan(phi1)
    val t12 = t1*t1
    val c1 = ecc2Sq*cos(phi1)*cos(phi1)
    val c12 = c1*c1
    val d = (east - falseEast) / (scaleFactor*nu1)
    val d2 = d*d
    val d3 = d2*d
    val d4 = d3*d
    val d5 = d4*d
    val d6 = d5*d

    //Compute lat & lon convert to degree

    var lat =
        phi1 - nu1 * tan(phi1)/rho1 *
                (d2/2.0 - (5.0 + 3.0*t1 + 10*c1 - 4.0*c12 -9.0*ecc2Sq) * d4/24.0 +
                        (61.0 + 90.0*t1 +298.0*c1 + 45.0*t12 -252*ecc2Sq - 3.0*c12) * d6/720.0)

    lat = Math.toDegrees(lat)

    var lon =
        lngOrigin +
                (d - (1.0 + 2.0*t1 + c1)*d3/6.0 +
                        (5.0 - 2.0*c1 + 28.0*t1 - 3.0*c12 + 8.0*ecc2Sq + 24.0*t12)*d5/120.0) / cos(phi1)

    lon = Math.toDegrees(lon)

    return LatLng(lat,lon)


}



Converted @TreyA to kotlin (some Math functions in java libraries), just for the case of it. Seems to be a bit more accurate than @Staale and @sandino


fun utmToLatLng2(
    north:Double?,
    east:Double?,
    zone:Long,
    northernHemisphere: Boolean
):LatLng?{

    if((north==null)||(east == null)) return null

    val lngOrigin = Math.toRadians(zone*6.0 - 183.0)
    val falseNorth = if(northernHemisphere) 0.toDouble() else 10000000.toDouble()

    val ecc = 0.081819190842622
    val eccSq = ecc*ecc
    val ecc2Sq = eccSq / (1.0 - eccSq)
    //var ecc2 = sqrt(ecc2Sq) //not in use ?
    val e1 = (1.0 - sqrt(1.0-eccSq))/(1.0 + sqrt(1-eccSq))
    val e12 = e1*e1
    val e13 = e12*e1
    val e14 = e13*e1

    val semiMajor = 6378137.0
    val falseEast = 500000.0
    val scaleFactor = 0.9996

    //Cassini

    val m1 = (north - falseNorth) / scaleFactor
    val mu1 = m1 / (semiMajor * (1.0 - eccSq/4.0 - 3.0*eccSq*eccSq/64.0 - 5.0*eccSq*eccSq*eccSq/256.0))

    val phi1 = mu1 +
            (3.0 * e1 / 2.0 - 27.0 * e13 / 32.0) * sin(2.0 * mu1) +
            (21.0 * e12 / 16.0 - 55.0 * e14 / 32.0) * sin(4.0 * mu1) +
            (151.0 * e13 / 96.0) * sin(6.0 * mu1) +
            (1097.0 * e14 / 512.0) * sin( 8.0 * mu1)

    val sin2phi1 = sin(phi1) * sin(phi1)
    val rho1 = (semiMajor * (1.0-eccSq)) / (1.0 - eccSq * sin2phi1).pow(1.5)
    val nu1 = semiMajor / sqrt(1.0-eccSq*sin2phi1)

    //POSC

    val t1 = tan(phi1)*tan(phi1)
    val t12 = t1*t1
    val c1 = ecc2Sq*cos(phi1)*cos(phi1)
    val c12 = c1*c1
    val d = (east - falseEast) / (scaleFactor*nu1)
    val d2 = d*d
    val d3 = d2*d
    val d4 = d3*d
    val d5 = d4*d
    val d6 = d5*d

    //Compute lat & lon convert to degree

    var lat =
        phi1 - nu1 * tan(phi1)/rho1 *
                (d2/2.0 - (5.0 + 3.0*t1 + 10*c1 - 4.0*c12 -9.0*ecc2Sq) * d4/24.0 +
                        (61.0 + 90.0*t1 +298.0*c1 + 45.0*t12 -252*ecc2Sq - 3.0*c12) * d6/720.0)

    lat = Math.toDegrees(lat)

    var lon =
        lngOrigin +
                (d - (1.0 + 2.0*t1 + c1)*d3/6.0 +
                        (5.0 - 2.0*c1 + 28.0*t1 - 3.0*c12 + 8.0*ecc2Sq + 24.0*t12)*d5/120.0) / cos(phi1)

    lon = Math.toDegrees(lon)

    return LatLng(lat,lon)


}



无畏 2024-07-16 12:54:50

Python中,您还可以使用pyproj< /a> 包。 找到您的 UTM 的 EPSG 代码(例如,此处)。 然后:

lat-lonUTM

from pyproj import Transformer, CRS
crs = CRS.from_epsg(25833)  # put your desired EPSG code here
latlon2utm = Transformer.from_crs(crs.geodetic_crs, crs)
lats = [58.969, 59.911]  # latitudes of two Norwegian cities
lons = [5.732, 10.750]  # longitudes of two Norwegian cities
eastings, northings = latlon2utm.transform(lats, lons)

UTMlat-lon

utm2latlon = Transformer.from_crs(crs, crs.geodetic_crs)
latitudes, longitudes = utm2latlon.transform(eastings, northings)

In Python, you can also use the pyproj package. Find the EPSG code of your UTM (e.g., here). Then:

From lat-lon to UTM:

from pyproj import Transformer, CRS
crs = CRS.from_epsg(25833)  # put your desired EPSG code here
latlon2utm = Transformer.from_crs(crs.geodetic_crs, crs)
lats = [58.969, 59.911]  # latitudes of two Norwegian cities
lons = [5.732, 10.750]  # longitudes of two Norwegian cities
eastings, northings = latlon2utm.transform(lats, lons)

From UTM to lat-lon:

utm2latlon = Transformer.from_crs(crs, crs.geodetic_crs)
latitudes, longitudes = utm2latlon.transform(eastings, northings)
半步萧音过轻尘 2024-07-16 12:54:50

除了utm包之外,还有sentinelhub值得考虑。 它们给出的结果略有不同,但它们比其他贡献者提供的 func utmToLatLng 更接近预期坐标。 Sentinelhub 包有更好的文档记录(可能也维护得更好),并且具有许多其他有用的几何函数。

import utm
from sentinelhub import CRS
from sentinelhub.geo_utils import transform_point

easting = 300000
northing = 5900040
utm_zone = '31N'
zone = 31

# Using utmToLatLng:
lat, lon = utmToLatLng(zone, easting, northing, northernHemisphere=True)
# lat = 0.0047609197376834445
# lon = 53.21191417905066 (note this result is very different from the ones below)

# Using utm:
lon, lat = utm.to_latlon(easting, northing, zone, 'N')
# lat = 0.004760919759893956
# lon = 53.21197788941637

# Using sentinelhub:
lon, lat = transform_point((easting, northing), CRS.UTM_31N, CRS.WGS84)
# lat = 0.004760925082036568
# lon = 53.21197782614651

In addition to the utm package, there is also the sentinelhub worth considering. They give slightly different results, but they are closer to the expected coordinates than the func utmToLatLng provided by another contributor. The sentinelhub package is better documented (probably better maintained too), and has a number of other useful geometric functions.

import utm
from sentinelhub import CRS
from sentinelhub.geo_utils import transform_point

easting = 300000
northing = 5900040
utm_zone = '31N'
zone = 31

# Using utmToLatLng:
lat, lon = utmToLatLng(zone, easting, northing, northernHemisphere=True)
# lat = 0.0047609197376834445
# lon = 53.21191417905066 (note this result is very different from the ones below)

# Using utm:
lon, lat = utm.to_latlon(easting, northing, zone, 'N')
# lat = 0.004760919759893956
# lon = 53.21197788941637

# Using sentinelhub:
lon, lat = transform_point((easting, northing), CRS.UTM_31N, CRS.WGS84)
# lat = 0.004760925082036568
# lon = 53.21197782614651
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文