python地图热力图随机经纬度格式生成器,配合地图热力图程序“食用”更佳哦~
import re
import random
for a in range(0,10):
lat = str(random.randint(25,40))
lng = str(random.randint(90,120))
count = str(random.randint(1,100))
print('{"count": %s, "lat": %s, "lng":%s},' %(count,lat,lng))
运行结果:
{"count": 19, "lat": 28, "lng":104},
{"count": 77, "lat": 37, "lng":95},
{"count": 3, "lat": 25, "lng":107},
{"count": 1, "lat": 33, "lng":91},
{"count": 16, "lat": 36, "lng":119},
{"count": 73, "lat": 32, "lng":119},
{"count": 1, "lat": 30, "lng":117},
{"count": 96, "lat": 34, "lng":117},
{"count": 51, "lat": 27, "lng":117},
{"count": 16, "lat": 31, "lng":97},