This commit is contained in:
自由的飞翔 2019-01-02 20:58:35 +08:00
parent 95ab970f8a
commit 3b1b64bcff
1 changed files with 8 additions and 1 deletions

View File

@ -175,7 +175,7 @@ def calc_spi_diaster(request):
# spi_disaster = get_disaster_gdf(spi_gdf, spi_type)
# if county == "1":
# spi_disaster = intersection_xzqh(spi_disaster)
res_county = agg_raster_by_raster(get_type_path_4326(type), type=get_calc_type(type))
res_county = agg_all_raster() # agg_raster_by_raster(get_type_path_4326(type), type=get_calc_type(type))
print(res_county)
# res_spi = agg_raster_by_gdf_value(get_type_path(type), spi_disaster)
res = {}
@ -183,6 +183,13 @@ def calc_spi_diaster(request):
res['agg'] = json.dumps(str(res_county))
return JsonResponse(res, safe=False)
def agg_all_raster():
type_list = ['cotton', 'cron', 'wheat', 'population', 'gdp']
res = {}
for type in type_list:
res_type = agg_raster_by_raster(get_type_path_4326(type), type=get_calc_type(type))
res[type] = res_type
return res
def handle_uploaded_file(f):
from django.conf import settings