项目作者: yannforget

项目描述 :
Complementarity Between Sentinel-1 and Landsat 8 Imagery for Built-Up Mapping in Sub-Saharan Africa
高级语言: Jupyter Notebook
项目地址: git://github.com/yannforget/landsat-sentinel-fusion.git
创建时间: 2018-10-07T19:04:27Z
项目社区:https://github.com/yannforget/landsat-sentinel-fusion

开源协议:MIT License

下载


DOI

This repository contains the Python code supporting the following paper:

  • Forget Y., Shimoni M., Gilbert M., and Linard C. Complementarity Between Sentinel-1 and Landsat 8 Imagery for Built-Up Mapping in Sub-Saharan Africa, In Press, 2018.

Input and output datasets can be downloaded from Zenodo.

Dependencies

Python dependencies are listed in the environment.yml and the requirements.txt files.

A virtual environment containing all the required dependencies can be automatically created using conda:

  1. # Clone the repository
  2. git clone https://github.com/yannforget/landsat-sentinel-fusion.git
  3. cd landsat-sentinel-fusion
  4. # Create the virtual environment
  5. conda env create --file environment.yml
  6. # Activate the environment
  7. source activate landsat-sentinel-fusion

The code also depends on:

  • Orfeo Toolbox for the computation of GLCM textures ;
  • SNAP for SAR data preprocessing.

Data

Input and output datasets are available in a Zenodo deposit.

  1. # Download and decompress the data
  2. wget -O data.zip https://zenodo.org/record/1450932/files/data.zip?download=1
  3. unzip data.zip

Validation samples can be found in data/raw/reference (as shapefiles) or in data/processed/reference (as rasters).

Classification outputs and performance metrics are located in data/output for each case study.

Due to storage constraints, input satellite imagery is not included in the Zenodo deposit. However, the product identifiers are available in data/raw/landsat/products.txt and data/raw/sentinel-1/products.txt. This means that they can be automatically downloaded using auxiliary software such as landsatxplore or sentinelsat.

For Landsat 8 scenes:

  1. pip install landsatxplore
  2. # Earth Explorer credentials
  3. export LANDSATXPLORE_USERNAME=<your_username>
  4. export LANDSATXPLORE_PASSWORD=<your_password>
  5. cd data/raw/landsat
  6. # Download each product with landsatxplore
  7. for id in products.txt; do landsatxplore download $id; done
  8. # Decompress each product
  9. for product in *.zip; do unzip $product; done

For Sentinel-1 imagery:

  1. cd ../sentinel-1
  2. # Install and configure sentinelsat
  3. pip install sentinelsat
  4. export DHUS_USER=<your_username>
  5. export DHUS_PASSWORD=<your_password>
  6. # Download Sentinel-1 products
  7. for id in products.txt; do sentinelsat --download --name $id; done

Code

Running the analysis

  1. # Preprocessing of Optical and SAR data
  2. python preprocess_landsat.py
  3. python preprocess_sentinel1.py
  4. # Dimensionality reduction (PCA) of SAR data
  5. python dimreduction.py
  6. # Random forest classification and validation
  7. python classification.py

Modules

  • src/glcm.py : computing of GLCM textures using Orfeo Toolbox.
  • src/metadata.py : accessing metadata specific to each case study.
  • src/raster.py : various raster processing functions.
  • src/utils.py : helper functions.

Scripts

The following scripts has been used for the study but are not necessary to run the analysis :

  • src/aoi.py : generates areas of interest for each case study.
  • src/climate.py : monthly ndvi and precipitations for each case study.
  • src/land_masks.py : land/water masks using openstreetmap data.
  • src/preprocess_reference.py : rasterizes reference samples (polygons).