BergWerkGIS / VoGIS-Profil-Tool

VoGIS-Profil-Tool, Amt der Vorarlberger Landesregierung , Landesamt für Vermessung und Geoinformation
http://vorarlberg.at/vorarlberg/bauen_wohnen/bauen/vermessung_geoinformation/start.htm
7 stars 4 forks source link

Saving profile as PNG causes QGIS to crash #8

Closed mixedbredie closed 6 years ago

mixedbredie commented 7 years ago

I am using QGIS 2.14.12 and QGIS 2.18.3 64-bit on Windows 7.

Using the VoGIS profile tool I can select a raster DEM and draw a line/use existing line feature to create a profile. Once the profile is generated saving it as PNG causes QGIS to crash dump after setting the output location and pressing the Save button.

The VoGIS console has the following in it before saving:

2017-03-03T11:53:56 1 reject: False 2017-03-03T11:54:19 1 isopen: false 2017-03-03T11:54:19 1 [NOTerrain50] provider type: gdal 2017-03-03T11:54:37 1 maindlg: nodata: -9999 2017-03-03T11:54:37 1 modeLine!=line: True 2017-03-03T11:54:37 1 customLine is None: False 2017-03-03T11:54:37 1 Profile Count: 1 2017-03-03T11:54:37 1 delimiter:. 2017-03-03T11:54:37 1 idx:1

Saving as other formats works as expected.

mixedbredie commented 7 years ago

I noticed when saving as JPEG that the output file is incomplete/corrupted. See attached files below. Not sure if this is all related. I have noticed other bug reports about similar issues saving images using the matplotlib plot library.

image

image2

mixedbredie commented 7 years ago

The QGIS plugin - Profile Tool - has the option to switch to using the Qwt5 plot library. This works exporting to PNG and JPG. Would this be an option in this plugin?

wilhelmberg commented 7 years ago

@mixedbredie the failing PNG export on Windows is a known problem of the old matplotlib@1.3.1 that comes with QGIS 2.x. I've tried countless things to work around it but to no avail.

You can check the matplotlib version by putting this code into the Python console:

import matplotlib; matplotlib.__file__; matplotlib.__version__

Upcoming QGIS 3.x seems to have maptplotlib@2.0.0, but I haven't investigated yet if this solves the PNG export problem on Windows.

Wrt JPG export: haven't seen issues like this before.

Using Qwt5 might be an option but this plugin was a contract project (https://github.com/BergWerkGIS/VoGIS-Profil-Tool#developed-for). To make this happen we would have to find a sponsor.

I would Happily accept a PR if you are up to that.

wilhelmberg commented 6 years ago

@mixedbredie I just tried with QGIS@2.18.14 and PNG export works as expected (thanks to updated matplotlib@2.0.0).

Do you still see the JPG issue - I'm not able to reproduce.

wilhelmberg commented 6 years ago

Solved by latest LTR - 2.18.15 as of now.