Skip to content
Snippets Groups Projects
Commit c43e1ade authored by leufen1's avatar leufen1
Browse files

climatic serializer can return vector not only for direction queries

parent 514d79a3
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ def get_provenance(obj): ...@@ -20,6 +20,7 @@ def get_provenance(obj):
Tel. + 44 (0)1248 374518 (direct)\n Tel. + 44 (0)1248 374518 (direct)\n
Tel. + 44 (0)1248 374500 (reception)\n Tel. + 44 (0)1248 374500 (reception)\n
E-mail: katshar@ceh.ac.uk\n\nThe climate zones are as follows:\n E-mail: katshar@ceh.ac.uk\n\nThe climate zones are as follows:\n
0 Residual class (water?)
1 Warm Temperate Moist\n 1 Warm Temperate Moist\n
2 Warm Temperate Dry\n 2 Warm Temperate Dry\n
3 Cool Temperate Moist\n 3 Cool Temperate Moist\n
...@@ -59,7 +60,20 @@ class AggSerializer(BaseSerializer): ...@@ -59,7 +60,20 @@ class AggSerializer(BaseSerializer):
except TypeError: except TypeError:
vlength = 1 vlength = 1
# TODO: check units below # TODO: check units below
for k, v in obj.items():
print(k, v)
if vlength > 1: if vlength > 1:
if obj['direction'] is None:
properties = OrderedDict([
('agg_function', agg_function),
('many', True),
(agg_function, OrderedDict([
(d, v) for d, v in zip(range(vlength), val)
])),
('units', '?'),
('radius', obj['radius']),
])
else:
properties = OrderedDict([ properties = OrderedDict([
('agg_function', agg_function), ('agg_function', agg_function),
('many', True), ('many', True),
...@@ -69,8 +83,6 @@ class AggSerializer(BaseSerializer): ...@@ -69,8 +83,6 @@ class AggSerializer(BaseSerializer):
('units', '?'), ('units', '?'),
('radius', obj['radius']), ('radius', obj['radius']),
]) ])
if obj['direction'] is None:
properties.pop('direction')
else: else:
properties = OrderedDict([ properties = OrderedDict([
('agg_function', agg_function), ('agg_function', agg_function),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment