移动后获得点的纬度和经度
我有一些纬度和经度的点(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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论