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
|
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:

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
django-raster/raster/views.py
Lines 82 to 100 in 34fffe3
as range and entries are only added if colormap exists in the first place.
After removing
elseand unindending range and entries part, raster layer looks as expected: