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))
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']))
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'])
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)
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) })