File: pytest_refdxdy.py

package info (click to toggle)
jeolib-jiplib 1.1.6%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,028 kB
  • sloc: cpp: 40,743; python: 2,784; sh: 49; makefile: 24; ansic: 5
file content (39 lines) | stat: -rw-r--r-- 1,246 bytes parent folder | download
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
###############################################################################
# pytest_refdxdy.py: Create a georeferenced image
# Author(s): Pieter.Kempeneers@ec.europa.eu
# Copyright (c) 2016-2019 European Union (Joint Research Centre)
# License EUPLv1.2
# 
# This file is part of jiplib
###############################################################################

# History
# 2017/10/23 - Created by Pieter Kempeneers (pieter.kempeneers@ec.europa.eu)
# Change log


import argparse
import jiplib as jl

parser=argparse.ArgumentParser()
parser.add_argument("-dx","--dx",help="spatial resolution in x (in m)",dest="dx",required=False,type=int,default=100)
parser.add_argument("-dy","--dy",help="spatial resolution in y (in m)",dest="dy",required=False,type=int,default=100)
args = parser.parse_args()

ULX=600000.0
ULY=4000020.0
LRX=709800.0
LRY=3890220.0
projection='epsg:32612'
dict={'ulx':ULX,'uly':ULY,'lrx':LRX,'lry':LRY,'a_srs':projection}
dict.update({'otype':'GDT_UInt16'})
dict.update({'dy':args.dy,'dx':args.dx})
jim0=jl.createJim(**dict)
if jim0.nrOfCol()!=1098:
    print("Failed: number of cols")
if jim0.nrOfRow()!=1098:
    print("Failed: number of rows")
else:
    print("Success: create georeferenced image")
jim0.close()