RasterBender is an EXPERIMENTAL QGIS Python plugin allowing to distort raster layers using pairs of points. This allows to match data that has complex non-uniform and non-linear deformations (historical maps, hand drawn sketches...).
This plugin is not production ready at all and you should not use it beside for testing. See limitations below to see what to expect.
Launch RasterBender from the plugins menu or from the plugin toolbar.
RasterBender works a bit like the georeferencer : you have to create pairs of points, the first one being the original location, and the second one being the target location.
To do so, RasterBender uses plain Linestring layers. Each pair is defined by the starting point and ending point of a Line in this layer.
You can either use one of your own Linestring layers, or use the button from the RasterBender window.
You can also create a constraint layers, which will constrain the triangulation created by the plugin. This can be useful if you have some artifact generated by unwanted triangles. The constraints are line that should go from one starting point to another. Use the preview to see if the triangulation is affected as expected.
If you use RasterBender's layers, I recommend installing the "Save memory layer" plugin which will allow to save your work.
Once the layer to bend and the pairs layer are chosen, simply hit "run", wait a while (it can be quite long), and a new raster will be saved at the target path.
The first points of all pairs will be triangulated, and this triangulation will be mapped on the last points of all pairs. The raster layer will then be deformed by matching the triangulation.
The "buffer" parameters sets a buffer around the triangulation, so that the transformation ends more smoothely on the edges. Hold the "preview" button to see the size of the buffer.
Using this method will INDUCE DEFORMATIONS. You should ONLY use it if your data is already deformed, and not to accomplish CRS transformations nor linear/affine transformations.
To avoid using too much memory, the target raster is divided into square blocks. The bigger the blocks, the more triangles must be analysed at the same time. The plugin will tell you how many triangles the trifinder must analyse. If this number is too high (more than 10 most of the time), try reducing the block size to gain speed.
Please report bugs and ideas on the issue tracker : https://github.com/olivierdalang/RasterBender/issues
Or send me some feedback at : olivier.dalang@gmail.com
RasterBender is in its early stages of developpement, and is currently tested only with GeoTIFF and RGB (3 channels) rasters. It is not expected to work with other file types. The current raster bending algorithm is very sub-optimal and thus very slow.
Here's how it works :
Preparing the mesh
Doing the transformation