https://issues.qgis.org/https://issues.qgis.org/favicon.ico2012-06-07T06:56:27ZQGIS Issue TrackingQGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=326432012-06-07T06:56:27ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>From Markus Metz, GRASS mailing list:</p>
<blockquote>
<p>An alternative would be to make use of the GDAL raster attribute table in both GRASS and QGIS, with the benefit that reading labels for other raster maps imported with GDAL would also be supported.</p>
</blockquote>
<blockquote>
<p>IIUC, QGIS is currently using GDALGetRasterCategoryNames() which has very limited functionality and supports only integer maps. In a GDAL raster attribute table, as with GRASS-internal categories, floating point values and data ranges are supported, e.g.</p>
</blockquote>
<blockquote>
<p>min=358.5, max=359.5, name=359 degrees ccw from east</p>
</blockquote>
<blockquote>
<p>A GDAL raster attribute table would also solve the problem of importing/exporting color rules for floating point data types.</p>
</blockquote> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=464232013-11-17T06:48:25ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>Paolo Cavallini wrote:</p>
<blockquote>
<p>From Markus Metz, GRASS mailing list:
===<br />An alternative would be to make use of the GDAL raster attribute table<br />in both GRASS and QGIS, with the benefit that reading labels for other<br />raster maps imported with GDAL would also be supported.</p>
<p>IIUC, QGIS is currently using GDALGetRasterCategoryNames() which has<br />very limited functionality and supports only integer maps. In a GDAL<br />raster attribute table, as with GRASS-internal categories, floating<br />point values and data ranges are supported, e.g.</p>
<p>min=358.5, max=359.5, name=359 degrees ccw from east</p>
<p>A GDAL raster attribute table would also solve the problem of<br />importing/exporting color rules for floating point data types.</p>
</blockquote>
<p>may be this has been implemented n qgis?</p>
<p>see</p>
<p>#8bdaf42dbaec240151eacaa9a28e02f49a53fd66</p> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=464302013-11-17T21:36:24ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>I think more work has to be done on the Processing side, to add these options to the export command.</p> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=557842014-10-04T09:52:29ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Category</strong> deleted (<del><i>59</i></del>)</li><li><strong>Project</strong> changed from <i>78</i> to <i>QGIS Application</i></li></ul> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=558042014-10-04T09:53:27ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Category</strong> set to <i>Processing/GRASS</i></li></ul> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=683952016-02-19T10:29:21ZMédéric RIBREUX
<ul></ul><p>Hello,</p>
<p>after some work on r.category implementation, I've found that in GRASS7 (and only GRASS7), you can use the '-t' parameter for r.out.gdal (command that is internally used by Processing GRASS) to export raster labels. Labels are exported in GDAL Raster Attribute Table (RAT). The RAT takes the form of an xml file named after the raster filename concatenated with '.aux.xml'.</p>
<p>For the moment, QGIS raster provider can't use the values that are in the RAT. The only thing that QGIS uses for rasters are GDAL categories (and only for integer rasters). But we can make Processing GRASS algorithms to export raster labels just by adding the '-t' parameter to every r.out.gdal output (for the default case).</p>
<p>For importing labels and keeping labels, this is a little bit more complex: it seems that only r.in.gdal (which duplicates the raster) can import labels into GRASS7 (but the import is complete from the RAT and very well integrated into GRASS database). Processing uses r.external for raster imports (because it just makes a link to the raster file, there is no data duplication). We have different choices (as far as I can see):</p>
<ul>
<li>replace r.external to r.in.gdal by default (everywhere) with the drawback to always duplicate data (but some of GRASS7 algorithms need to use r.in.gdal instead of r.External).</li>
<li>use only r.in.gdal for some algorithms (r.category, r.reclass): implementation can be made with the 'ext' mechanism so no need to change main Grass7Algorithm.py.</li>
<li>add an (virtual) option as a checkbox in every algorithm dialog box which could be entitled like: 'preserve raster labels (warning: duplicates raster data in temporary GRASS database)'. If the user checks the box, use r.in.gdal instead of r.external (just some lines to add in Grass7Algorithm.py and for the GUI). It would be like the region extent or the cell size options.</li>
<li>add a new general option for GRASS7 for 'preserve raster labels' which define if user want to import labels by default.</li>
<li>both of the two last points.</li>
<li>do nothing and open a GRASS7 ticket to add label preservation for r.external !</li>
</ul>
<p>What do you think about this ? Feel free to add any other choice or just your opinion...</p> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=683992016-02-19T10:49:10ZPaolo Cavallinicavallini@faunalia.it
<ul></ul><p>IMHO the last option is the best one.</p> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=688972016-03-13T07:53:09ZMédéric RIBREUX
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Open</i></li></ul><p>Ok, I have opened <a href="https://trac.osgeo.org/grass/ticket/2963" class="external">a ticket into GRASS bugtracker for r.external</a>...</p>
<p>On QGIS side, we need to add '-t' option for r.out.gdal command in Grass7Algorithm.py. I'll do it once <a href="https://github.com/qgis/QGIS/pull/2865" class="external">my global r.* Pull-Request</a> will be merged.</p> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=770312017-04-30T22:48:38ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Easy fix?</strong> set to <i>No</i></li></ul> QGIS Application - Feature request #5742: Preserve GRASS raster labelshttps://issues.qgis.org/issues/5742?journal_id=873942018-02-23T18:11:18ZPaolo Cavallinicavallini@faunalia.it
<ul><li><strong>Assignee</strong> deleted (<del><i>Victor Olaya</i></del>)</li><li><strong>Description</strong> updated (<a href="/journals/diff/87394?detail_id=76095" title="View differences">diff</a>)</li></ul><p>Still true in Q3</p>