Debian Codegraph @

test/pytest_refdxdy.py

raw symbols SCIP
1 ###############################################################################
2 # pytest_refdxdy.py: Create a georeferenced image
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 jiplib as jl
17
18 parser=argparse.ArgumentParser()
19 parser.add_argument("-dx","--dx",help="spatial resolution in x (in m)",dest="dx",required=False,type=int,default=100)
20 parser.add_argument("-dy","--dy",help="spatial resolution in y (in m)",dest="dy",required=False,type=int,default=100)
21 args = parser.parse_args()
22
23 ULX=600000.0
24 ULY=4000020.0
25 LRX=709800.0
26 LRY=3890220.0
27 projection='epsg:32612'
28 dict={'ulx':ULX,'uly':ULY,'lrx':LRX,'lry':LRY,'a_srs':projection}
29 dict.update({'otype':'GDT_UInt16'})
30 dict.update({'dy':args.dy,'dx':args.dx})
31 jim0=jl.createJim(**dict)
32 if jim0.nrOfCol()!=1098:
33 print("Failed: number of cols")
34 if jim0.nrOfRow()!=1098:
35 print("Failed: number of rows")
36 else:
37 print("Success: create georeferenced image")
38 jim0.close()
39