Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GeoPEAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
toar-data
GeoPEAS
Commits
5fab975c
Commit
5fab975c
authored
5 years ago
by
leufen1
Browse files
Options
Downloads
Patches
Plain Diff
added meta data. dataset name and download date are still missing
parent
487b51e9
No related branches found
No related tags found
2 merge requests
!8
New App wheat production
,
!6
Resolve "New App: Wheat Production"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wheat_production/serializers.py
+11
-6
11 additions, 6 deletions
wheat_production/serializers.py
with
11 additions
and
6 deletions
wheat_production/serializers.py
+
11
−
6
View file @
5fab975c
...
...
@@ -9,12 +9,17 @@ from rest_framework.serializers import BaseSerializer
# helper functions
def
get_provenance
(
obj
):
"""
construct provenance information on
population density
dataset
"""
"""
construct provenance information on
wheat production
dataset
"""
prov
=
OrderedDict
([
(
'
dataset_name
'
,
'
?
'
),
(
'
dataset_description
'
,
"""
Wheat production ?
"""
),
(
'
data_source
'
,
"""
?
"""
),
(
'
datacenter_url
'
,
'
?
'
),
(
'
dataset_description
'
,
"""
Wheat production values for the globe at 5 arc minute resolution. The data are in
units of production (irrigated + non-irrigated) in thousand tonnes.
\n
The data were downloaded from the GAEZ
data portal ( http://gaez.fao.org/Main.html# ) and then output to ascii text format by:
\n
Dr Katrina Sharps
\n
Centre for Ecology & Hydrology, Environment Centre Wales, UK
\n
Tel. + 44 (0)1248 374518 (direct)
\n
Tel. + 44 (0)1248 374500 (reception)
\n
E-mail: katshar@ceh.ac.uk
"""
),
(
'
data_source
'
,
"""
Dr Katrina Sharps
\n
Centre for Ecology & Hydrology, Environment Centre Wales, UK
\n
Tel. + 44 (0)1248 374518 (direct)
\n
Tel. + 44 (0)1248 374500 (reception)
\n
E-mail: katshar@ceh.ac.uk
"""
),
(
'
datacenter_url
'
,
'
http://gaez.fao.org/Main.html
'
),
(
'
download_date
'
,
'
?
'
),
(
'
timestamp
'
,
dt
.
datetime
.
now
().
isoformat
())
])
...
...
@@ -45,7 +50,7 @@ class AggSerializer(BaseSerializer):
(
agg_function
,
OrderedDict
([
(
d
,
v
)
for
d
,
v
in
zip
(
obj
[
'
direction
'
],
val
)
])),
(
'
units
'
,
'
k
m-2
'
),
(
'
units
'
,
'
k
t
'
),
(
'
radius
'
,
obj
[
'
radius
'
]),
])
if
obj
[
'
direction
'
]
is
None
:
...
...
@@ -55,7 +60,7 @@ class AggSerializer(BaseSerializer):
(
'
agg_function
'
,
agg_function
),
(
'
many
'
,
False
),
(
agg_function
,
val
),
(
'
units
'
,
'
k
m-2
'
),
(
'
units
'
,
'
k
t
'
),
(
'
radius
'
,
obj
[
'
radius
'
]),
(
'
direction
'
,
obj
[
'
direction
'
]),
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment