Skip to content

Commit e59175e

Browse files
author
usplm
committed
Fixed bands parsing for false color imagery
MC-899
1 parent c00e44e commit e59175e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/api/tiler.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,7 @@ def get(self, request, pk=None, project_pk=None, tile_type="", z="", x="", y="",
321321
if bands == '': bands = None
322322
if rescale == '': rescale = None
323323
if color_map == '': color_map = None
324-
if hillshade == '' or hillshade == '0': hillshade = None
325-
326-
pattern = re.compile("([A-Z]+?[a-z]*)")
327-
input_bands = tuple(re.findall(pattern, bands))
324+
if hillshade == '' or hillshade == '0': hillshade = None
328325

329326
try:
330327
expr, _discard_ = lookup_formula(formula, bands)
@@ -387,6 +384,8 @@ def get(self, request, pk=None, project_pk=None, tile_type="", z="", x="", y="",
387384
ci.index(ColorInterp.blue) + 1,)
388385
elif 'Falsecolor' in formula and \
389386
len(formula.split('_')) >= 2: # ex. Falsecolor_NRG
387+
pattern = re.compile("([A-Z]+?[a-z]*)")
388+
input_bands = tuple(re.findall(pattern, bands))
390389
false_color_bands = tuple(re.findall(pattern, formula.split('_')[1]))
391390
if len(false_color_bands) == 3:
392391
indexes = (input_bands.index(false_color_bands[0]) + 1,

0 commit comments

Comments
 (0)