GHSL Land Cover python module
Project description
GHSL Land Cover Service
GHS-LC-SERV (GHSL Land Cover Service) is an end-to-end, fully automated Earth Observation processing and analysis pipeline for generating custom land cover maps from Sentinel-2 data archives.
Quick start
The classification can be done on S2 tiles (files zip or SAFE directories) or on S2 mosaics (GeoTIFF format).
from pathlib import Path
from ghslc import ghslc
# Sentinel 2 file to classify
s2_file = Path('S2A_MSIL1C_20191210T101411_N0208_R022_T32TQM_20191210T104357.zip')
# Training configuration as yaml file
training_file = Path('training_CGLS.yml')
# Target classes to extract from the classification
target_classes = [
[80, 200], # Permanent water bodies
[111, 112, 113, 114, 115, 116, 121, 122, 123, 124, 125, 126], # Forests
40, # Cultivated and managed vegetation/agriculture (cropland)
50, # Urban / built up
]
# Output folder
output = Path('/tmp')
results = ghslc.generate_classification_from_safe(
filesafe=s2_file,
workspace=output,
training=training_file,
classes=target_classes,
)
Install
The easier way to install dependencies is using conda:
conda env create -f environment.yml
Activate the conda environment:
conda activate ghslc
Install ghslc package:
pip install ghslc
Test
Simply install tox with:
pip install tox
Then run the tests in python 3.10:
tox -e py310
This will build, install and test the project in a dedicated python 3.10 environment with all needed dependencies. The tests should take few minutes to complete.
If you want to run it for all supported python versions type:
tox
This takes longer, but it should be less than 30 minutes.
Licensing
This project is licensed under the GPLv3 License.
Copyright (c) 2021, European Commission, Joint Research Centre. All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghslc-0.1.13.tar.gz.
File metadata
- Download URL: ghslc-0.1.13.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfa4b466eb2a7545ff45a0f9125f07ffe34b5b409cc5c3cd06ae6109c90a2f52
|
|
| MD5 |
1e5d5637bdfc9190f0b1e4e3cf8449ff
|
|
| BLAKE2b-256 |
fe4afc56cfd8bf0890be4080201bc548e55e3915a605c64b92b20517a4f81d93
|
File details
Details for the file ghslc-0.1.13-py3-none-any.whl.
File metadata
- Download URL: ghslc-0.1.13-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42a28da3c4afe3b98d3354fd1507eee9dcdb4882089e9685abcbb50969f2e2f5
|
|
| MD5 |
72dfbfdf62e3ebf201ceaee3846341ab
|
|
| BLAKE2b-256 |
d309922fbe23769b1097f9b2b033374d9a220bc3af1e1bed74baeea0219b0386
|