forked from HAFL-WWI/pyFINT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typedefs.py
70 lines (62 loc) · 1.97 KB
/
typedefs.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
######################################################################
# This script is based on the software FINT (C++ implementation v1.10
# from July 2017; (C) ecorisQ - Luuk Dorren, Nicolas Zuanon)
#
# Copyright (C) 2021 ecorisQ
# Use of this source code is governed by an MIT-style license that can be found in the LICENSE
# file or at https://opensource.org/licenses/MIT.
#
# Author: Christoph Schaller, BFH-HAFL, December 2020
#
# Script with type definitions used by FINT.
######################################################################
from enum import Enum
class ModelFileFormatType(Enum):
ModelFileFormatUndef = 1
ModelFileFormatAscii = 2
ModelFileFormatTiff = 3
class MessageType(Enum):
info = 0
warning = 1
error = 2
class SSpatialReference(Enum):
undefined = 1
corner = 2
center = 3
class SpatialReferenceType(Enum):
spatialReferenceUndefined = 1
spatialReferenceCorner = 2
spatialReferenceCenter = 3
spatialReferenceMaxIndex = 4
class FieldModelDescription:
nbRows = None
nbCols = None
xCoord = None
yCoord = None
cellSize = None
noDataValue = None
spatialReference = None
def __init__ (self, rows=0, cols=0, x=0.0, y=0.0, cell_size=-0.0, no_data_value=None,spatial_reference=SpatialReferenceType.spatialReferenceUndefined):
self.nbRows = rows
self.nbCols = cols
self.xCoord = x
self.yCoord = y
self.cellSize = cell_size
self.noDataValue = no_data_value
self.spatialReference = spatial_reference
class TreeData:
m_xCoord = None
m_yCoord = None
m_dominance = None
m_height = None
m_height_modified = None
m_altitude = None
m_diameter = None
def __init__ (self, x=0.0, y=0.0, d=0, h=-1.0, h_mod=-1.0, a=-0.0):
self.m_xCoord = x
self.m_yCoord = y
self.m_dominance = d
self.m_height = h
self.m_height_modified = h_mod
self.m_altitude = a
self.m_diameter = -1.0