https://issues.qgis.org/https://issues.qgis.org/favicon.ico2019-04-15T21:53:07ZQGIS Issue TrackingQGIS Application - Bug report #21854: Add Grass raster layer with pyqgis 3 crash qgishttps://issues.qgis.org/issues/21854?journal_id=1040002019-04-15T21:53:07ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Crashes QGIS or corrupts data</strong> changed from <i>No</i> to <i>Yes</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li></ul><p>It's completely out of my league... just a hunch here... are you trying to add a "grass raster layer" as if it was a normal file based raster dataset? If yes I don't think that it would work anyway.</p> QGIS Application - Bug report #21854: Add Grass raster layer with pyqgis 3 crash qgishttps://issues.qgis.org/issues/21854?journal_id=1040052019-04-16T03:24:44ZSylvain POULAINsylvain.poulain@giscan.com
<ul></ul><p>Giovanni Manghi wrote:</p>
<blockquote>
<p>are you trying to add a "grass raster layer" as if it was a normal file based raster dataset? If yes I don't think that it would work anyway.</p>
</blockquote>
<p>Yes this is it ! Ok I have to found a workaround.</p>
<p>But thinking it could be working because gdal read it :</p>
<blockquote>
<p>$ gdalinfo --formats | grep GRASS<br />GRASS <del>raster</del> (ro): GRASS Rasters (5.7+)<br />GRASSASCIIGrid <del>raster</del> (rov): GRASS ASCII Grid</p>
</blockquote>
<blockquote>
<p>$ gdalinfo $HOME/SIG/GEOBASE/GRASSDB/MAURICE/data/cellhd/wh_789<br />Warning 1: GRASS warning: GISBASE environment variable was not set, using:<br />/opt/grass7<br />Driver: GRASS/GRASS Rasters (5.7+)<br />Files: /home/sylvain/SIG/GEOBASE/GRASSDB/MAURICE/data/cellhd/wh_789<br />Size is 1852, 1403<br />Coordinate System is:<br />PROJCS["UTM Zone 40, Southern Hemisphere",<br />GEOGCS["wgs84",<br />DATUM["WGS_1984",<br />SPHEROID["WGS_1984",6378137,298.257223563]],<br />PRIMEM["Greenwich",0],<br />UNIT["degree",0.0174532925199433]],<br />PROJECTION["Transverse_Mercator"],<br />PARAMETER["latitude_of_origin",0],<br />PARAMETER["central_meridian",57],<br />PARAMETER["scale_factor",0.9996],<br />PARAMETER["false_easting",500000],<br />PARAMETER["false_northing",10000000],<br />UNIT["Meter",1]]<br />Origin = (539214.000000000000000,7771490.000000000000000)<br />Pixel Size = (9.998920086393088,-9.999287241625089)<br />Corner Coordinates:<br />Upper Left ( 539214.000, 7771490.000) ( 57d22'30.86"E, 20d 9'12.53"S)<br />Lower Left ( 539214.000, 7757461.000) ( 57d22'31.96"E, 20d16'48.91"S)<br />Upper Right ( 557732.000, 7771490.000) ( 57d33' 8.76"E, 20d 9'10.85"S)<br />Lower Right ( 557732.000, 7757461.000) ( 57d33'10.37"E, 20d16'47.21"S)<br />Center ( 548473.000, 7764475.500) ( 57d27'50.49"E, 20d12'59.96"S)<br />Band 1 Block=1852x1 Type=Float64, ColorInterp=Palette<br />Min=0.000 Max=66.319 <br />NoData Value=nan<br />Metadata:<br />COLOR_TABLE_RULES_COUNT=1<br />COLOR_TABLE_RULE_RGB_0=6.631894e-01 6.631894e+01 0 240 255 0 50 170<br />Color Table (RGB with 68 entries)<br />0: 0,0,0,0<br />1: 0,240,255,255<br />2: 0,237,254,255<br />3: 0,234,252,255<br />...</p>
</blockquote>
<p>And qgis browser panel launch it fine so my question now is : how qgis browser panel, in qgis desktop, launch the raster ? Through gdal ? Through grass plugin ?</p> QGIS Application - Bug report #21854: Add Grass raster layer with pyqgis 3 crash qgishttps://issues.qgis.org/issues/21854?journal_id=1040072019-04-16T05:11:35ZSylvain POULAINsylvain.poulain@giscan.com
<ul></ul><p>Ok found here line 417 : <a class="external" href="https://trac.osgeo.org/qgis/browser/trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp">https://trac.osgeo.org/qgis/browser/trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp</a><br />Better way to load it without crash =></p>
<p>- Add Raster layer with :<br />iface.addRasterLayer("/path/to/grassdb/sector/mapset/cellhd/raster_file", "raster_name", <strong>"grassdata"</strong>)</p>
<p>You can close the ticket !</p> QGIS Application - Bug report #21854: Add Grass raster layer with pyqgis 3 crash qgishttps://issues.qgis.org/issues/21854?journal_id=1040092019-04-16T06:40:46ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Resolution</strong> set to <i>invalid</i></li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul>