Debian Codegraph @

test/pytest_write.py

raw symbols SCIP
1 ###############################################################################
2 # pytest_write.py: open raster dataset and write to file
3 # Author(s): [email protected]
4 # Copyright (c) 2016-2019 European Union (Joint Research Centre)
5 # License EUPLv1.2
6 #
7 # This file is part of jiplib
8 ###############################################################################
9
10 # History
11 # 2017/10/23 - Created by Pieter Kempeneers ([email protected])
12 # Change log
13
14
15 import argparse
16 import os
17 import jiplib as jl
18
19 parser=argparse.ArgumentParser()
20 parser.add_argument("-input","--input",help="Path of the input file",dest="input",required=True,type=str)
21 parser.add_argument("-output","--output",help="Path of the output file",dest="output",required=True,type=str)
22 args = parser.parse_args()
23
24 try:
25 jim0=jl.createJim(args.input)
26 jim0.write({'filename':args.output, 'oformat': 'GTiff', 'co':['COMPRESS=LZW','TILED=YES']}).close()
27 if os.path.isfile(args.output):
28 print("Success: write to file")
29 else:
30 throw()
31 except:
32 print("Failed: write()")
33