Skip to content

Commit

Permalink
columns
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCaha committed Jul 18, 2024
1 parent 410d2bb commit 8c2afa5
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions los_tools/processing/to_table/tool_export_los.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
QgsProcessingUtils,
QgsWkbTypes,
)
from qgis.PyQt.QtCore import QVariant

from los_tools.classes.classes_los import LoSGlobal, LoSLocal, LoSWithoutTarget
from los_tools.constants.field_names import FieldNames
from los_tools.constants.names_constants import NamesConstants
from los_tools.processing.tools.util_functions import get_los_type
from los_tools.utils import get_doc_file
from los_tools.utils import COLUMN_TYPE, COLUMN_TYPE_STRING, get_doc_file


class ExportLoSAlgorithm(QgsProcessingAlgorithm):
Expand Down Expand Up @@ -83,24 +82,24 @@ def processAlgorithm(self, parameters, context, feedback):

fields = QgsFields()

fields.append(QgsField(FieldNames.ID_LOS, QVariant.Int))
fields.append(QgsField(FieldNames.ID_OBSERVER, QVariant.Int))
fields.append(QgsField(FieldNames.OBSERVER_OFFSET, QVariant.Double))
fields.append(QgsField(FieldNames.CSV_OBSERVER_DISTANCE, QVariant.Double))
fields.append(QgsField(FieldNames.CSV_ELEVATION, QVariant.Double))
fields.append(QgsField(FieldNames.CSV_VISIBLE, QVariant.Bool))
fields.append(QgsField(FieldNames.CSV_HORIZON, QVariant.Bool))
fields.append(QgsField(FieldNames.ID_LOS, COLUMN_TYPE.Int))
fields.append(QgsField(FieldNames.ID_OBSERVER, COLUMN_TYPE.Int))
fields.append(QgsField(FieldNames.OBSERVER_OFFSET, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.CSV_OBSERVER_DISTANCE, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.CSV_ELEVATION, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.CSV_VISIBLE, COLUMN_TYPE.Bool))
fields.append(QgsField(FieldNames.CSV_HORIZON, COLUMN_TYPE.Bool))

if los_type == NamesConstants.LOS_LOCAL:
fields.append(QgsField(FieldNames.ID_TARGET, QVariant.Int))
fields.append(QgsField(FieldNames.TARGET_OFFSET, QVariant.Double))
fields.append(QgsField(FieldNames.ID_TARGET, COLUMN_TYPE.Int))
fields.append(QgsField(FieldNames.TARGET_OFFSET, COLUMN_TYPE.Double))

elif los_type == NamesConstants.LOS_GLOBAL:
fields.append(QgsField(FieldNames.ID_TARGET, QVariant.Int))
fields.append(QgsField(FieldNames.TARGET_OFFSET, QVariant.Double))
fields.append(QgsField(FieldNames.TARGET_X, QVariant.Double))
fields.append(QgsField(FieldNames.TARGET_Y, QVariant.Double))
fields.append(QgsField(FieldNames.CSV_TARGET, QVariant.Bool))
fields.append(QgsField(FieldNames.ID_TARGET, COLUMN_TYPE.Int))
fields.append(QgsField(FieldNames.TARGET_OFFSET, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.TARGET_X, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.TARGET_Y, COLUMN_TYPE.Double))
fields.append(QgsField(FieldNames.CSV_TARGET, COLUMN_TYPE.Bool))

# elif los_type == NamesConstants.LOS_NO_TARGET:
# pass
Expand Down

0 comments on commit 8c2afa5

Please sign in to comment.