BlenderGIS icon indicating copy to clipboard operation
BlenderGIS copied to clipboard

Unable to import some Geotiff

Open Rob-Lop opened this issue 4 years ago • 8 comments

Blender and OS versions

Blender 2.90.1 on Windows

Describe the bug

Unable to import some geotiff but works with QGIS.

With DEM raw data build, this error occurs : image

With DEM as displacement texture, I have this ugly thing : image

How to Reproduce

Importing some geotif.

Error message

For DEM raw data build :

Traceback (most recent call last):
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\io_import_georaster.py", line 454, in execute
    mesh = exportAsMesh(grid, dx, dy, self.step, reproj=rprjToScene, subset=self.clip, flat=False, buildFaces=self.buildFaces)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\operators\utils\georaster_utils.py", line 83, in exportAsMesh
    img = georaster.readAsNpArray(subset=subset)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\georaster\georaster.py", line 255, in readAsNpArray
    img = NpImage(self.path, noData=self.noData, georef=self.georef)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\georaster\npimg.py", line 128, in __init__
    self.data = self._npFromPath(data)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\georaster\npimg.py", line 228, in _npFromPath
    return self._npFromImgIO(path)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\georaster\npimg.py", line 259, in _npFromImgIO
    data = imageio.imread(img)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\core\functions.py", line 181, in imread
    reader = read(uri, format, 'i', **kwargs)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\core\functions.py", line 111, in get_reader
    return format.get_reader(request)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\core\format.py", line 158, in get_reader
    return self.Reader(self, request)
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\core\format.py", line 207, in __init__
    self._open(**self.request.kwargs.copy())
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\plugins\freeimage.py", line 79, in _open
    self._bm.load_from_filename(self.request.get_local_filename())
  File "C:\Users\...\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\BlenderGIS-master\core\lib\imageio\plugins\_freeimage.py", line 814, in load_from_filename
    self._fi._get_error_message()))
ValueError: Could not load bitmap "R:\...\GOL.tif": FreeImage_Load: failed to open file R:\...\GOL.tif

For DEM as displacement texture, I have no error.

Rob-Lop avatar Oct 28 '20 07:10 Rob-Lop

Did you try to reexport the tif to a new one with QGIS or GDAL? sometime it can help. Can you share the file for testing it on my side?

domlysz avatar Nov 11 '20 08:11 domlysz

Yes, it works with QGIS and I can open the file after doing an export. BlenderGIS could open any kind of GeoTiff files or are there certain cases where this does not work ?

Rob-Lop avatar Nov 12 '20 15:11 Rob-Lop

Tiff is a very versatile container, it's not surprising that some files does not work depending of the option used to it's creation. Should be useful to have a list of non supported options.

domlysz avatar Nov 13 '20 07:11 domlysz

Hi there. I am having this same issue. Was this ever resolved? I'm assuming there's an issue with the format of my geotiff. Does anyone know of any guidance notes on the format of the geotiff for input to BlenderGIS?

cwberry7 avatar Aug 30 '21 22:08 cwberry7

Have the same problem with a jpg DEM. It worked with the previous one but reexported it in ArcGIS Pro in highr resolution. Now I get the bitmap load error when trying to import as displacement texture in BlenderGIS. Was this ever resolved?

dotnetemmanuel avatar Oct 22 '21 11:10 dotnetemmanuel

I have the same problem. I exported from ArcGisPro. When I try to import with the gis plugin it looks like this grafik I tried to export as 16Bit unasigned but only get a black output. Any ideas how to export from ArcGisPro so I can import it correctly with the blender plugin!?! Any solution is welcome :)

nod74 avatar Oct 23 '21 09:10 nod74

I have the same problem. I exported from ArcGisPro. When I try to import with the gis plugin it looks like this grafik I tried to export as 16Bit unasigned but only get a black output. Any ideas how to export from ArcGisPro so I can import it correctly with the blender plugin!?! Any solution is welcome :)

确保CRS为WGS 84 / Pseudo-Mercator,我使用QGIS导出,得到正常结果。

stellaris7762 avatar Nov 03 '21 02:11 stellaris7762

确保使用可正常识别的坐标系(CRS),比如:“EPSG:3857 - WGS 84 / Pseudo-Mercator”。这可能会有用。但我使用arcgis10.5导出仍然会报错,QGIS则不会。

stellaris7762 avatar Nov 03 '21 02:11 stellaris7762