From 4cf480b225f874028dd0297ac9476f645d732b80 Mon Sep 17 00:00:00 2001 From: Emanuele Gissi Date: Mon, 31 Jul 2023 19:26:31 +0200 Subject: [PATCH] Restore utils.py and small fixes --- qgis2fds_algorithm.py | 2 +- qgis2fds_export_algo.py | 4 ++-- types/domain.py | 8 ++++---- types/landuse.py | 1 - types/terrain.py | 2 -- utilities.py => types/utils.py | 0 6 files changed, 7 insertions(+), 10 deletions(-) rename utilities.py => types/utils.py (100%) diff --git a/qgis2fds_algorithm.py b/qgis2fds_algorithm.py index 8de8b52..ee486d5 100644 --- a/qgis2fds_algorithm.py +++ b/qgis2fds_algorithm.py @@ -34,7 +34,6 @@ import os, sys from .types import ( - utils, FDSCase, Domain, OBSTTerrain, @@ -42,6 +41,7 @@ LanduseType, Texture, Wind, + utils, ) from . import algos import processing diff --git a/qgis2fds_export_algo.py b/qgis2fds_export_algo.py index 4adf280..69bfa22 100644 --- a/qgis2fds_export_algo.py +++ b/qgis2fds_export_algo.py @@ -23,7 +23,7 @@ ) import processing, math from .qgis2fds_params import * -from . import utilities +from .types import utils DEBUG = True @@ -150,7 +150,7 @@ def processAlgorithm(self, parameters, context, model_feedback): wgs84_origin = origin.clone() wgs84_origin.transform(prj_to_wgs84_tr) - utm_epsg = utilities.lonlat_to_epsg(lon=wgs84_origin.x(), lat=wgs84_origin.y()) + utm_epsg = utils.lonlat_to_epsg(lon=wgs84_origin.x(), lat=wgs84_origin.y()) utm_crs = QgsCoordinateReferenceSystem(utm_epsg) wgs84_to_utm_tr = QgsCoordinateTransform(wgs84_crs, utm_crs, project) utm_origin = wgs84_origin.clone() # FIXME better way? diff --git a/types/domain.py b/types/domain.py index d71638f..7fa9f16 100644 --- a/types/domain.py +++ b/types/domain.py @@ -33,10 +33,10 @@ def __init__( # Calc domain XB, relative to origin, # and a little smaller than the terrain dom_xb = ( - utm_extent.xMinimum() - utm_origin.x() + 1., - utm_extent.xMaximum() - utm_origin.x() - 1., - utm_extent.yMinimum() - utm_origin.y() + 1., - utm_extent.yMaximum() - utm_origin.y() - 1., + utm_extent.xMinimum() - utm_origin.x() + 1.0, + utm_extent.xMaximum() - utm_origin.x() - 1.0, + utm_extent.yMinimum() - utm_origin.y() + 1.0, + utm_extent.yMaximum() - utm_origin.y() - 1.0, min_z, max_z + cell_size * 10, # 10 cells over max z ) diff --git a/types/landuse.py b/types/landuse.py index a520d2d..9910720 100644 --- a/types/landuse.py +++ b/types/landuse.py @@ -13,7 +13,6 @@ class LanduseType: - _scan_id = re.compile( # search ID value in SURF r""" [,\s\t]+ # 1+ separator diff --git a/types/terrain.py b/types/terrain.py index 6552e5d..17a56fc 100644 --- a/types/terrain.py +++ b/types/terrain.py @@ -282,8 +282,6 @@ def _save_bingeom(self) -> None: fds_volus=list(), ) - - def get_fds(self) -> str: """Get the FDS text and save.""" self._save_bingeom() diff --git a/utilities.py b/types/utils.py similarity index 100% rename from utilities.py rename to types/utils.py