Crop classification
This is a collection of scripts that can help to classify crops using Sentinel data.
Probably this documentation won't suffice to get you started, but you are free to reach out for more info if you are really interested.
In general, you should also be aware that the package isn't really meant to be an easy-to-use solution for crop classification. It is rather a quite specialised solution for our specific needs. Nonetheless we want to make the code public so if anyone is interested, they can have a look and possibly get some inspiration.
Installation manual
- Install conda
As the scripts are written in Python, you need to use a package manager to be able to install the packages the scripts depend on. The rest of the installation manual assumes you use anaconda and python 3.6+. The installer for anaconda can be found here: https://www.anaconda.com/download/.
- Create new environment and install dependencies
Once you have anaconda installed, you can open an anaconda terminal window and follow the following steps:
1. Create and activate a new conda environment
```
conda create --name cropclassification
conda activate cropclassification
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
```
2. Install the dependencies for the crop classification scripts:
```
conda install python=3.9 geopandas geofileops "h5py<3" openeo psutil qgis rasterio rasterstats scikit-learn
```
3. If it was the first time you installed anaconda/geopandas, you might have to restart your computer to proceed
4. Start the anaconda terminal window again and activate the environment
```
conda activate cropclassification
```
5. Now install cropclassification and dependencies that need pip with pip
```
pip install cropclassification
```
- Calculate time series
To calculate time series, you need to run cropclassification -t <tasks_dir>, with a 'calc_timeseries' type of task in the tasks dir
on a server that has access to sentinel CARD images.
Mind: the sentinel CARD image structure as expected for timeseries calculation depends on the image type:
- for Sentinel 2 images this is the standard S2 L2A format as available on the open acces copernicus hub.
- for Sentinel 1 backscatter and sentinel 1 coherence data this is a non-standardized data structure as there isn't a standard format (yet) for level 2 processed sentinel 1 images (as far as I know). Check out the code to see the expected data structure ;-).
- Start a crop classification
Run cropclassification -t <tasks_dir>, with a 'calc_marker' type of task in the tasks dir.
Metadata
Release files for cropclassification 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cropclassification-0.2.tar.gz | 114.4 kB | Without provenance | Details for cropclassification-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cropclassification-0.2-py3-none-any.whl | Python 3 | none | any | Details for cropclassification-0.2-py3-none-any.whl |
Total release size: 251.4 kB
Release files / cropclassification-0.2.tar.gz
| Download URL | cropclassification-0.2.tar.gz |
|---|---|
| Size | 114.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d1e05adc54a01a40655c17b69935a77107e24ed95185af1c8abc15e5604bb55
|
|
BLAKE2b-256 checksum How to use checksums |
79611130956f1e15db539d9e94da962579cf8eabb8b927f100d247cdaa0ba092
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Release files / cropclassification-0.2-py3-none-any.whl
| Download URL | cropclassification-0.2-py3-none-any.whl |
|---|---|
| Size | 137.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8da3562368d5b05a0faf6d3f06d1bd08acc5af1af4655a47e6e027be1e7399e
|
|
BLAKE2b-256 checksum How to use checksums |
77c9f0335042a80cebdb23710310d0fdbe88491f41048122a95c2be400f93170
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.4
|
Security for cropclassification 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.