[GRASS-SVN] r70112 - grass-addons/grass7/raster/r.colors.out_sld

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 21 07:49:05 PST 2016


Author: lucadelu
Date: 2016-12-21 07:49:05 -0800 (Wed, 21 Dec 2016)
New Revision: 70112

Modified:
   grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.html
   grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.py
Log:
r.colors.out_sld: applied patches from Paulo van Breugel, fixed HTML documentation and resolved a bug with no cotagories raster

Modified: grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.html
===================================================================
--- grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.html	2016-12-21 11:40:42 UTC (rev 70111)
+++ grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.html	2016-12-21 15:49:05 UTC (rev 70112)
@@ -1,36 +1,31 @@
 <h2>DESCRIPTION:</h2>
-<p>The module <em>r.colors.out_sld</em> exports the colors of a raster map into 
-the Styled Layer Description (SLD) format according to OGC standard.</p>
-For raster maps of tyoe CELL also lables are exported. The export if lables 
-requires that the input map is read and may thus take a bit longer than the 
-export of contious color rules (ramp).</p>
-<p>Currently only SLD v1.0.0 is implemented.</p>
 
-<div id="examples">
+The module <em>r.colors.out_sld</em> exports the colors of a raster map into
+the Styled Layer Description (SLD) format according to OGC standard.
 
+<p>For raster maps of tyoe CELL also lables are exported. The export if lables
+requires that the input map is read and may thus take a bit longer than the
+export of contious color rules (ramp).
+
+<p>Currently only SLD v1.0.0 is implemented.
+
 <h2>EXAMPLES:</h2>
-<div class="code"><pre>
-# Exporting a color ramp
-r.out.colors_sld map=Testmap style_name=Celsius
 
-</pre></div>
+<div class="code">
+<pre># Exporting a color ramp
+r.out.colors_sld map=Testmap style_name=Celsius</pre>
 </div>
 
-<div id="seealso">
-
 <h2>SEE ALSO:</h2>
+
 <a href="r.colors.out.html">r.colors.out</a>
-</div>
 
-<div id="references">
-
 <h2>REFERENCES:</h2>
+
 <a href="http://www.opengeospatial.org/standards/sld">
 http://www.opengeospatial.org/standards/sld</a><br></div>
 
-<div id="author">
-
 <h2>AUTHORS:</h2>
+
 Hamish Bowman<br>
 Stefan Blumentrath, Norwegian Institute for Nature Research, Oslo, Norway<br>
-</div>

Modified: grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.py
===================================================================
--- grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.py	2016-12-21 11:40:42 UTC (rev 70111)
+++ grass-addons/grass7/raster/r.colors.out_sld/r.colors.out_sld.py	2016-12-21 15:49:05 UTC (rev 70112)
@@ -99,8 +99,12 @@
     if maptype == 'CELL':
         grass.verbose('Reading category lables, may take a while...')
         categories = grass.parse_command('r.category', map=map, separator='=')
-    if list(set(categories.values()))[0] or len(list(set(categories.values()))) > 1:
-        use_categories = True
+        if list(set(categories.values()))[0] or len(list(set(categories.values()))) > 1:
+            use_categories = True
+        else:
+            use_categories = False
+    else:
+        use_categories = False
 
     # Initialize SLD with header
     sld = u"""<?xml version="1.0" encoding="UTF-8"?>



More information about the grass-commit mailing list