GIS243 / lhvpetecon-surface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Proxying Economic Activity with Daytime Satellite Imagery: Filling Data Gaps Across Time and Space


Data and license

Code and data in this repository are published under a Creative Commons Attribution-NonCommercial-NoDerivs licence (https://creativecommons.org/licenses/by-nc-nd/4.0/) license according to the journal publication.
Citation of code and data in this repository:

Lehnert, P., Niederberger, M., Backes-Gellner, U., & Bettinger, E., "Proxying economic activity with daytime satellite imagery: Filling data gaps across time and space", PNAS Nexus, 2(4). https://doi.org/10.1093/pnasnexus/pgad099

Global surface groups data will be available via SWISSUbase (project number 20253, https://www.swissubase.ch/de/catalogue/studies/20253/18714/overview).

About The Project

  • Satellite image classification is done by using the Google Earth Engine Python API in python. The underlying code can be found in the "LandcoverClassification-EarthEngine" folder.
  • Data aggregation for the analyses in our PNAS Nexus publication was conducted with ArcGIS Python scripts. The underlying code can be found in the "ArcPy" folder.
  • Data analysis for our PNAS Nexus publication was performed with Stata scripts. The underlying code can be found in the "Stata" folder.
  • The TIF and CSV files needed for replicating our analyses in the PNAS Nexus publication are available in the "Replication_Files" folder.

Instructions for Satellite Image Classification

Prerequisites

To reproduce the data processing the following things are necessary:

  • Create a Google Earth Engine Account
  • MongoDB installation
  • Python Installation
  • Stata Installation
  • ArcGIS Installation

Program Specifications

Satellite image analysis: Python program with 3 different main.py specifications:

  • Europe: Classifies European countries that participate in the CORINE Land Cover (CLC) program. Training data are produced for each country separately. Data are exported at the country level.
  • USA: Classifies U.S. states. Training data are produced for each state from CLC countries in similar climate zones. Data are exported at the state level. Use and adapt this code if you wish to perform classification at a sub-country regional level.
  • World: Classifies any country in the world. Training data are produced for each country from CLC countries in similar climate zones. Data are exported at the country level. This code version can also be used to classify rectangular regions based on latitude/longitude coordinates, with training data produced for the selected region.

For more information see our paper and its supplementary material https://doi.org/10.1093/pnasnexus/pgad099

Setup

After installing python and setting up a GEE account, the python needs the authorization of using GEE and Google Drive. Also MongoDB needs to be installed and set up with three databases according to the three different program specifications (see above):

  • 'landcover', host='localhost', port=27017 for Europe data
  • 'landcover-USA', host='localhost', port=27017 for USA data
  • 'landcover-World', host='localhost', port=27017 for world data

Setup countries to execute:
Run the function 'addNewCountry()' in the specific main.py (EU, USA, World) with a country name and priority.
Example:
''' addNewCountry("Chad", 0) '''
The python program will create a GEE asset folder and create a MongoDB entry for the country containing all required information for the automatic execution.
Whenever the country name is equals to the country's feature name in GEE feature collection ('USDOS/LSIB_SIMPLE/2017'), no additional input is necessary.
For countries with special names, the correct GEE feature name has to be assigned to the MongoDB entry at the variable shapefile="...", which has to match the country feature value in the property 'country_na' of the GEE featurecollection ('USDOS/LSIB_SIMPLE/2017').

Execution of main.py:
main.py will load all countries or states saved in the MongoDB.
The specific executer.py is a launch which goes through all country/state objects and identfies the next one to run (lowest priority number and not yet fully executed).

Each country will be launched with the following sequence:

  • See whether all tasks on GEE are finished, if no sleep for 20 minutes and repeat
  • Create training data
  • Create (lat/lon) grid cells
  • Classify and export all grid cells (takes up to weeks for large countries)
  • Validation (for EU countries)
  • Mark country as finished

Versioning

The "LandcoverClassification-EarthEngine" folder contains the most recent version of the classification code. The current version is 1.0.0, which is also the version used to produce that data for the PNAS Nexus publication. After updates, old versions of the code will be maintained in this repository.

Contact

Patrick Lehnert - patrick.lehnert@business.uzh.ch

Michael Niederberger - michael.niederberger@geo.uzh.ch

Project Link: https://github.com/Neduzen/lhvpetecon-surface

(back to top)

About


Languages

Language:Python 69.0%Language:Stata 31.0%