交通-城市规划专业常用——10分钟步行圈(百度API)

// 前台




步行路线规划





# 后台
# Create your views here.
from django.shortcuts import render
from django.http import HttpResponse

def yq(request):
	import csv
	reader = open('./y/XQ20200208.csv','r')
	lists = []
	for text in reader:
		text = text.split(",")
		lon = text[4]
		lat = text[5]
		lists.append([lon,lat])
	return render(request, 'index.html', {"lists":lists} )

import csv
def write(request):
    if request.GET:
        A = request.GET['elon']
        B = request.GET['elat']
        C =request.GET['etime']
        dirr=[str(A)+","+str(B),C]
        out = open('../gj.csv','a', newline='')
        if float(C)<= float(10):
            csv_write = csv.writer(out, dialect='excel')
            csv_write.writerow(dirr)
        else:
            pass
        return HttpResponse("Success")
    else:
        return HttpResponse("Unsuccess")

 

你可能感兴趣的:(城市交通)