A suite of tools for Precision Agriculture data analysis
- Homepage: https://github.com/CSIRO-Precision-Agriculture/pyprecag
- Documentation: https://CSIRO-Precision-Agriculture.github.io/pyprecag_docs
- Installation
- Version: 0.4.3
- License: GNU General Public Licence version 3 (GPLv3)
Precision Agriculture Tools (PAT) Plugin for QGIS contains tools for processing and analysing precision agriculture data which uses the pyPrecAg python module. For more infomation visit https://github.com/CSIRO-Precision-Agriculture/PAT_QGIS_Plugin
If you use pyprecag for any published work, please cite using the reference below:
Ratcliff, Christina; Gobbett, David; & Bramley, Rob (2025): pyprecag - a Python package for the analysis of precision agriculture data. CSIRO. v5. Software. http://hdl.handle.net/102.100.100/78353
pyprecag is available through the Python Packaging Index and can be installed with pip, however some dependencies require additional steps to install properly.
It is recommended to install pyprecag in a virtual environment so that the dependencies do not cause issues with your system-level Python installation.
VESPER Kriging is only supported on Windows platforms with the VESPER software installed.
Install via pip:
pip install pyprecagThe only dependency that causes issues is GDAL . The Python package is available from PyPI . However, the [libgdal-dev]{.title-ref} dependencies are required, and the location of the header files needs to be specified when installing. These libraries are available via UbuntuGIS and other avenues.
On Debian systems, this process should work. Add the unstable release of UbuntuGIS, get and install packages with:
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev gdal-binIf the above doesn't work try removing all gdal related files from the [/etc/apt/sources.list.d]{.title-ref} direcory and trying again (it's possible old files are interfering with install attempts).
Once the [libgdal-dev]{.title-ref} libraries and [gdal-bin]{.title-ref} are installed, pip install GDAL while specifying the version and the location of the header files with:
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"Then pyprecag should install without issue.
The Dockerfile included in the examples directory builds a container with Pyprecag installed in an Ubuntu 18.04 image. Build the container with:
docker build -f docs/Dockerfile -t <tag> .The tests can be run inside this container like this:
docker run <container id or tag> make testThe dependencies GDAL, Fiona , and Rasterio , all cause issues when installing on Windows.
The easiest way to install all of these is with the Windows Binaries provided by Christoph Gohlke at https://www.lfd.uci.edu/~gohlke/pythonlibs/. Download the Python 2.7 version for your system architecture then install them with:
pip install /path/to/<downloaded_file.whl>It is recommended to install GDAL first, as it is a requirements for both Fiona and Rasterio. GDAL might also return an error and require you to install Visual C++.
They are also available from the conda-forge channel in conda. pyprecag is not currently available to install with conda, however can be pip installed in a conda environment and use the conda-installed versions of GDAL, Fiona and Rasterio.
Once those three dependencies are installed, pyprecag should install without issue.
There is a makefile in the project root with targets for the most common development operations such as lint checks, running unit tests, building the documentation, and building installer packages. [tox]{.title-ref} does not have a target, as [make tox]{.title-ref} is more typing than [tox]{.title-ref}.
Run make with no target to see the list of targets:
$ makeBump-my-version is used to manage the package version numbers. This ensures that the version number is correctly incremented in all required files. Please see the bumpversion documentation for usage instructions, and do not edit the version strings directly.
Version numbers follow the Semantic versioning guidelines.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
When reporting a bug please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- The pyprecag package version.
- Detailed steps to reproduce the bug.
pyprecag could always use more documentation, whether as part of the official pyprecag docs, in docstrings, or even on the web in blog posts, articles, and such.
:::: note ::: title Note :::
This project uses Google-style docstrings. Contributed code should follow the same conventions. For examples, please see the Napoleon examples, or the Google Python Style Guide. ::::
The best way to send feedback is to file an issue
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Or, implement the feature yourself and submit a pull request.
To set up pyprecag for local development:
- Fork the [pyprecag]{.title-ref} repo on GitHub.
- Clone your fork locally:
$ git clone [email protected]:your_name_here/pyprecag.git- Create a branch for local development:
git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.- When you're done making changes, run all the tests, doc builder and pylint checks using the project makefile:
make clean lint test docs- Commit your changes and push your branch to GitHub:
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature- Submit a pull request through the GitHub website.
If you need some code review or feedback while you're developing the code just make the pull request.
For merging, you should:
- Include passing tests.
- Update documentation when there's new API, functionality etc.
- Add a note to
CHANGELOG.rstabout the changes. - Add yourself to
AUTHORS.rst.