-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding initial implementation of raster styles:
Adding models, objects and renderer factories for a proof of concept
- Loading branch information
1 parent
c7f709c
commit b6752d6
Showing
10 changed files
with
514 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xmlns:ogc="http://www.opengis.net/ogc"> | ||
<UserLayer> | ||
<sld:LayerFeatureConstraints> | ||
<sld:FeatureTypeConstraint/> | ||
</sld:LayerFeatureConstraints> | ||
<sld:UserStyle> | ||
<sld:Name>S2B_30UUG_20221226_0_L2A_scl</sld:Name> | ||
<sld:FeatureTypeStyle> | ||
<sld:Rule> | ||
<sld:RasterSymbolizer> | ||
<sld:ChannelSelection> | ||
<sld:GrayChannel> | ||
<sld:SourceChannelName>1</sld:SourceChannelName> | ||
</sld:GrayChannel> | ||
</sld:ChannelSelection> | ||
<sld:ColorMap type="values"> | ||
<sld:ColorMapEntry color="#000000" quantity="0" label="NO_DATA"/> | ||
<sld:ColorMapEntry color="#ff0000" quantity="1" label="SATURATED_OR_DEFECTIVE"/> | ||
<sld:ColorMapEntry color="#2e2e2e" quantity="2" label="DARK_AREA_PIXELS"/> | ||
<sld:ColorMapEntry color="#541800" quantity="3" label="CLOUD_SHADOWS"/> | ||
<sld:ColorMapEntry color="#46e800" quantity="4" label="VEGETATION"/> | ||
<sld:ColorMapEntry color="#ffff00" quantity="5" label="NOT_VEGETATED"/> | ||
<sld:ColorMapEntry color="#0000ff" quantity="6" label="WATER"/> | ||
<sld:ColorMapEntry color="#525252" quantity="7" label="UNCLASSIFIED"/> | ||
<sld:ColorMapEntry color="#787878" quantity="8" label="CLOUD_MEDIUM_PROBABILITY"/> | ||
<sld:ColorMapEntry color="#b5b5b5" quantity="9" label="CLOUD_HIGH_PROBABILITY"/> | ||
<sld:ColorMapEntry color="#00b6bf" quantity="10" label="THIN_CIRRUS"/> | ||
<sld:ColorMapEntry color="#da00f2" quantity="11" label="SNOW"/> | ||
</sld:ColorMap> | ||
</sld:RasterSymbolizer> | ||
</sld:Rule> | ||
</sld:FeatureTypeStyle> | ||
</sld:UserStyle> | ||
</UserLayer> | ||
</StyledLayerDescriptor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[{ | ||
"bands": [ | ||
{ | ||
"definition": "http://www.opengis.net/def/property/OGC/0/Radiance", | ||
"description": "SCL", | ||
"gdal_interpretation": "gray", | ||
"identifier": "scl", | ||
"name": "scl", | ||
"nil_values": [ | ||
{ | ||
"reason": "http://www.opengis.net/def/nil/OGC/0/unknown", | ||
"value": 0 | ||
} | ||
], | ||
"uom": "nil", | ||
"significant_figures": 2, | ||
"allowed_value_ranges": [ | ||
[0, 11] | ||
] | ||
} | ||
], | ||
"data_type": "Byte", | ||
"name": "SCL" | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from eoxserver.render.colors import COLOR_SCALES | ||
from eoxserver.render.browse.objects import RasterStyle, RasterStyleColorEntry | ||
|
||
DEFAULT_RASTER_STYLES = {} | ||
|
||
for name, entries in COLOR_SCALES.items(): | ||
DEFAULT_RASTER_STYLES[name] = RasterStyle( | ||
name, | ||
"ramp", | ||
[ | ||
RasterStyleColorEntry(i, color) | ||
for i, color in entries | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.