domlysz / BlenderGIS

Blender addons to make the bridge between Blender and geographic data
GNU General Public License v3.0
7.83k stars 1.36k forks source link

Unable to import some Geotiff #405

Open Rob-Lop opened 4 years ago

Rob-Lop commented 4 years ago

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.

domlysz commented 4 years ago

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?

Rob-Lop commented 4 years ago

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 ?

domlysz commented 4 years ago

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.

cwberry7 commented 3 years ago

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?

dotnetemmanuel commented 3 years ago

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?

nod74 commented 3 years ago

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 :)

stellaris7762 commented 3 years ago

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 commented 3 years ago

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