获取东方和geopy 的北距值

发布于 2024-08-09 14:24:58 字数 447 浏览 2 评论 0原文

我有一个充满十进制格式的经度/纬度对的表(例如,-41.547、23.456)。我想显示 "东距和北距"/ UTM 格式。 geopy是否提供了从十进制转换为UTM的方法?我在代码中看到它会解析 UTM 值,但我不知道如何将它们返回,并且 geopy Google Group 已经走上了所有道路。

I have a table full of longitude/ latitude pairs in decimal format (e.g., -41.547, 23.456). I want to display the values in "Easting and Northing"/ UTM format. Does geopy provide a way to convert from decimal to UTM? I see in the code that it will parse UTM values, but I don't see how to get them back out and the geopy Google Group has gone the way of all things.

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

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

发布评论

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

评论(2

呢古 2024-08-16 14:24:58

没有。您需要重新投影您的点,而 geopy 不会为您做这件事。

您需要的是 libgdal 和一些 Python 绑定。我总是使用 GeoDjango 中的绑定,但还有其他替代方案

编辑:这只是一个数学公式,但并不简单。有数千种不同的方式来表示地球表面。请参阅此处查看庞大但不完整的列表。

地球的地理投影分为两部分 - 坐标系数据。后者本质上是行星的三维模型。当您说要将纬度/经度点转换为 UTM 值时,您就遗漏了一些难题。

我们假设您的纬度/经度点基于 WGS84 基准,因为这是一个非常常见的数据如今纬度/经度点的标准。您想要将这些点转换为 UTM 坐标系。但是到哪个 UTM 坐标系呢?其中有 60 个

Nope. You need to reproject your points, and geopy isn't going to do that for you.

What you need is libgdal and some Python bindings. I always use the bindings in GeoDjango, but there are other alternatives.

EDIT: It is just a mathematical formula, but it's non-trivial. There are thousands of different ways to represent the surface of the Earth. See here for a huge but incomplete list.

There are two parts to a geographic projection of the Earth-- a coordinate system and a datum. The latter is essentially a three-dimensional model of the planet. When you say you want to convert latitude/longitude points to UTM values, you're missing a couple of pieces of the puzzle.

Let's assume that your lat/long points are based on the WGS84 datum, because that's a pretty common standard for lat/long points these days. You want to convert those points to a UTM coordinate system. But to which UTM coordinate system? There are 60 of them.

冷弦 2024-08-16 14:24:58

我想我的事情可能过于复杂了。我想要的只是 dms 值(所以 42.519540,
-70.896716 变为 42°31'10.34" N 70°53'48.18" W)。您可以通过使用经度和纬度创建一个 geopy 点对象,然后调用 format() 来获得这一点。但是,在撰写本文时,format() 已损坏,需要 在这里打补丁

I think I may have over-complicated things. All I wanted was the dms values (so 42.519540,
-70.896716 becomes 42º31'10.34" N 70º53'48.18" W). You can get this by creating a geopy point object with your long and lat, then calling format(). However, as of this writing, format() is broken and requires the patch here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文