Skip to content

Emelieh21/catastrofix-nasa-space-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CatastroFix

By Team Space Cake

A project by Emelie Hofland and Jaime González-Arintero for the NASA Space Apps Challenge 2019 in Berlin, on October 18-20, 2019.

Introduction

"Smashing SDGs by automatically matching places that need help with people that can help."

CatastroFix finds remote human settlements with high risk of natural disasters by means of NASA satellite data. Then, it looks for partners that could help local communities to become more resilient to such risks. Finally, it generates proposals aligned with the targets of the Sustainable Development Goals.

The video pitch is available in YouTube. Just click on the picture below.

CatastroFix by Team Space Cake

Live demo

A live demo of the application, hosted in Google Cloud, is available here.

Solution Architecture

Data sets

NOTE: Some of the following data sets have been converted from ESRI ASCII raster format to shapefiles. A detailed explanation of the conversion procedure can be found in the next section.

Global earthquake mortality risks and distribution

Global drought mortality risks and distribution

Global flood mortality risks and distribution

Global landslide mortality risks and distribution

Global cyclone mortality risks and distribution

Subnational human development index

Global rural-urban mapping (human settlements)

Database of universities and technical institutes

A minimal database has been created so the application can match the areas at risk with the potential help sources. Such database has been compiled as a .csv file, and includes some universities and institutes of technology from all over the world. Although the names, addresses and specialities are real, the contact persons and their titles are fictional (for privacy reasons).

The columns drought, flood, hunger.medical and natural.disasters indicate if each institution could effectively provide assistance in those emergency situations. For example, a TRUE in hunger.medical would mean that the institution in particular can support population suffering from hunger and/or in need of medical assistance. However, a FALSE in flood would mean that the institution doesn't count with enough resources or the right speciality to support flooded areas.

ESRI ASCII raster to shapefile conversion

ATTENTION: Although all commands work, this section is a work in progress and still needs to be reviewed.

Installation and configuration

The tool gdal is required for the format conversion, available via Anaconda or Miniconda.

  1. To get started, download the Miniconda install script.

  2. Install Miniconda running the provided script:

     sh Miniconda3-latest-MacOSX-x86_64.sh
    
  3. Close terminal, and open a new one, so the new aliases are available.

  4. Install gdal using the conda package manager:

     conda install -c conda-forge gdal
    
  5. Create a conda environment; in this case it's named "CONVERSION":

     conda create --yes --channel conda-forge --name CONVERSION gdal
    
  6. Activate it:

     conda activate CONVERSION
    
  7. Finally, gdal can be imported in Python:

     python -c 'import gdal;print(dir(gdal))'
    

Conversion

Files can now be converted innvoking gdal from the conda environment, by means of the gdal_polygonize.py tool:

gdal_polygonize.py -f "ESRI Shapefile" input-esri-ascii.asc output-shapefile.shp

The output shapefiles can now be easily imported in R.

NOTE: Data sets that required pre-processing have already been converted, and their shapefiles can be found in the "data sets" section.

Running the application locally

Installation

  1. First of all, install R from the official source, depending on your operating system:
  1. Once ready, install RStudio, since it will be needed to run the app. Simply choose one of the official installers.

  2. Clone this repository to your machine (or skip this step if it was already done):

     git clone https://github.com/Emelieh21/catastrofix-nasa-space-apps.git
    
  3. Open RStudio, and run the following command on the console window (at the bottom left corner) to install the required packages:

     install.packages(c("shiny","shinydashboard","leaflet","dplyr","geosphere","rgeos","RColorBrewer", "readxl"))
    

    NOTE: This could take a few minutes, as the packages must be compiled for the target system.

Usage

  1. Head to the folder of the tool, where the repository was cloned, (e.g. /Downloads/catastrofix-nasa-space-apps).

  2. Open the file app.R with RStudio.

  3. Click on "Run App" (small green "play" button).

To do

  • Add hunger dataset to the docs.
  • Finish documenting the deployment in Google Cloud.
  • Review the data conversion section.

License

Copyright (C) 2019 Emelie Hofland [email protected], Jaime González-Arintero [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Hackathon project for the NASA Space Apps Hackathon 2019

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published