Skip to content

Commit

Permalink
r.colors.out_sld: add percent counter (#688)
Browse files Browse the repository at this point in the history
* r.colors.out_sld: add percent counter
* code shortened

Co-authored-by: Stefan Blumentrath <stefan.blumentrath@gmx.de>
  • Loading branch information
neteler and ninsbl committed Feb 14, 2022
1 parent d2f59dd commit a43c8f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/raster/r.colors.out_sld/r.colors.out_sld.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def main():
use_categories = False

# Initialize SLD with header
sld = u"""<?xml version="1.0" encoding="UTF-8"?>
sld = """<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
Expand Down Expand Up @@ -144,8 +144,9 @@ def main():
# sld+=' <ColorMap type={}>\n'.format('"ramp"')
ColorMapEntry = ' <ColorMapEntry color="#{0:02x}{1:02x}{2:02x}" quantity="{3}" opacity="{4}" />\n'

#
for c in color_rules:
# loop over colors
for num, c in enumerate(color_rules):
grass.percent(num + 1, len(color_rules), 1)
if len(c.split(" ")) == 2 and not c.split(" ")[0] == "default":
q = c.split(" ")[0]
if q == "nv":
Expand Down

0 comments on commit a43c8f6

Please sign in to comment.