gvellut / FreehandRasterGeoreferencer

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

Added layer has 0 width and 0 height #35

Closed NicolasCadieux closed 3 years ago

NicolasCadieux commented 3 years ago

When adding a layer in QGIS 3.14, layer is empty.

Capture

NicolasCadieux commented 3 years ago

toto.tif file is made from this test asc file: ncols 4 nrows 4 xllcorner 0 yllcorner 0 cellsize 1 nodata_value -9999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Toedi commented 3 years ago

Got the same issue on 3.16 (tried also with 3.14)! In my case the problem appears with orthomosaics created with Pix4DFields. Sometimes also with orthomosaics created with Dronedeploy.

View is zoomed onto issued layer. Normally it should be placed where the other activated layer can be seen partially (down right corner in my screenshot).

bugreport

Dkrav-UA commented 3 years ago

Try a different image format. This is a QImage problem. Convert it to PNG or TIF with GDAL tools.

Toedi commented 3 years ago

Thanks for your fast answer. Since my orthomosaics are already in TIF format i've tried converting it to PNG via GDAL Translate. Unfortunately I got the same issue.

I've got several orthomosaics which are already aligned propperly to my needs. My attempt would be to copy the geodata of those orthomosaics onto the new ones and hope that it somehow fits ^^. Could you provide a solution on how to do this?

Dkrav-UA commented 3 years ago

There are a couple of opportunities:

  1. If QGIS shows your images you can use the standard tool Raster\Georeferencer.
  2. Try to save image in 8bit grayscale. And then use this plugin.
  3. With GDAL tools you can extract tfw/wld file from the georeferenced image and use this file with your image.
Toedi commented 3 years ago

Thanks a lot for your time and help, i really appreciate it! <3

For those who also got stuck, i've came up with even another solution which suited my workflow the most... Since i did not need any rotation or rescaling I executed the accepted answer in this thread:

https://gis.stackexchange.com/questions/13561/how-to-translate-reposition-a-raster-in-python

Cheers

NicolasCadieux commented 3 years ago

Hi, Are you saying that we can only use 8bit grey scale images with the plugin? Nicolas

Dkrav-UA commented 3 years ago

No. Some images have non-standard color models. So QImage can't read it

NicolasCadieux commented 3 years ago

Ok thanks for the info.

fgfletcher commented 3 years ago

I have been using 1-bit PNG files from scanned survey maps. Seems to accept that (very compact) format without issues.

Dkrav-UA commented 3 years ago

Rasters with transparency displayed very wrong. изображение

gvellut commented 3 years ago

Is that with the just released version ? Which format is the raster (PNG, TIFF... )? Or is it a 2 band raster with 1 band the data and the other the transparency ? Could you send me the file ?

Dkrav-UA commented 3 years ago

PNG and TIF. Standard 4-band RGBA изображение

Dkrav-UA commented 3 years ago

main-part

gvellut commented 3 years ago

OK thank you.

But is it with the version of the plugin I just released ? Or some version in the repository ?

Dkrav-UA commented 3 years ago

изображение

gvellut commented 3 years ago

OK I see. Thank you.

gvellut commented 3 years ago

I have uploaded a new version that should correct the issue you had.

Dkrav-UA commented 3 years ago

Seems to be ok.

gvellut commented 3 years ago

Great. Thanks again for you help.