-
Couldn't load subscription status.
- Fork 39
Open
Description
Default colormap (if not setting up a legend) is not working properly (no range attribute set).
This leads to color artefacts like this:

This is related to code in
Lines 82 to 100 in 34fffe3
| if not colormap: | |
| # Use a continous grayscale color scheme. | |
| colormap = { | |
| 'continuous': True, | |
| 'from': (0, 0, 0), | |
| 'to': (255, 255, 255), | |
| } | |
| else: | |
| # Add layer level value range to continuous colormaps if it was | |
| # not provided manually. | |
| if 'continuous' in colormap and 'range' not in colormap: | |
| meta = RasterLayerBandMetadata.objects.filter(rasterlayer_id=self.kwargs.get('layer')).first() | |
| if meta: | |
| colormap['range'] = (meta.min, meta.max) | |
| # Filter by custom entries if requested | |
| if colormap and 'entries' in self.request.GET: | |
| entries = self.request.GET['entries'].split(',') | |
| colormap = {k: v for (k, v) in colormap.items() if str(k) in entries} |
as range and entries are only added if colormap exists in the first place.
After removing
else and unindending range and entries part, raster layer looks as expected:
Metadata
Metadata
Assignees
Labels
No labels