@@ -125,7 +125,8 @@ def show(ctx, identifier, verbosity):
125125 help = 'station type' )
126126@click .option ('-n' , '--name' , 'name' , required = True , help = 'name' )
127127@click .option ('-gi' , '--gaw-id' , 'gaw_id' , required = True , help = 'GAW ID' )
128- @click .option ('-c' , '--country' , 'country' , required = True , help = 'country' )
128+ @click .option ('-c' , '--country-id' , 'country_id' , required = True ,
129+ help = 'country ID, ex: "CAN"' )
129130@click .option ('-w' , '--wmo-region' , 'wmo_region' , required = True ,
130131 help = 'WMO region' )
131132@click .option ('-sd' , '--start-date' , 'start_date' , required = True ,
@@ -134,7 +135,7 @@ def show(ctx, identifier, verbosity):
134135 help = 'end date' )
135136@click .option ('-g' , '--geometry' , 'geometry' , required = True ,
136137 help = 'latitude,longitude,elevation' )
137- def add (ctx , identifier , name , type_ , gaw_id , country ,
138+ def add (ctx , identifier , name , type_ , gaw_id , country_id ,
138139 wmo_region , start_date , end_date , geometry , verbosity ):
139140 """Add a station"""
140141
@@ -145,13 +146,13 @@ def add(ctx, identifier, name, type_, gaw_id, country,
145146 'station_name' : name ,
146147 'station_type' : type_ ,
147148 'gaw_id' : gaw_id ,
148- 'country_id' : country ,
149+ 'country_id' : country_id ,
149150 'wmo_region_id' : wmo_region ,
150151 'start_date' : start_date ,
151152 'end_date' : end_date ,
152- 'x' : geom_tokens [1 ],
153- 'y' : geom_tokens [0 ],
154- 'z' : geom_tokens [2 ]
153+ 'x' : float ( geom_tokens [1 ]. strip ()) ,
154+ 'y' : float ( geom_tokens [0 ]. strip ()) ,
155+ 'z' : float ( geom_tokens [2 ]. strip ())
155156 }
156157
157158 add_metadata (Station , station_ , save_to_registry , save_to_index )
@@ -166,13 +167,13 @@ def add(ctx, identifier, name, type_, gaw_id, country,
166167@click .option ('-t' , '--type' , 'type_' , help = 'station type' )
167168@click .option ('-n' , '--name' , 'name' , help = 'name' )
168169@click .option ('-gi' , '--gaw-id' , 'gaw_id' , help = 'GAW ID' )
169- @click .option ('-c' , '--country' , 'country ' , help = 'country' )
170+ @click .option ('-c' , '--country-id ' , 'country_id ' , help = 'country ID, ex: "CAN" ' )
170171@click .option ('-w' , '--wmo-region' , 'wmo_region' , help = 'WMO region' )
171172@click .option ('-sd' , '--start-date' , 'start_date' , help = 'start date' )
172173@click .option ('-ed' , '--end-date' , 'end_date' , help = 'end date' )
173174@click .option ('-g' , '--geometry' , 'geometry' ,
174175 help = 'latitude,longitude,elevation' )
175- def update (ctx , identifier , name , type_ , gaw_id , country ,
176+ def update (ctx , identifier , name , type_ , gaw_id , country_id ,
176177 wmo_region , start_date , end_date , geometry , verbosity ):
177178 """Update station information"""
178179
@@ -187,8 +188,8 @@ def update(ctx, identifier, name, type_, gaw_id, country,
187188 station_ ['station_type' ] = type_
188189 if gaw_id :
189190 station_ ['gaw_id' ] = gaw_id
190- if country :
191- station_ ['country_id' ] = country
191+ if country_id :
192+ station_ ['country_id' ] = country_id
192193 if wmo_region :
193194 station_ ['wmo_region_id' ] = wmo_region
194195 if start_date :
0 commit comments