BlenderGIS icon indicating copy to clipboard operation
BlenderGIS copied to clipboard

Basemap Crashes Blender

Open Nuk3lar opened this issue 4 years ago • 9 comments

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

Nuk3lar avatar Mar 24 '21 02:03 Nuk3lar

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.

Moult avatar Apr 04 '21 02:04 Moult

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 avatar Apr 10 '21 00:04 cxed

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 avatar Apr 10 '21 00:04 cxed

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

cxed avatar Apr 10 '21 01:04 cxed

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 avatar Apr 10 '21 08:04 domlysz

@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

domlysz avatar Apr 10 '21 08:04 domlysz

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

cxed avatar Apr 10 '21 12:04 cxed