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

Basemap Crashes Blender #461

Open Nuk3lar opened 3 years ago

Nuk3lar commented 3 years ago

Blender and OS versions

Blender 2.91 & Blender 2.83 (Tried on both versions) GDAL-3.2.2-cp37-cp37m-win_amd64 numpy-1.20.1+mkl-cp37-cp37m-win_amd64 Python 3.7.4

Describe the bug

Attempting to import a basemap crashes blender instantly.

How to Reproduce

Environment File set as specified in this image

Completely Blank file, try to import a Basemap with any CRS other than web Mercator image

Error message

blender_debug_output.txt

Moult commented 3 years ago

I can recreate this on Linux, but what I've found is that any map service that has a satellite basemap crashes, but any basemap with just regular maps (e.g. street map) works.

cxed commented 3 years ago

I'm seeing the same thing. It seems all the dependencies, including GDAL are satisified and can be imported in the Blender Python console. When I try the "Basemap" feature, it kills Blender immediately with a seg fault. I tried experimenting with different options for the Basemap but just got slightly different messages.

System

Blender: 2.92.0 PRETTY_NAME="Debian GNU/Linux 10 (buster)"

$ /usr/local/src/blender-2.92.0-linux64/2.92/python/bin/python3.7m --version
Python 3.7.7
$ /usr/local/src/blender-2.92.0-linux64/2.92/python/bin/python3.7m -m pip freeze
certifi==2020.12.5
construct==2.10.56
future==0.18.2
GDAL @ https://github.com/AsgerPetersen/gdalwheels/releases/download/2.3.0_1/GDAL-2.3.0-cp37-cp37m-manylinux1_x86_64.whl
mingus==0.6.0
numpy==1.16.1
Pillow==8.2.0
pymidi==0.5.0
pyproj==3.0.1

Error messages

errors.txt

I hope we can get these issues cleared up because this addon looks really cool!

cxed commented 3 years ago

Just found this - could be interesting.

$ cat .bgis/bgis.log
INFO:BlenderGIS:92:###### Starting new Blender session : 2021-04-09 20:31:53
DEBUG:BlenderGIS.core.checkdeps:12:GDAL Python binding available
DEBUG:BlenderGIS.core.checkdeps:23:PyProj available
DEBUG:BlenderGIS.core.checkdeps:34:Pillow available
DEBUG:BlenderGIS.core.checkdeps:46:ImageIO Freeimage plugin available
DEBUG:BlenderGIS.operators.view3d_mapviewer:201:Bounding box request : (-248198980.2929091, -163039569.83605477, 248198980.2929091, 163039569.83605477)
DEBUG:BlenderGIS.core.basemaps.mapservice:726:117 tiles requested, 1 already in cache, 116 remains to download
DEBUG:BlenderGIS.core.basemaps.mapservice:580:http://mt0.google.com/vt/lyrs=s&x=0&y=1&z=0
ERROR:BlenderGIS.core.basemaps.mapservice:590:Can't download tile x0 y1. Error HTTP Error 400: Bad Request
DEBUG:BlenderGIS.core.basemaps.mapservice:600:Invalid tile data for request http://mt0.google.com/vt/lyrs=s&x=0&y=1&z=0
cxed commented 3 years ago

Went ahead and ran some more different targets to collect different error messages. Definitely looks like something is mishandling the URL formatting somewhere. That or the request is too large (or invalid request message framing, or deceptive request routing).

bgis.log

domlysz commented 3 years ago

Sound like the original issue from @Nuk3lar is related to some update in the Proj Python binding: ValueError: Cannot initialize osr : +init=epsg:4326 I need to investigate more

domlysz commented 3 years ago

@cxed that's strange because the tile number http://mt0.google.com/vt/lyrs=s&x=0&y=1&z=0 does not exist but this tile is normally filtered out because it's just out of the map bounds. Futhermore if a request fails the program raise an error but not stop the execution, the tile is just ignored and you should see this one http://mt0.google.com/vt/lyrs=s&x=0&y=0&z=0.

I suspect there is something wrong with recent GDAL/Proj updates. Is it works correctly if you bypass these dependencies? In the addon preferences change theses settings : image

GDAL is an optional dependency, can be useful for advanced use but not well tested

cxed commented 3 years ago

Using Projection engine=Built in and Image processing engine=ImageIO and Source=Google I get a seg fault and this error log.

$ cat ~/.bgis/bgis.log
INFO:BlenderGIS:92:###### Starting new Blender session : 2021-04-10 08:33:11
DEBUG:BlenderGIS.core.checkdeps:12:GDAL Python binding available
DEBUG:BlenderGIS.core.checkdeps:23:PyProj available
DEBUG:BlenderGIS.core.checkdeps:34:Pillow available
DEBUG:BlenderGIS.core.checkdeps:46:ImageIO Freeimage plugin available
DEBUG:BlenderGIS.operators.view3d_mapviewer:201:Bounding box request : (-248198980.29290897, -163039569.83605468, 248198980.29290897, 163039569.83605468)
DEBUG:BlenderGIS.core.basemaps.mapservice:726:117 tiles requested, 1 already in cache, 116 remains to download
AbdelghaniTamort commented 4 months ago

Sound like the original issue from @Nuk3lar is related to some update in the Proj Python binding: ValueError: Cannot initialize osr : +init=epsg:4326 I need to investigate more

bump

AbdelghaniTamort commented 4 months ago

@domlysz @Moult @Nuk3lar @cxed anyone found any kind of solution to bypass this ?