Open landam opened 4 months ago
I have found QGIS Color Ramp Style format in XML. (https://plugins.qgis.org/styles/types/Color%20Ramp/) But loading this fromat into QGIS ended up with error.
This format also ended with error after loading:
# QGIS Generated Color Map Export File
INTERPOLATION:INTERPOLATED
359.80078129999998282,247,251,255,255,359.8008
367.17993961899998112,222,235,247,255,367.1799
374.55909793799997942,198,219,239,255,374.5591
381.93825625699997772,158,202,225,255,381.9383
389.31741457599997602,107,174,214,255,389.3174
396.69657289500003117,66,146,198,255,396.6966
404.07573121400002947,33,113,181,255,404.0757
410.88726196999999729,8,81,156,255,410.8873
416.56353760000001785,8,48,107,255,416.5635
error occurred while parsing element
Here is a hint on how to write a singleband pseudocolor qml. The main part lies in property rasterrenderer
.
Singleband pseudocolor:
<rasterrenderer alphaBand="-1" classificationMin="139.7902832" type="singlebandpseudocolor" opacity="1" band="1" classificationMax="664.6478882" nodataColor="">
<rasterTransparency/>
<minMaxOrigin>
<limits>MinMax</limits>
<extent>WholeRaster</extent>
<statAccuracy>Estimated</statAccuracy>
<cumulativeCutLower>0.02</cumulativeCutLower>
<cumulativeCutUpper>0.98</cumulativeCutUpper>
<stdDevFactor>2</stdDevFactor>
</minMaxOrigin>
<rastershader>
<colorrampshader classificationMode="1" clip="0" minimumValue="139.7902832" labelPrecision="4" colorRampType="INTERPOLATED" maximumValue="664.64788820000001">
<colorramp name="[source]" type="gradient">
<Option type="Map">
<Option name="color1" type="QString" value="247,251,255,255"/>
<Option name="color2" type="QString" value="8,48,107,255"/>
<Option name="direction" type="QString" value="ccw"/>
<Option name="discrete" type="QString" value="0"/>
<Option name="rampType" type="QString" value="gradient"/>
<Option name="spec" type="QString" value="rgb"/>
<Option name="stops" type="QString" value="0.13;222,235,247,255;rgb;ccw:0.26;198,219,239,255;rgb;ccw:0.39;158,202,225,255;rgb;ccw:0.52;107,174,214,255;rgb;ccw:0.65;66,146,198,255;rgb;ccw:0.78;33,113,181,255;rgb;ccw:0.9;8,81,156,255;rgb;ccw"/>
</Option>
</colorramp>
<item alpha="255" color="#f7fbff" value="139.790283203125" label="139,7903"/>
<item alpha="255" color="#deebf7" value="208.02177185058594" label="208,0218"/>
<item alpha="255" color="#c6dbef" value="276.25326049804687" label="276,2533"/>
<item alpha="255" color="#9ecae1" value="344.4847491455078" label="344,4847"/>
<item alpha="255" color="#6baed6" value="412.71623779296874" label="412,7162"/>
<item alpha="255" color="#4292c6" value="480.9477264404297" label="480,9477"/>
<item alpha="255" color="#2171b5" value="549.1792150878906" label="549,1792"/>
<item alpha="255" color="#08519c" value="612.1621276855469" label="612,1621"/>
<item alpha="255" color="#08306b" value="664.6478881835938" label="664,6479"/>
<rampLegendSettings maximumLabel="" useContinuousLegend="1" suffix="" orientation="2" minimumLabel="" direction="0" prefix="">
<numericFormat id="basic">
<Option type="Map">
<Option name="decimal_separator" type="invalid"/>
<Option name="decimals" type="int" value="6"/>
<Option name="rounding_type" type="int" value="0"/>
<Option name="show_plus" type="bool" value="false"/>
<Option name="show_thousand_separator" type="bool" value="true"/>
<Option name="show_trailing_zeros" type="bool" value="false"/>
<Option name="thousand_separator" type="invalid"/>
</Option>
</numericFormat>
</rampLegendSettings>
</colorrampshader>
</rastershader>
</rasterrenderer>
Unique values:
<rasterrenderer alphaBand="-1" type="paletted" opacity="1" band="1" nodataColor="">
<rasterTransparency/>
<minMaxOrigin>
<limits>None</limits>
<extent>WholeRaster</extent>
<statAccuracy>Estimated</statAccuracy>
<cumulativeCutLower>0.02</cumulativeCutLower>
<cumulativeCutUpper>0.98</cumulativeCutUpper>
<stdDevFactor>2</stdDevFactor>
</minMaxOrigin>
<colorPalette>
<paletteEntry alpha="255" color="#000000" value="-11000" label="-11000"/>
<paletteEntry alpha="255" color="#00000a" value="-500" label="-500"/>
<paletteEntry alpha="255" color="#000014" value="-300" label="-300"/>
<paletteEntry alpha="255" color="#000046" value="-200" label="-200"/>
<paletteEntry alpha="255" color="#000082" value="-100" label="-100"/>
<paletteEntry alpha="255" color="#0000cd" value="-50" label="-50"/>
<paletteEntry alpha="255" color="#6480ff" value="0" label="0"/>
<paletteEntry alpha="255" color="#399769" value="0.10000000000000001" label="0.1"/>
<paletteEntry alpha="255" color="#75c25d" value="100" label="100"/>
<paletteEntry alpha="255" color="#e6e680" value="200" label="200"/>
<paletteEntry alpha="255" color="#ca9e4b" value="500" label="500"/>
<paletteEntry alpha="255" color="#d6bb62" value="1000" label="1000"/>
<paletteEntry alpha="255" color="#b99a64" value="2000" label="2000"/>
<paletteEntry alpha="255" color="#dcdcdc" value="3000" label="3000"/>
<paletteEntry alpha="255" color="#fafafa" value="5000" label="5000"/>
<paletteEntry alpha="255" color="#ffffff" value="8850" label="8850"/>
<paletteEntry alpha="255" color="#ffffff" value="0" label="nv"/>
</colorPalette>
<colorramp name="[source]" type="randomcolors">
<Option/>
</colorramp>
</rasterrenderer>
Currently, relative values are not treated correctly. Example for
elevation
color table applied in QGIS: