def map1(request): global data if (request.method == "POST"): options = _ReadOptions(request) data = indices(options) return JsonResponse(data)
def calcdata(request): global data, palettedecide if (request.method == "POST"): options = _ReadOptions(request) print(options) if options["dataset"] == 'NDVI': palettedecide = 'NDVI' elif options["dataset"] == 'EVI': palettedecide = 'EVI' elif options["dataset"] == 'NDWI': palettedecide = 'NDWI' palete = palletedata(palettedecide, None) data = _Getcollection(options, palete) return JsonResponse(data)
def chart_data(request): try: global data, palettedecide if (request.method == "POST"): options = _ReadOptions(request) if options["dataset"] == 'NDVI': palettedecide = 'NDVI' elif options["dataset"] == 'EVI': palettedecide = 'EVI' elif options["dataset"] == 'NDWI': palettedecide = 'NDWI' palete = palletedata(palettedecide, None) data = chart_it(options, palete) except ee.EEException as e: data = {'error': 'Failed to Compute Data . Error Stated::, ' + str(e)} return JsonResponse(data)