@@ -22,6 +22,7 @@ def positive_small_int(argstring):
2222 raise ArgumentTypeError ("--rate must be positive integer < 50" )
2323 return intval
2424
25+
2526DESCRIPTION = """Stiches SRTM .hgt files to make (upsampled) DEM
2627
2728 Pick a lat/lon bounding box for a DEM, and it will download
@@ -145,23 +146,25 @@ def get_cli_args():
145146 parser .add_argument (
146147 "--cache-dir" ,
147148 help = (
148- "Location to save downloaded files (Default = {})" .format (utils .get_cache_dir ())
149+ "Location to save downloaded files (Default = {})" .format (
150+ utils .get_cache_dir ()
151+ )
149152 ),
150153 )
151154 parser .add_argument (
152155 "--output-format" ,
153156 "-of" ,
154157 choices = ["ENVI" , "GTiff" , "ROI_PAC" ],
155158 default = "ENVI" ,
156- help = "Output format (for copernicus DEM option, default %(default)s)."
159+ help = "Output format (for copernicus DEM option, default %(default)s)." ,
157160 )
158161 parser .add_argument (
159162 "--output-type" ,
160163 "-ot" ,
161- choices = ["int16" , "float32" ],
164+ choices = ["int16" , "float32" , "uint8" ],
162165 type = str .lower ,
163166 default = "int16" ,
164- help = "Output data type (default %(default)s)."
167+ help = "Output data type (default %(default)s)." ,
165168 )
166169 return parser .parse_args ()
167170
@@ -194,14 +197,18 @@ def cli():
194197 bbox = args .bbox
195198 else :
196199 bbox = None
197-
200+
198201 if not args .output :
199202 output = (
200- "watermask.wbd " if args .data_source == "NASA_WATER" else "elevation.dem"
203+ "watermask.flg " if args .data_source == "NASA_WATER" else "elevation.dem"
201204 )
202205 else :
203206 output = args .output
204207
208+ # Force the water mask to be uint8
209+ if args .data_source == "NASA_WATER" :
210+ args .output_type = "uint8"
211+
205212 sardem .dem .main (
206213 output_name = output ,
207214 bbox = bbox ,
0 commit comments