Learn how to use <geosys/> platform capabilities in your own business workflow! Build your processor and learn how to run them on your platform.
Who we are
Table of Contents
The aim of this project is to help our customers valuing <geosys/> platform capabilities to build their own analytic of interest.
The purpose of this example is to assess the impact of an event on an area of interest (i.e drought, fire, high precipitations). Once the date of event and the threshold are set, a difference map based on the required products (NDVI, EVI etc.) is provided. This allows to better locate the impacted areas, thus support in the decision making process to recover from the event.
It highlights the ability to retrieve a product time series in xarray format.
This directory allows you to run this example both through a notebook and as a local application on your machine.
Use of this project requires valids credentials from the <geosys/> platform . If you need to get trial access, please register here.
To be able to run this example, you will need to have following tools installed:
-
Install Conda: please install Conda on your computer. You can download and install it by following the instructions provided on the official Conda website
-
Install Docker Desktop: please install Docker Desktop on your computer. You can download and install it by following the instructions provided on the official Docker Desktop website
-
Install Jupyter Notebook: please install jupyter Notebook on your computer following the instructions provided on the official Jupyter website
-
Install Git: please install Github on your computer. You can download and install it by visiting here and following the provided instructions
This package has been tested on Python 3.9.7.
To set up the project, follow these steps:
-
Clone the project repository:
git clone https://github.com/GEOSYS/impacted-areas-identification
-
Change the directory:
cd impacted-areas-identification
-
Fill the environment variable (.env)
Ensure that you populate the .env file with your Geosys APIs credentials. If you haven't acquired the credentials yet, please click here to obtain them.
API_CLIENT_ID = <your client id>
API_CLIENT_SECRET = <your client id>
API_USERNAME = <your username>
API_PASSWORD = <your password>
To access and use our Catalog STAC named "Skyfox," please ensure that you have the following environment variables set in your .env file:
SKYFOX_URL = https://api.eds.earthdaily.com/archive/v1/stac/v1
SKYFOX_AUTH_URL = <skyfox auth url>
SKYFOX_CLIENT_ID = <your client id>
SKYFOX_SECRET = <your client id>
To use the project with Jupyter Notebook, follow these steps:
-
Create a Conda environment:
conda create -y --name demo
-
Activate the Conda environment:
conda activate demo
-
Install the project dependencies. You can do this by running the following command in your terminal:
conda install -y pip pip install -r requirements.txt pip install ipykernel
-
Set up the Jupyter Notebook kernel for the project:
python -m ipykernel install --user --name demo --display-name example1
-
Open the example notebook (impacted_areas_identification.ipynb) by clicking on it.
-
Select the "Kernel" menu and choose "Change Kernel". Then, select "example1" from the list of available kernels.
-
Run the notebook cells to execute the code example.
To set up and run the project using Docker, follow these steps:
-
Build the Docker image locally:
docker build --tag example1 .
-
Run the Docker container:
docker run -d --name example1_container -p 8081:80 example1
-
Access the API by opening a web browser and navigating to the following URL:
http://127.0.0.1:8081/docs
This URL will open the Swagger UI documentation, click on the "Try it out" button under each POST endpoint and enter the request parameters and body
Parameters:
- Vegetation Index, ex: "NDVI"
Body Example:
{
"geometry": "POLYGON((-55.08964959 -12.992576790000001, -55.095571910000004 -12.99349674, -55.09265364 -13.014153310000001, -55.07111016 -13.01013924, -55.07428588 -12.98914779, -55.08261147 -12.99098782, -55.08115233 -13.00152544, -55.08724632 -13.00269622, -55.08819045 -13.0037834, -55.08956371 -13.00369981, -55.08819045 -13.00202724, -55.08964959 -12.992576790000001))",
"minDuration": 10,
"eventDate": "2021-06-07",
"threshold": -0.15
}
Parameters:
- Vegetation Index, ex: "NDVI"
Body Example:
{
"sensor_collection": "sentinel-2-l2a",
"mask_collection": "sentinel-2-l2a-cog-ag-cloud-mask",
"mask_band": [
"agriculture-cloud-mask"
],
"bands": [
"red",
"green",
"blue",
"nir"
],
"geometry": "POLYGON((-93.91666293144225 44.46111651063736,-93.94000887870787 44.52430217873475,-93.979834318161 44.518427330078396,-94.01004672050475 44.50814491947311,-94.001806974411 44.471407214671636,-93.99425387382506 44.44641235787428,-93.96953463554381 44.45327475656579,-93.91666293144225 44.46111651063736))",
"minDuration": 10,
"eventDate": "2021-06-07",
"threshold": -0.15
}
├── README.md
├── notebooks
├── requirements.txt
├── environment.yml
│
├── setup.py
├───src
│ ├───main.py
│ ├───api
│ │ ├── files
│ │ │ └── favicon.svg
│ │ ├── __init__.py
│ │ └── api.py
│ └───vegetation_index_impacted_areas_identificator
│ ├── __init__.py
│ ├── utils.py
│ ├── vegetation_index.py
│ ├── vegetation_index_calculator.py
│ └── impacted_areas_identification.py
└── tests
The following links will provide access to more information:
If this project has been useful, that it helped you or your business to save precious time, don't hesitate to give it a star.
Distributed under the MIT License.
For any additonal information, please email us.
© 2023 Geosys Holdings ULC, an Antarctica Capital portfolio company | All Rights Reserved.