Saturday, 14 December 2019

How to align/georeference distorted vector layers in QGIS?


I've got a shapefile which has been digitized from a strongly distorted historical map, and would like to align it as nicely as possible to another precise shapefile layer.


The transformation must not be affine : since the map is historical, it has both cartographic and measurements errors.


The best I've achieved for now is to use :


ogr2ogr -gcp 01_a_x 01_a_y 01_b_x 01_b_y -gcp 02_a_x 02_a_y 02_b_x 02_b_y ... -tps

The results is not bad at all (see images below), but the deformation is not "precise" enough. I mean that the points I defined do not align perfectly in the resulting geometry.


I would like to have those point align perfectly. Of course, points that are not set using -gcp would not have the same precision since they are only interpolated.



Is there a way to achieve that ?


Thanks a lot !!


Olivier


Step 1 : misaligned layer in red, reference layer in gray Step 1


Step 2 : points that I defined using -gcp Step 2


Step 3 : resulting layer. Not bad, but as you see, the points I defined are not perfectly aligned... Step 3



Answer



Ok I developped a QGIS plugin to do this : https://github.com/olivierdalang/VectorBender


I hope it will be useful to others too !


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...