链接数据库
咯咯咯咯咯。。。。(已出过链接文章)
前期准备导入资料
看图:准备所需的数据
# 自动随机生成坐标
def FrameOfReference(zjy_longitude=None, zjy_latitude=None, radius=None):
radius_in_degrees = radius / 111300
coordinates_u = float(random.uniform(0.0, 1.0))
coordinates_v = float(random.uniform(0.0, 1.0))
coordinates_w = radius_in_degrees * math.sqrt(coordinates_u)
coordinates_t = 2 * math.pi * coordinates_v
coordinates_x = coordinates_w * math.cos(coordinates_t)
coordinates_y = coordinates_w * math.sin(coordinates_t)
longitude = coordinates_y + zjy_longitude
latitude = coordinates_x + zjy_latitude
# 这里是想保留6位小数
precision_data = '%.6f' % longitude
latitude_data =