Пример #1
0
def deforestation_service(coords, begin, end, viewer=False):
    res = deforestation.grab(coords, begin, end)
    poly = utils.to_poly(coords, viewer=viewer)
    return dict(
        begin=begin,
        end=end,
        poly=poly,
        area=res
    )
Пример #2
0
def vegetation_service(coords, begin, end, viewer=False):
    res = vegetation.grab(coords, begin, end)
    poly = utils.to_poly(coords, viewer=viewer)
    return dict(
        count=len(res),
        results=res,
        poly=poly,
        begin=begin,
        end=end
    )
Пример #3
0
def water_service(coords, date, viewer=False):
    poly = utils.to_poly(coords, viewer=viewer)
    year = int(date.split("-")[0])
    res = water.surface_water(poly['geometry']['coordinates'], year)

    return dict(
        area=res['area'],
        result=res['geom'],
        date=date,
        poly=poly
    )
Пример #4
0
def water_series_service(coords, begin, end, viewer=False):
    poly = utils.to_poly(coords, viewer=viewer)
    res = water.water_series(poly['geometry']['coordinates'], begin, end)

    return dict(
        count=len(res),
        result=res,
        begin=begin,
        end=end,
        poly=poly
    )
Пример #5
0
def water_service(coords, date, viewer=False):
    poly = utils.to_poly(coords, viewer=viewer)
    year = int(date.split("-")[0])
    res = water.surface_water(poly['geometry']['coordinates'], year)

    return dict(area=res['area'], result=res['geom'], date=date, poly=poly)
Пример #6
0
def water_series_service(coords, begin, end, viewer=False):
    poly = utils.to_poly(coords, viewer=viewer)
    res = water.water_series(poly['geometry']['coordinates'], begin, end)

    return dict(count=len(res), result=res, begin=begin, end=end, poly=poly)