firetools / qgis2fds

An open source and free tool to export terrain elevation, landuse, and georeferencing to NIST FDS for computational fluid dynamics (CFD) wildfire or atmospheric pollutants dispersion simulations.
GNU General Public License v3.0
17 stars 13 forks source link

Try again DEM interpolation with gdal:warpreproject #87

Closed emanuelegissi closed 1 year ago

emanuelegissi commented 1 year ago

I am testing again the gdal:warpreproject algorithm for interpolation. It is so fast! It can indeed interpolate correctly, but it is fragile. So I added some safety belts: SOURCE_CRS, TARGET_CRS in UTM, TARGET_EXTENT and TARGET_EXTENT_CRS in UTM I hope this is enough and doesn't break in real world cases, otherwise we backtrack.

        alg_params = {
            "INPUT": dem_layer,
            "SOURCE_CRS": dem_layer.crs(),
            "TARGET_CRS": utm_crs,
            "RESAMPLING": 1,
            "NODATA": None,
            "TARGET_RESOLUTION": pixel_size,
            "OPTIONS": "",
            "DATA_TYPE": 0,
            "TARGET_EXTENT": utm_idem_extent,
            "TARGET_EXTENT_CRS": utm_crs,
            "MULTITHREADING": False,
            "EXTRA": "",
            "OUTPUT": DEBUG
            and parameters["UtmInterpolatedDemLayer"]
            or QgsProcessing.TEMPORARY_OUTPUT,
        }
        outputs["Interpolation"] = processing.run(
            "gdal:warpreproject",
            alg_params,
            context=context,
            feedback=feedback,
            is_child_algorithm=True,
        )
rmcdermo commented 1 year ago

OK, please let me know when you feel this is ready for testing and on which repo/branch. Thanks

emanuelegissi commented 1 year ago

Okay, I need a couple of days more. But we are close.

Il mar 22 ago 2023, 15:05 Randy McDermott @.***> ha scritto:

OK, please let me know when you feel this is ready for testing and on which repo/branch. Thanks

— Reply to this email directly, view it on GitHub https://github.com/firetools/qgis2fds/issues/87#issuecomment-1688150332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXMVY2WMJTUS235ODLIKRDXWSVA7ANCNFSM6AAAAAA3Z36EEY . You are receiving this because you authored the thread.Message ID: @.***>

emanuelegissi commented 1 year ago

Done, it works