gvellut / FreehandRasterGeoreferencer

QGIS plugin for the interactive georeferencing of rasters
GNU General Public License v2.0
50 stars 13 forks source link

AttributeError using "Georeference raster with 2 points" #49

Open aazuspan opened 2 years ago

aazuspan commented 2 years ago

First of all, this is a fantastic plugin that makes georeferencing much easier in QGIS. Thanks for building it!

I'm running into a bug using the "2 point" tool that is very similar to #32. It seems like the Add Point > From Map Canvas tool in the built-in georeferencer causes the Freehand plugin "2 point" tool to break. I can reproduce this consistently with the steps below.

To Reproduce

Error

AttributeError: 'NoneType' object has no attribute 'center' 
Traceback (most recent call last):
  File "C:\Users/Aaron/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\FreehandRasterGeoreferencer\freehandrastergeoreferencer_maptools.py", line 643, in canvasPressEvent
    self.originalCenter = self.layer.center
AttributeError: 'NoneType' object has no attribute 'center'

System Info

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.20.0-Odense Odense, decaadbb31

Dkrav-UA commented 2 years ago

Why do you need to combine two different instruments? Use one. Complete task. Use another, if you need. Not both at the same time.

aazuspan commented 2 years ago

The built-in georeferencer doesn't allow interactive positioning and scaling of a raster like the freehand georeferencer does. The freehand georeferencer doesn't allow you to create control points and apply more complex transformations (e.g. polynomial). My workflow is to roughly position a raster using the Freehand plugin and use that as a reference to place control points in the built-in georeferencer.

Dkrav-UA commented 2 years ago

Use the plugin to roughly position a raster. Save it. Then you can correct it with internal tools. The plugin result is "virtual". Only developers of QGis know how georeferencer affects such "non-system" objects.