移动后获得点的纬度和经度

发布于 2025-01-27 08:03:51 字数 1531 浏览 1 评论 0原文

我有一些纬度和经度的点(x,y),我想知道一个新点(b)的纬度和经度,这是A后用角度向右移动75公里后的点A(与赤道)。 请任何人都有一个主意,我会感谢它。

A(x,y)-------------- 75公里----------------> b(x',y')

from math import sqrt,atan,pi
import folium
import pyproj


geod = pyproj.Geod(ellps='WGS84')

width = 75000. # m
height = 75000. # m
rect_diag = sqrt( width**2 + height**2 )

center_lon = -0.5493
center_lat = 35.7108

azimuth1 = atan(width/height)
azimuth2 = atan(-width/height)
azimuth3 = atan(width/height)+pi # first point + 180 degrees
azimuth4 = atan(-width/height)+pi # second point + 180 degrees

pt1_lon, pt1_lat, _ = geod.fwd(center_lon, center_lat, azimuth1*180/pi, rect_diag)
pt2_lon, pt2_lat, _ = geod.fwd(center_lon, center_lat, azimuth2*180/pi, rect_diag)
pt3_lon, pt3_lat, _ = geod.fwd(center_lon, center_lat, azimuth3*180/pi, rect_diag)
pt4_lon, pt4_lat, _ = geod.fwd(center_lon, center_lat, azimuth4*180/pi, rect_diag)

wkt_point = 'POINT (%.6f %.6f)' % (center_lon, center_lat)
wkt_poly = 'POLYGON (( %.6f %.6f, %.6f %.6f, %.6f %.6f, %.6f %.6f, %.6f %.6f ))' % (pt1_lon, pt1_lat, pt2_lon, pt2_lat, pt3_lon, pt3_lat, pt4_lon, pt4_lat, pt1_lon, pt1_lat)

print(wkt_point)
print(wkt_poly)

m = folium.Map(location = (35.697070, -0.630799), tiles="Stamen Terrain", zoom_start=6)
folium.Marker(
    [35.697070, -0.630799], popup="<i>Mt. Hood Meadows</i>", tooltip='oran'
).add_to(m)
folium.Rectangle([(pt1_lat, pt1_lon), (pt3_lat, pt3_lon)], weight=2, color="red").add_to(m)

m.save('sat.html')

I have some point A with latitude and longitude (x, y) and i want to know the latitude and longitude of a new point (B) which is the point A after moving it 75km to the right with an angle theta (compared with the equator).
Please anyone has an idea i'll appreciate it.

A(x, y) ------------75km---------> B(x', y')

from math import sqrt,atan,pi
import folium
import pyproj


geod = pyproj.Geod(ellps='WGS84')

width = 75000. # m
height = 75000. # m
rect_diag = sqrt( width**2 + height**2 )

center_lon = -0.5493
center_lat = 35.7108

azimuth1 = atan(width/height)
azimuth2 = atan(-width/height)
azimuth3 = atan(width/height)+pi # first point + 180 degrees
azimuth4 = atan(-width/height)+pi # second point + 180 degrees

pt1_lon, pt1_lat, _ = geod.fwd(center_lon, center_lat, azimuth1*180/pi, rect_diag)
pt2_lon, pt2_lat, _ = geod.fwd(center_lon, center_lat, azimuth2*180/pi, rect_diag)
pt3_lon, pt3_lat, _ = geod.fwd(center_lon, center_lat, azimuth3*180/pi, rect_diag)
pt4_lon, pt4_lat, _ = geod.fwd(center_lon, center_lat, azimuth4*180/pi, rect_diag)

wkt_point = 'POINT (%.6f %.6f)' % (center_lon, center_lat)
wkt_poly = 'POLYGON (( %.6f %.6f, %.6f %.6f, %.6f %.6f, %.6f %.6f, %.6f %.6f ))' % (pt1_lon, pt1_lat, pt2_lon, pt2_lat, pt3_lon, pt3_lat, pt4_lon, pt4_lat, pt1_lon, pt1_lat)

print(wkt_point)
print(wkt_poly)

m = folium.Map(location = (35.697070, -0.630799), tiles="Stamen Terrain", zoom_start=6)
folium.Marker(
    [35.697070, -0.630799], popup="<i>Mt. Hood Meadows</i>", tooltip='oran'
).add_to(m)
folium.Rectangle([(pt1_lat, pt1_lon), (pt3_lat, pt3_lon)], weight=2, color="red").add_to(m)

m.save('sat.html')

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文