Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError using "Georeference raster with 2 points" #49

Open
aazuspan opened this issue Nov 30, 2021 · 3 comments
Open

AttributeError using "Georeference raster with 2 points" #49

aazuspan opened this issue Nov 30, 2021 · 3 comments

Comments

@aazuspan
Copy link

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

  • Use the Add raster for interactive georeferencing tool to load a raster.
  • Open the built-in Raster > Georeferencer window and load a raster.
  • Use the built-in georeferencer to load a raster and use the Add Point tool with the From Map Canvas option to add one point.
    • If you manually enter coordinates instead of using From Map Canvas, the error doesn't occur.
  • Try to use the Georeference raster with 2 points tool in the Freehand Raster Georeferencer. A Python error will be thrown when you click the first point.

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
Copy link

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
Copy link
Author

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants