pyrsgis: A Python package to read, process and export GeoTIFFs.¶
pyrsgis enables the user to read, process and export GeoTIFFs. The module is built on the GDAL library, but is much more convenient when it comes to reading and exporting GeoTIFs. There are several other functions available in this package that ease raster pre-processing, some focused on machine learning tasks.
Feedback and bug reports are most welcome. Since this is an open-source project, I always look forward to contributors.
GitHub repository : https://github.com/PratyushTripathy/pyrsgis
pyrsgis is available on both, PyPI and Anaconda. Please submit your query as a pull request on the GitHub repo. For more information, write to: pratkrt@gmail.com
Installation¶
pyrsgis supports python 3.5 to 3.8 only. However, since there is no major reliability on the Python version, it should work on all Python 3 versions. Please ensure that you are using a python 3 environment.
Installing using PyPi¶
pyrsgis is available on the Python Package Index repository. It can be installed using pip from command line using the following command:
pip install pyrsgis
If you want to install a specific version, you can check the release history on the PyPI page to find out your version and install it by explicitly specifying the version.:
pip install pyrsgis==0.4.0
This can be useful since stable and latest versions are different.
Installing using Conda¶
pyrsgis is available on Anaconda too. It can be installed using the following command:
conda install -c pratyusht pyrsgis
Contributing to pyrsgis¶
pyrsgis is an open-source non-profit project and suggestions/ contributions are most welcome. To contribute to the project, you can fork the GitHub repo, clone the repository locally, make changes to the cloned version and submit a pull request.
pyrsgis - Python for Remote Sensing and GIS author: pratkrt<at>gmail.com Compatible with Python versions 3+
pyrsgis API reference¶
Reading and exporting GeoTIFFs¶
|
Read raster file |
|
Export GeoTIFF file |
Clipping a raster¶
|
ds : datasource object |
|
Clip and export raster file in one go |
|
Trim raster array and modify ds |
|
Trim raster array to remove NoData value at the edge |
|
Trim and export raster file |
Shifting a raster¶
|
Shift the datasource of a raster file |
|
Shift and export raster file in one go |
Reshaping GeoTIFF array for statistical analysis¶
Convert 2D or 3D array to table |
|
|
Convert tablar array to 2D or 3D array |
|
Convert raster to a tabular CSV file |
|
Convert a CSV file to raster |
Creating image chips for deep learning¶
|
Image chips from raster array |
|
Image chips from 2D array |
|
Image chips from raster file |
Generating northing and easting raster¶
|
Generate row and column number arrays |
Generate arrays with cell latitude and longitude value. |
|
|
Generate northing raster using a reference .tif file |
|
Generate easting raster using a reference .tif file |