#written by qzx
import transbigdata as tbd
import matplotlib.pyplot as plt
def tr2grid(
bounds= [113.6, 22.4, 114.8, 22.9],
gps_data = [(113.6, 22.4),(114.8, 22.9)]):
grid,params =tbd.area_to_grid(bounds, accuracy=5000) #grid:经纬度的col和geometry,params:划分设置
grid_data = [tbd.GPS_to_grid(lon, lat, params) for lon, lat in gps_data]
# for i, (lon, lat) in enumerate(gps_data):
# print(f"GPS坐标: ({lon}, {lat}) 转换为网格坐标: {grid_data[i]}")
return grid_data
【GIS】经纬度坐标转网格坐标
于 2024-04-12 01:07:21 首次发布