300 likes | 425 Views
Risiko : Python, GDAL, GeoNode for the Estimation of Impact from Natural Hazards. Presenter: Ariel Núñez , GFDRR Labs, The World Bank. Where? Indonesia. Located among major tectonic plates boundaries. Biggest volcanoes and earthquakes in the world. Earthquakes cause Tsunamis.
E N D
Risiko: Python, GDAL, GeoNode for the Estimation of Impact from Natural Hazards Presenter: Ariel Núñez, GFDRR Labs, The World Bank
Where? Indonesia • Located among major tectonic plates boundaries. • Biggest volcanoes and earthquakes in the world. • Earthquakes cause Tsunamis.
Who? BNPB • Disaster Management Agency • AusAID (acting as AIFDR) • The World Bank (GFDRR Labs)
What? Risiko: Risk in a Box • We decided to change the name • Nothing to do with Justin Timberlake and a song with a similar name.
What? SAFEScenario Assessment for Emergency • In Indonesia it is actually called: InaSAFE (to help with SEO) • Core: python-safe: Ole Nielsen, PhD • Web: geonode-safe: Ariel Núñez • Desktop: qgis-safe: Tim Sutton
How? • Easy to use • Allow results to be reproduced • Ensure consistency across different locations and scenarios • Platform for near real time impact estimates • Free and Open Source (GPL v3)
Building Survey Sept 30th,2009 GeoScience Australia / ITB
Pictures or it didn’t happen. Source code
Type of analysis • Things that are usually done in a combination of Excel and ArcGIS. • More about normal distributions and statistics than about ‘point inside polygon’ operations.
Let’s try it out sudo apt-get install python-numpy python-scipy python-nose pip install python-safe python >>> import safe >>> safe.test()
Simple Plugin Architecture class PluginMount(type): def __init__(cls, name, bases, attrs): if not hasattr(cls, 'plugins'): cls.plugins = [] else: cls.plugins.append(cls) class FunctionProvider: __metaclass__ = PluginMount
Sample Impact Function class EmpiricalFatalityFunction(FunctionProvider): """Risk plugin for earthquake damage based on empirical results :param requires category==’hazard' :param requires subcategory==’earthquake’ :param requires unit=‘mmi’ "”” @staticmethod def run(layers, teta=14.05, beta=0.17, zeta=2.15):
Get data def run() : … # Identify input layers intensity = get_hazard_layer(layers) population = get_exposure_layer(layers) # Extract data H = intensity.get_data(nan=0) P = population.get_data(nan=0)
Calculate impact # Calculate impact logHazard = 1 / beta * numpy.log(H / teta) # Convert array to be standard floats expected by cdf arrayout = numpy.array([[float(value) for value in row] for row in logHazard]) x = arrayout * P F = cdf(x)
Creating the output # Create new layer and return R = Raster(F, projection=population.get_projection(), geotransform=population.get_geotransform(), name='Estimated fatalities') return R
To remember: • If you deal with vector and raster data and like Python and GDAL, help us develop python-safe.http://github.com/AIFDR/python-safe • If you need a data storage for your scripts that deal with GIS, try GeoNode/GeoServer.http://geonode.org
Thanks! • @ingenieroariel • anunezgomez@worldbank.org • http://github.com/AIFDR/python-safe