-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_meta_generator.py
executable file
·40 lines (29 loc) · 1.06 KB
/
run_meta_generator.py
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
# create all meta
import parse_c4i_catalog
import clipc_metadata_wizard
# generates metadata inspire compliant xmls
# output: metadata dir
#climate4impact catalogue used to extract clipc meta
catalog_url = "http://opendap.knmi.nl/knmi/thredds/catalog/"
project_url = "CLIPC/tier1_indicators/icclim_cerfacs/catalog.xml"
# template based on inspire compliant metadata xml used.
#
template_inspire_metadata = 'xml.template_inspire_metadata'
target = "metadata/"
count = 0
(layer , links) = parse_c4i_catalog.readcatalogB(catalog_url,project_url)
for i in links:
print count
print i
if(count > 1 ):
print layer[count-1]
for j in parse_c4i_catalog.readcatalog2B(catalog_url,i):
jname = j.replace("http://opendap.knmi.nl/knmi/thredds/catalog/CLIPC/tier1_indicators/icclim_cerfacs/","")\
.replace("/catalog.xml","")\
.replace("/","_")\
.replace("-","_")
print " ", jname
# activate for live generation...
clipc_metadata_wizard.createCSW(template_inspire_metadata, catalog_url , j, target+jname+".xml",layer[count-1],jname)
count += 1
print "end."