forked from timwis/jkan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdl-datasets.json
55 lines (55 loc) · 2.35 KB
/
rdl-datasets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
---
[{% for dataset in site.datasets %}
{
"title": {{ dataset.title | jsonify }},
{% if dataset.description != "" %}"description": {{ dataset.description | jsonify }},{% endif %}
{% if dataset.details != "" %}"details": {{ dataset.details | jsonify }},{% endif %}
"category": {% if dataset.risk_data_type[0] %}
[{% for cat in dataset.risk_data_type %}
{{ cat | capitalize | jsonify }}{% unless forloop.last %}, {% endunless %}
{% endfor %}]
{% else %} {{ "None" | jsonify }}
{% endif %},
"hazard_type": {% if dataset.risk_data_type[0] %}
[{% for cat in dataset.risk_data_type %}
{% assign hazard_type_code = dataset[cat]["hazard_type"] %}
{% if hazard_type_code and site.data.rdl-hazard_type[hazard_type_code] %}
{{ site.data.rdl-hazard_type[hazard_type_code] | jsonify }}{% unless forloop.last %}, {% endunless %}
{% else %}
{{ "None" | jsonify }}
{% endif %}
{% endfor %}]
{% else %}
{{ "None" | jsonify }}
{% endif %},
{% if site.data.rdl-license-name[dataset.license] %}
"license_display": {{ site.data.rdl-license-name[dataset.license] | jsonify }},
{% else %}
"license_display": {{ dataset.license | jsonify }},
{% endif %}
{% if site.data.rdl-license-url[dataset.license] %}
"license": {{ site.data.rdl-license-url[dataset.license] | jsonify }},
{% else %}
"license": "Not found",
{% endif %}
{% if dataset.creator != "" %}"creator": {{ dataset.creator | jsonify }},{% endif %}
"geo_coverage": {% if dataset.spatial.countries[0] %}
[{% for geo in dataset.spatial.countries %}
{{ site.data.ISO3[geo] | jsonify }}{% unless forloop.last %}, {% endunless %}
{% endfor %}]
{% endif %},
"geo_scale": {% if dataset.spatial.scale %}
{{ dataset.spatial.scale | capitalize | jsonify }}
{% else %}
{{ "None" | jsonify }}
{% endif %},
"url": "{{ site.baseurl }}{{ dataset.url }}",
"project": {% if dataset.project %}
{{ dataset.project | jsonify }}
{% else %}
{{ "None" | jsonify }}
{% endif %}, {% if dataset.version != "" %}"version": {{ dataset.version | jsonify }},{% endif %}
"resources": {{ dataset.resources | jsonify }}
}{% unless forloop.last %},{% endunless %}{% endfor %}
]