https://github.com/indus/gwarp
gdalwarp batch processor (vips accelerated)
https://github.com/indus/gwarp
gdal gis libvips python
Last synced: about 1 year ago
JSON representation
gdalwarp batch processor (vips accelerated)
- Host: GitHub
- URL: https://github.com/indus/gwarp
- Owner: indus
- License: mit
- Created: 2021-05-26T14:23:10.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-28T13:45:28.000Z (about 5 years ago)
- Last Synced: 2025-01-30T08:31:12.699Z (over 1 year ago)
- Topics: gdal, gis, libvips, python
- Language: Python
- Homepage:
- Size: 175 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
=====
gwarp
=====
gdalwarp batch processor (vips accelerated)
Requirements
===========
- gdal (with bindings)
- vips (with bindings)
- numpy
Install
===========
.. code::
pip install git+https://github.com/indus/gwarp.git
Options
===========
**gwarp** provides a subset of the familiar `gdalwarp options `_ :
.. code::
gwarp -t_srs EPSG:3857 -overwrite -r bilinear -multi -ts 1024 1024 -co compress=lzw
... as well as some additional (mostly vips related) options. For more info:
.. code::
gwarp -h
Description
===========
**gwarp** uses `gdalwarp `_ to first apply the desired projection and transformation to a single index file (lookup table). This index is then applied in a loop to all src files in the glop pattern using `vips `_. The output files can be written either in place with a suffix or to a separate folder.
When multiple files all need to be warped the same way, the persistence of the index results in a proportional performance gain. As the benchmarks show, **gwarp** can also lead to a speedup in the processing of a single very large input file. Since the exact reason for this is not yet known and since the overhead of python compared to C++ also includes the chance of a performance degradation, the use cases should be examined carefully.
**gwarp** works best when using the GeoTiff format for input and output. However, all other formats supported by vips (JPEG, PNG, WebP, etc.) can also be written. But in this case the geo information will be lost.
For the resampling method 'nearest' **gwarp** can produce output identical to gdalwarp. For all the other supported methods there may be minor differences in the output. **gwarp** has a mapping to choose the most appropriate interpolator in the vips stage based on the resampling method of gdalwarp (can be chosen explicitly as well).
Special care should be taken in the presence of NoData values. **gwarp** has options to set "srcnodata" and "dstnodata" explicitly, but these are not well tested and may produce output different from gdalwarp.
Benchmark
===========
| **system:** *CPU: i7-6700 CPU @ 3.40GHz, 4 cores; MEM: 64GB; OS: Win 10*
| **GDAL:** *3.2.2, released 2021/03/05*
| **gwarp:** *0.1, released 2021/05/26*
single file [`details `_]
----
.. image:: img/gwarp_bench0_single.png
multiple files [`details `_]
----
.. image:: img/gwarp_bench1_multi.png