示例#1
0
def band_info(band_index):
    nodata = request.values.get('nodata', None)
    if nodata:
        nodata = float(nodata)
    return json_response(
        raster.band_info(raster_file=to_file(request.values['path']),
                         band_index=int(band_index),
                         nodata=nodata))
示例#2
0
def _from_dict(layer_dict):
    nodata = layer_dict.get('nodata', None)
    if nodata:
        nodata = float(nodata)
    return RasterLayer(id=layer_dict['id'],
                       file=to_file(layer_dict['path']),
                       nodata=nodata,
                       bands=_Band.from_dict(layer_dict['bands']))
示例#3
0
def _from_dict(shape_dict):
    return ShapeLayer(id=shape_dict['id'],
                      file=to_file(shape_dict['path']),
                      fill_color=shape_dict['fillColor'],
                      stroke_color=shape_dict['strokeColor'],
                      stroke_width=shape_dict['strokeWidth'])
示例#4
0
def save_config(configdb, run_config, filename=None):
    filename = run_config.config_file if not filename else filename
    config.to_file(configdb, run_config, filename)
示例#5
0
def save_config(configdb, run_config, filename=None):
    filename = run_config.config_file if not filename else filename
    config.to_file(configdb, run_config, filename)
示例#6
0
def raster_info():
    raster_file = to_file(request.values['path'])
    return json_response({
        'bandCount': raster.band_count(raster_file),
        'nodata': raster.read_nodata(raster_file)
    })