diff --git a/qgis2fds_export_algo.py b/qgis2fds_export_algo.py index eaeebcb..dd7dcec 100644 --- a/qgis2fds_export_algo.py +++ b/qgis2fds_export_algo.py @@ -16,9 +16,6 @@ QgsProcessingParameterRasterDestination, QgsProcessingParameterVectorDestination, QgsCoordinateReferenceSystem, - QgsCoordinateTransform, - QgsPointXY, - QgsPoint, QgsField, NULL, edit, @@ -27,7 +24,7 @@ from qgis.PyQt.QtCore import QVariant import processing -import math, time +import time from .qgis2fds_params import * from .types import ( utils, @@ -39,6 +36,7 @@ Texture, Wind, ) +from . import utils2 DEBUG = True @@ -94,13 +92,6 @@ def initAlgorithm(self, config=None): optional=True, ) ) - self.addParameter( - QgsProcessingParameterVectorDestination( - "ExtentDebug", - "Extent debug", - optional=True, - ) - ) def processAlgorithm(self, parameters, context, model_feedback): feedback = QgsProcessingMultiStepFeedback(6, model_feedback) @@ -115,54 +106,45 @@ def processAlgorithm(self, parameters, context, model_feedback): "feedback": feedback, "project": project, } + + # FIXME move to required place + chid = ChidParam.get(**kwargs) fds_path = FDSPathParam.get(**kwargs) - extent_layer = ExtentLayerParam.get(**kwargs) # in project crs - pixel_size = PixelSizeParam.get(**kwargs) - origin = OriginParam.get(**kwargs) # in project crs - dem_layer = DEMLayerParam.get(**kwargs) - landuse_layer = LanduseLayerParam.get(**kwargs) - landuse_type_filepath = LanduseTypeFilepathParam.get(**kwargs) + fire_layer = FireLayer.get(**kwargs) tex_layer = TexLayerParam.get(**kwargs) tex_pixel_size = TexPixelSizeParam.get(**kwargs) nmesh = NMeshParam.get(**kwargs) - cell_size = CellSizeParam.get(**kwargs) + export_obst = ExportOBSTParam.get(**kwargs) t_begin = StartTimeParam.get(**kwargs) t_end = EndTimeParam.get(**kwargs) wind_filepath = WindFilepathParam.get(**kwargs) text_filepath = TextFilepathParam.get(**kwargs) - # Check other params for None values - # origin is checked later - - if landuse_layer: - if not landuse_type_filepath: - raise QgsProcessingException( - f"Specify the landuse type for the {landuse_layer.name()} landuse layer.\n" - ) - if not cell_size: - cell_size = pixel_size + # Get extent_layer and origin + # Calc wgs84_extent and wgs84_origin - # Get wgs84_extent from extent_layer in WGS84 + extent_layer = ExtentLayerParam.get(**kwargs) # in project crs + origin = OriginParam.get(**kwargs) # in project crs wgs84_crs = QgsCoordinateReferenceSystem("EPSG:4326") - wgs84_extent = _transform_extent( + wgs84_extent = utils2.transform_extent( extent=extent_layer.extent(), source_crs=extent_layer.crs(), dest_crs=wgs84_crs, ) - feedback.setProgressText(f"\nWGS84 extent: {wgs84_extent}") - - # Check origin and get wgs84_origin if origin: - wgs84_origin = _transform_point( - point=origin, source_crs=project.crs(), dest_crs=wgs84_crs + wgs84_origin = utils2.transform_point( + point=origin, + source_crs=project.crs(), + dest_crs=wgs84_crs, ) else: - wgs84_origin = wgs84_extent.center() # in project crs + wgs84_origin = wgs84_extent.center() + feedback.setProgressText(f"WGS84 origin: {wgs84_origin}") # Calc applicable UTM crs at the origin @@ -173,42 +155,40 @@ def processAlgorithm(self, parameters, context, model_feedback): # Calc utm_origin - utm_origin = _transform_point( + utm_origin = utils2.transform_point( point=wgs84_origin, source_crs=wgs84_crs, dest_crs=utm_crs, ) feedback.setProgressText(f"UTM origin: {utm_origin}") - # Calc utm_extent - # Align it to pixel_size, better for sampling grid and DEM interpolation + # Get pixel_size + # Calc and adapt utm_extent: + # align it to the pixel_size, better for sampling grid and DEM interpolation + + pixel_size = PixelSizeParam.get(**kwargs) - utm_extent = _transform_extent( + utm_extent = utils2.transform_extent( extent=wgs84_extent, source_crs=wgs84_crs, dest_crs=utm_crs, ) - e = 1e-6 # epsilon used to nudge the native:creategrid algo - w = math.ceil(utm_extent.width() / pixel_size) * pixel_size + e - h = math.ceil(utm_extent.height() / pixel_size) * pixel_size + e - x_min, x_max, y_min, y_max = ( - utm_extent.xMinimum(), - utm_extent.xMaximum(), - utm_extent.yMinimum(), - utm_extent.yMaximum(), - ) - utm_extent.setXMaximum(x_min + w) - utm_extent.setYMinimum(y_max - h) - feedback.setProgressText(f"UTM extent: {utm_extent}") - feedback.setProgressText(f"Extent size: {x_max-x_min:.1f}x{y_max-y_min:.1f}m") + + utm_extent = utils2.get_extent_multiple_of_pixels( + extent=utm_extent, pixel_size=pixel_size, epsilon=1e-6 + ) # epsilon used to nudge the native:creategrid algo + + msg = f"UTM extent size: {utm_extent.width():.1f}x{utm_extent.height():.1f}m" + feedback.setProgressText(msg) if DEBUG: - _run_extent_to_layer( - parameters=parameters, + utils2.show_extent( context=context, feedback=feedback, extent=utm_extent, extent_crs=utm_crs, + name="DEBUG UTM extent", + style="Extent layer style.qml", ) feedback.setCurrentStep(1) @@ -227,7 +207,7 @@ def processAlgorithm(self, parameters, context, model_feedback): "VSPACING": pixel_size, "HOVERLAY": 0.0, "VOVERLAY": 0.0, - "OUTPUT": DEBUG and parameters["UtmGrid"] or QgsProcessing.TEMPORARY_OUTPUT, + "OUTPUT": QgsProcessing.TEMPORARY_OUTPUT, } outputs["UtmGrid"] = processing.run( "native:creategrid", @@ -260,31 +240,19 @@ def processAlgorithm(self, parameters, context, model_feedback): utm_idem_extent = utm_extent.buffered(pixel_size / 2.0 - e) if DEBUG: - _run_extent_to_layer( - parameters=parameters, + utils2.show_extent( context=context, feedback=feedback, extent=utm_idem_extent, extent_crs=utm_crs, + name="DEBUG UTM DEM extent", + style="Extent layer style.qml", ) - # Check DEM layer is local, otherwise save it - - dem_layer = DEMLayerParam.get_local( - algo=self, - parameters=parameters, - context=context, - feedback=feedback, - project=project, - extent=_transform_extent( - extent=utm_idem_extent, source_crs=utm_crs, dest_crs=dem_layer.crs() - ), # FIXME not useful here - ) - - return {} # FIXME - # Clip, reproject, and interpolate the DEM + dem_layer = DEMLayerParam.get(**kwargs, extent=utm_extent, extent_crs=utm_crs) + feedback.setProgressText("\nClip, reproject, and interpolate the DEM...") t0 = time.time() alg_params = { @@ -330,7 +298,7 @@ def processAlgorithm(self, parameters, context, model_feedback): "OFFSET": 0, "RASTER": outputs["Interpolation"]["OUTPUT"], "SCALE": 1, - "OUTPUT": DEBUG and parameters["UtmGrid"] or QgsProcessing.TEMPORARY_OUTPUT, + "OUTPUT": QgsProcessing.TEMPORARY_OUTPUT, } outputs["SetZFromDem"] = processing.run( "native:setzfromraster", @@ -348,14 +316,27 @@ def processAlgorithm(self, parameters, context, model_feedback): # Sample landuse values from landuse layer # The new data column name is bc1 - if landuse_layer and landuse_type_filepath: + landuse_layer = LanduseLayerParam.get( + **kwargs, extent=utm_extent, extent_crs=utm_crs + ) + landuse_type_filepath = LanduseTypeFilepathParam.get(**kwargs) + + if landuse_layer: feedback.setProgressText("\nSample landuse values from landuse layer...") t0 = time.time() + + # Check landuse type exists + + if not landuse_type_filepath: + msg = f"Landuse type not available, cannot proceed." + raise QgsProcessingException(msg) + + # Sample alg_params = { "COLUMN_PREFIX": "bc", # creates the bc1 field from landuse "INPUT": outputs["SetZFromDem"]["OUTPUT"], "RASTERCOPY": landuse_layer, - "OUTPUT": parameters["UtmGrid"], + "OUTPUT": QgsProcessing.TEMPORARY_OUTPUT, } outputs["SampleRasterValues"] = processing.run( "native:rastersampling", @@ -364,13 +345,12 @@ def processAlgorithm(self, parameters, context, model_feedback): feedback=feedback, is_child_algorithm=True, ) - # results["UtmGrid"] = outputs["SampleRasterValues"]["OUTPUT"] sampling_layer = context.getMapLayer( outputs["SampleRasterValues"]["OUTPUT"] ) feedback.setProgressText(f"time: {time.time()-t0:.1f}s") else: - feedback.setProgressText("\nNo landuse layer or type.") + feedback.setProgressText("\nNo landuse layer.") sampling_layer = context.getMapLayer(outputs["SetZFromDem"]["OUTPUT"]) with edit(sampling_layer): # create an empty bc1 field attributes = list((QgsField("bc1", QVariant.Int),)) @@ -381,6 +361,14 @@ def processAlgorithm(self, parameters, context, model_feedback): if feedback.isCanceled(): return {} + if DEBUG: + utils2.show_layer( + context=context, + feedback=feedback, + layer=sampling_layer, + name="DEBUG Sampling layer", + ) + # Get landuse type # (we need landuse_type.bc_out_default and .bc_in_default) @@ -496,6 +484,12 @@ def processAlgorithm(self, parameters, context, model_feedback): if feedback.isCanceled(): return {} + # Get cell_size + + cell_size = CellSizeParam.get(**kwargs) + if not cell_size: + cell_size = pixel_size + domain = Domain( feedback=feedback, utm_crs=utm_crs, @@ -547,57 +541,6 @@ def createInstance(self): # FIXME move elsewhere -def _transform_extent(extent, source_crs, dest_crs): - _tr = QgsCoordinateTransform(source_crs, dest_crs, QgsProject.instance()) - return _tr.transformBoundingBox(extent) - - -def _transform_point(point, source_crs, dest_crs): - _tr = QgsCoordinateTransform(source_crs, dest_crs, QgsProject.instance()) - return _tr.transform(QgsPointXY(point)) - - -def _run_create_spatial_index(parameters, context, feedback, vector_layer): - """Create spatial index of vector layer to speed up the next process.""" - feedback.setProgressText("\nCreate spatial index...") - t0 = time.time() - alg_params = { - "INPUT": vector_layer, - } - output = processing.run( - "native:createspatialindex", - alg_params, - context=context, - feedback=feedback, - is_child_algorithm=True, - ) - feedback.setProgressText(f"time: {time.time()-t0:.1f}s") - return output - - -def _run_extent_to_layer(parameters, context, feedback, extent, extent_crs): - """Show extent as vector layer.""" - x_min, x_max, y_min, y_max = ( - extent.xMinimum(), - extent.xMaximum(), - extent.yMinimum(), - extent.yMaximum(), - ) - extent_str = f"{x_min}, {x_max}, {y_min}, {y_max} [{extent_crs.authid()}]" - feedback.setProgressText(f"Extent to layer: {extent_str} ...") - alg_params = { - "INPUT": extent_str, - "OUTPUT": parameters["ExtentDebug"], # FIXME how to make it unlinked? - } - return processing.run( - "native:extenttolayer", - alg_params, - context=context, - feedback=feedback, - is_child_algorithm=True, - ) - - def _load_fire_layer_bc( parameters, context, feedback, sampling_layer, fire_layer, bc_field, bc_default ): diff --git a/qgis2fds_params.py b/qgis2fds_params.py index 140d220..269c5ab 100644 --- a/qgis2fds_params.py +++ b/qgis2fds_params.py @@ -25,6 +25,7 @@ QgsRasterLayer, ) import os +from . import utils2 class ChidParam: @@ -175,148 +176,6 @@ def get(cls, algo, parameters, context, feedback, project): ) # in project crs -class DEMLayerParam: - label = "dem_layer" - desc = "DEM layer" - default = None - optional = False - - @classmethod - def set(cls, algo, config, project): - defaultValue, _ = project.readEntry("qgis2fds", cls.label, cls.default) - # Suggest first layer name containing "dem" - if not defaultValue: - try: - defaultValue = [ - layer.name() - for layer in project.mapLayers().values() - if "DEM" in layer.name() or "dem" in layer.name() - ][0] - except IndexError: - pass - param = QgsProcessingParameterRasterLayer( - cls.label, - cls.desc, - defaultValue=defaultValue, - optional=cls.optional, - ) - algo.addParameter(param) - - @classmethod - def get(cls, algo, parameters, context, feedback, project): - value = algo.parameterAsRasterLayer(parameters, cls.label, context) - # Check valid - if not value.crs().isValid(): - raise QgsProcessingException( - f"DEM layer CRS {value.crs().description()} not valid, cannot proceed." - ) - project.writeEntry("qgis2fds", cls.label, parameters.get(cls.label)) # protect - feedback.setProgressText(f"{cls.desc}: {value}") - return value - - @classmethod - def get_local( - cls, - algo, - parameters, - context, - feedback, - project, - extent, # in layer crs! - relpath="./layers", - ): - layer = algo.parameterAsRasterLayer(parameters, cls.label, context) - url = layer.source() - if os.path.isfile(url): - return layer - # Make and check absolute path - project_path = project.absolutePath() - if not project_path: - raise QgsProcessingException( - "Save QGIS project to disk, cannot proceed." - ) # FIXME message - path = os.path.join(project_path, relpath) - # Create layers directory - # FIXME see https://stackoverflow.com/questions/273192/how-do-i-create-a-directory-and-any-missing-parent-directories - if not os.path.isdir(path): - feedback.setProgressText(f"Create directory {path}...") - os.makedirs(path, exist_ok=True) - if not os.path.isdir(path): - raise QgsProcessingException( - f"Error creating directory {path}, cannot proceed." - ) - # Save layer - # FIXME set style - filepath = os.path.join(path, f"{layer.name()}_saved.tif") - file_writer = QgsRasterFileWriter(filepath) - pipe = QgsRasterPipe() - provider = layer.dataProvider() - ok = pipe.set(provider.clone()) - if not ok: - raise QgsProcessingException( - f"Error saving layer data (pipe, {ok}), cannot proceed.\n{url}" - ) - feedback.setProgressText(f"pipe prepared. ok: {ok}, url: {url}, path: {path}") - nCols = round(extent.width() / layer.rasterUnitsPerPixelX()) # FIXME - nRows = round(extent.height() / layer.rasterUnitsPerPixelY()) # FIXME - # FIXME align extent with original grid - err = file_writer.writeRaster( - pipe=pipe, nCols=nCols, nRows=nRows, outputExtent=extent, crs=layer.crs() - ) - if err: - raise QgsProcessingException( - f"Error saving layer data (write, {err}), cannot proceed.\n{url}" - ) - feedback.setProgressText(f"tif saved. ok: {ok}, url: {url}, path: {filepath}") - new_layer = QgsRasterLayer(filepath, f"{layer.name()}_saved") # FIXME var name - if not new_layer.isValid(): - raise QgsProcessingException( - f"Error loading saved layer, cannot proceed.\n{url}" - ) - project.addMapLayer(new_layer) - project.writeEntry("qgis2fds", cls.label, filepath) - return new_layer - - -class LanduseLayerParam: - label = "landuse_layer" - desc = "Landuse layer (if not set, landuse is not exported)" - default = None - optional = True - - @classmethod - def set(cls, algo, config, project): - defaultValue, _ = project.readEntry("qgis2fds", cls.label, cls.default) - param = QgsProcessingParameterRasterLayer( - cls.label, - cls.desc, - defaultValue=defaultValue, - optional=cls.optional, - ) - algo.addParameter(param) - - @classmethod - def get(cls, algo, parameters, context, feedback, project): - value = None - if parameters.get(cls.label): - value = algo.parameterAsRasterLayer(parameters, cls.label, context) - if value: - # Check local - url = value.source() - if not os.path.isfile(url): - raise QgsProcessingException( - f"Landuse layer data is not saved locally, cannot proceed.\n{url}" - ) - # Check valid - if not value.crs().isValid(): - raise QgsProcessingException( - f"Landuse layer CRS {value.crs().description()} not valid, cannot proceed." - ) - project.writeEntry("qgis2fds", cls.label, parameters.get(cls.label)) # protect - feedback.setProgressText(f"{cls.desc}: {value}") - return value - - class LanduseTypeFilepathParam: label = "landuse_type_filepath" desc = "Landuse type *.csv file (if not set, landuse is not exported)" @@ -672,3 +531,99 @@ def get(cls, algo, parameters, context, feedback, project): raise QgsProcessingException(f"File {value} not found.") feedback.setProgressText(f"{cls.desc}: {value}") return value + + +# Layer Params + + +class _LayerParam: + label = "example_layer" + desc = "Example layer" + default = None + optional = False + + @classmethod + def set(cls, algo, config, project): + defaultValue, _ = project.readEntry("qgis2fds", cls.label, cls.default) + param = QgsProcessingParameterRasterLayer( + cls.label, + cls.desc, + defaultValue=defaultValue, + optional=cls.optional, + ) + algo.addParameter(param) + + @classmethod + def get(cls, algo, parameters, context, feedback, project, extent, extent_crs): + layer = None + if parameters.get(cls.label): + layer = algo.parameterAsRasterLayer(parameters, cls.label, context) + if layer: + # Check validity + if not layer.crs().isValid(): + msg = f"{cls.desc} CRS {layer.crs().description()} not valid, cannot proceed." + raise QgsProcessingException(msg) + + # Check local otherwise save it + url = layer.source() + if not os.path.isfile(url): + # Make and check absolute path + project_path = project.absolutePath() + if not project_path: + msg = "QGIS project is not saved to disk, cannot proceed." + raise QgsProcessingException(msg) + path = os.path.join(project_path, "layers") + + # Create layers directory + if not os.path.isdir(path): + try: + os.makedirs(path, exist_ok=True) + except: + msg = "Error creating path {path}." + raise QgsProcessingException(msg) + + # Trasform extent to the layer crs + extent = utils2.transform_extent( + extent=extent, + source_crs=extent_crs, + dest_crs=layer.crs(), + ) + + # Save the layer + filename = f"{layer.name()}_downloaded.tif" + filepath = os.path.join(path, filename) + utils2.save_raster_layer(layer=layer, extent=extent, filepath=filepath) + + # Load the layer, but do not link + layer = QgsRasterLayer(filepath, filename) + if not layer.isValid(): + msg = f"Layer {filename} is not valid, cannot proceed.\n{filepath}" + raise QgsProcessingException(msg) + + # Inform the user + msg = f""" +\n{cls.desc} is a link to a *remote data repository*. +The required layer data was just downloaded at: +{filepath} +To avoid downloading again, replace the remote repository with local data. +For help, see: https://github.com/firetools/qgis2fds/wiki/Save-remote-layers +""" + feedback.pushWarning(msg) + + project.writeEntry("qgis2fds", cls.label, parameters.get(cls.label)) # protect + feedback.setProgressText(f"{cls.desc}: {layer}") + return layer + + +class DEMLayerParam(_LayerParam): + label = "dem_layer" + desc = "DEM layer" + default = None + optional = False + + +class LanduseLayerParam(_LayerParam): + label = "landuse_layer" + desc = "Landuse layer (if not set, landuse is not exported)" + default = None + optional = True diff --git a/qgis2fds_provider.py b/qgis2fds_provider.py index fba64f7..0502dac 100644 --- a/qgis2fds_provider.py +++ b/qgis2fds_provider.py @@ -9,7 +9,6 @@ from qgis.core import QgsProcessingProvider from .qgis2fds_export_algo import qgis2fdsExportAlgo -from .extract_server_layer import extractServerLayerAlgorithm class qgis2fdsProvider(QgsProcessingProvider): @@ -30,7 +29,6 @@ def loadAlgorithms(self): Loads all algorithms belonging to this provider. """ self.addAlgorithm(qgis2fdsExportAlgo()) - self.addAlgorithm(extractServerLayerAlgorithm()) def id(self): """ diff --git a/utils2.py b/utils2.py new file mode 100644 index 0000000..1790574 --- /dev/null +++ b/utils2.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- + +"""qgis2fds utils""" + +__author__ = "Emanuele Gissi" +__date__ = "2020-05-04" +__copyright__ = "(C) 2020 by Emanuele Gissi" +__revision__ = "$Format:%H$" # replaced with git SHA1 + +from qgis.core import ( + QgsCoordinateTransform, + QgsProject, + QgsPointXY, + QgsRectangle, + QgsRasterFileWriter, + QgsRasterPipe, + QgsProcessing, + QgsProcessingException, + QgsRasterLayer, +) +import processing +import os, time, math + + +def transform_extent(extent, source_crs, dest_crs): + _tr = QgsCoordinateTransform(source_crs, dest_crs, QgsProject.instance()) + return _tr.transformBoundingBox(extent) + + +def transform_point(point, source_crs, dest_crs): + _tr = QgsCoordinateTransform(source_crs, dest_crs, QgsProject.instance()) + return _tr.transform(QgsPointXY(point)) + + +def get_extent_aligned_to_raster(layer, extent, nlarger=10): + """Get extent aligned to raster pixels, in the same CRS.""" + # Get raster resolution + xres, yres = layer.rasterUnitsPerPixelX(), layer.rasterUnitsPerPixelY() + # Get top left extent corner coordinates, + # because raster grid starts from top left corner of raster_layer extent + lx0, ly1 = layer.extent().xMinimum(), layer.extent().yMaximum() + # Aligning raster_extent top left corner to raster_layer resolution, + # never reduce its size + x0, y0, x1, y1 = ( + extent.xMinimum(), + extent.yMinimum(), + extent.xMaximum(), + extent.yMaximum(), + ) + x0 = lx0 + (round((x0 - lx0) / xres) * xres) - xres * nlarger + x1 = lx0 + (round((x1 - lx0) / xres) * xres) + xres * nlarger + y0 = ly1 - (round((ly1 - y0) / yres) * yres) - xres * nlarger + y1 = ly1 - (round((ly1 - y1) / yres) * yres) + xres * nlarger + return QgsRectangle(x0, y0, x1, y1) + + +def get_extent_multiple_of_pixels(extent, pixel_size, epsilon): + """Get extent that has sizes exactly multiples of pixel size.""" + epsilon = 1e-6 # epsilon used to nudge the native:creategrid algo + width = math.ceil(extent.width() / pixel_size) * pixel_size + epsilon + height = math.ceil(extent.height() / pixel_size) * pixel_size + epsilon + x0, x1, y0, y1 = ( + extent.xMinimum(), + extent.xMaximum(), + extent.yMinimum(), + extent.yMaximum(), + ) + x1 = x0 + width + y0 = y1 - height + return QgsRectangle(x0, y0, x1, y1) + + +def save_raster_layer(layer, extent, filepath): + """Save aligned extent of layer in path.""" + # Prepare filepath and machinery + file_writer = QgsRasterFileWriter(filepath) + pipe = QgsRasterPipe() + provider = layer.dataProvider() + ok = pipe.set(provider.clone()) + if not ok: + msg = f"Error saving layer data, cannot proceed.\n(pipe, ok: {ok}) {filepath}" + raise QgsProcessingException(msg) + # Get aligned extent and set resolution + extent = get_extent_aligned_to_raster(layer=layer, extent=extent) + xres, yres = layer.rasterUnitsPerPixelX(), layer.rasterUnitsPerPixelY() + nCols = round(extent.width() / xres) + nRows = round(extent.height() / yres) + # Save and check + err = file_writer.writeRaster( + pipe=pipe, nCols=nCols, nRows=nRows, outputExtent=extent, crs=layer.crs() + ) + if err: + msg = ( + f"Error saving layer data, cannot proceed.\n(write, err: {err}) {filepath}" + ) + raise QgsProcessingException(msg) + return filepath + + +def show_extent(context, feedback, extent, extent_crs, name, style=None): + """Show extent as vector layer.""" + x0, x1, y0, y1 = ( + extent.xMinimum(), + extent.xMaximum(), + extent.yMinimum(), + extent.yMaximum(), + ) + extent_str = f"{x0}, {x1}, {y0}, {y1} [{extent_crs.authid()}]" + feedback.setProgressText(f"Extent to layer {name}: {extent_str} ...") + alg_params = { + "INPUT": extent_str, + "OUTPUT": QgsProcessing.TEMPORARY_OUTPUT, + } + output = processing.run( + "native:extenttolayer", + alg_params, + context=context, + feedback=feedback, + is_child_algorithm=True, + ) + show_layer( + context=context, + feedback=feedback, + layer=context.getMapLayer(output["OUTPUT"]), + name=name, + style=style, + ) + + +def show_layer(context, feedback, layer, name=None, style=None): + """Show layer.""" + feedback.setProgressText(f"Show layer {name}: {layer} ...") + if name: + layer.setName(name) + QgsProject.instance().addMapLayer(layer) + if style: + style_pathfile = os.path.join(get_plugin_path(), "styles", style) + layer.loadNamedStyle(style_pathfile) + layer.triggerRepaint() + + +def get_plugin_path(): + """Get current plugin path.""" + return os.path.dirname(os.path.realpath(__file__)) + + +def run_create_spatial_index(parameters, context, feedback, layer): + """Create spatial index of a vector layer to speed up the next process.""" + feedback.setProgressText("\nCreate spatial index...") + t0 = time.time() + alg_params = {"INPUT": layer} + output = processing.run( + "native:createspatialindex", + alg_params, + context=context, + feedback=feedback, + is_child_algorithm=True, + ) + feedback.setProgressText(f"time: {time.time()-t0:.1f}s") + return output diff --git a/verification/tests/golden_gate_remote/FDS/.gitignore b/verification/tests/golden_gate_remote/FDS/.gitignore new file mode 100644 index 0000000..4f2cc7b --- /dev/null +++ b/verification/tests/golden_gate_remote/FDS/.gitignore @@ -0,0 +1,3 @@ +# Ignore all files except myself +* +!.gitignore \ No newline at end of file diff --git a/verification/tests/golden_gate_remote/QGIS/golden_gate_remote.qgs b/verification/tests/golden_gate_remote/QGIS/golden_gate_remote.qgs new file mode 100644 index 0000000..083f9d4 --- /dev/null +++ b/verification/tests/golden_gate_remote/QGIS/golden_gate_remote.qgs @@ -0,0 +1,2123 @@ + + + + + + + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + _22efb34a_9ea3_43b1_b7ee_81a012af26de + Extent_0642b0c8_932e_418f_9e94_a1a555ee0f05 + Fire_b0dc7bbb_6702_4e71_9afe_8048e4f66b7c + LC22_F13_230_30986d7a_216a_48d1_94b0_9da2b47191f5 + LC20_Elev_220_7c7e310a_6ee4_4098_a418_5cf5198b1e66 + + + + + + + + + + + + meters + + -2280897.22295342106372118 + 1962271.45374332135543227 + -2277236.57532570976763964 + 1965936.13406573003157973 + + 0 + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + 0 + + + + + + + + + + + + + + + + + + + + + + + Annotations_0ce50c8c_f1a5_4897_9f64_f112c78d87d6 + + + + + Annotations + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + 1 + 1 + 1 + 0 + + + + 1 + 0 + + + + + + -122.49205780029299717 + 37.82763290405269885 + -122.48023986816400566 + 37.83367156982419743 + + + -122.49205780029299717 + 37.82763290405269885 + -122.48023986816400566 + 37.83367156982419743 + + Extent_0642b0c8_932e_418f_9e94_a1a555ee0f05 + ./layers/Extent.gpkg|layername=Extent + + + + Extent + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + "fid" + + + + + -122.49008128145599983 + 37.82912004092190017 + -122.48259864265199326 + 37.83262069093999713 + + + -122.49008128145599983 + 37.82912004092190017 + -122.48259864265199326 + 37.83262069093999713 + + Fire_b0dc7bbb_6702_4e71_9afe_8048e4f66b7c + ./layers/Fire.gpkg|layername=Fire + + + + Fire + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + dataset + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + + + + + + + ogr + + + + + + + + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + generatedlayout + + + + + + + + + + + + + + + + + + + + + "fid" + + + + + -2362395 + 221265 + 2327655 + 3267405 + + + -128.38690525209997872 + 22.42840490061946213 + -64.05405005567833143 + 52.48156003561286553 + + LC20_Elev_220_7c7e310a_6ee4_4098_a418_5cf5198b1e66 + dpiMode=7&identifier=landfire_wcs:LC20_Elev_220&tilePixelRatio=0&url=https://edcintl.cr.usgs.gov/geoserver/landfire_wcs/us_topo/wcs + + + + LC20_Elev_220 + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + wcs + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 6 + + + + -2362395 + 258945 + 2263815 + 3177435 + + + -127.98737642604235987 + 22.76578041143468667 + -65.25444546636926191 + 51.64961241643037226 + + LC22_F13_230_30986d7a_216a_48d1_94b0_9da2b47191f5 + dpiMode=7&identifier=landfire_wcs:LC22_F13_230&tilePixelRatio=0&url=https://edcintl.cr.usgs.gov/geoserver/landfire_wcs/us_230/wcs + + + + LC22_F13_230 + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + + + + + + + wcs + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + resamplingFilter + + 6 + + + + -20037508.34278924390673637 + -20037508.34278924763202667 + 20037508.34278924390673637 + 20037508.34278924763202667 + + + -180 + -85.05112877980660357 + 179.99999999999997158 + 85.05112877980660357 + + _22efb34a_9ea3_43b1_b7ee_81a012af26de + crs=EPSG:3857&format&type=xyz&url=https://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0 + + + + OpenStreetMap + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + OpenStreetMap tiles + + + dataset + OpenStreetMap tiles + OpenStreetMap is built by a community of mappers that contribute and maintain data about roads, trails, cafés, railway stations, and much more, all over the world. + + + + + + Base map and data from OpenStreetMap and OpenStreetMap Foundation (CC-BY-SA). © https://www.openstreetmap.org and contributors. + Open Data Commons Open Database License (ODbL) + Creative Commons Attribution-ShareAlike (CC-BY-SA) + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + + + wms + + + + + + + + + 1 + 1 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + resamplingFilter + + 0 + + + + + + + + + + + + 0 + + + 255 + 255 + 255 + 255 + 0 + 255 + 255 + + + false + + + + + + EPSG:7019 + + + m2 + meters + + + 5 + 2.5 + false + false + false + 1 + 0 + false + false + true + 0 + 255,0,0,255 + + + false + + + true + 2 + + false + + 1 + + + + + + + + + + + None + false + false + + + + + + 1 + false + conditions unknown + 90 + + + + 1 + + 8 + + false + + false + + 0 + + false + + + + + + + + false + + + + + false + + 5000 + + + + false + + + + 10 + golden_gate_local + LC20_Elev_220_7c7e310a_6ee4_4098_a418_5cf5198b1e66 + false + Extent_0642b0c8_932e_418f_9e94_a1a555ee0f05 + ../FDS + Fire_b0dc7bbb_6702_4e71_9afe_8048e4f66b7c + LC22_F13_230_30986d7a_216a_48d1_94b0_9da2b47191f5 + ./sheets/Landfire F13 landuse type.csv + 4 + -2279359.733937,1963331.421795 [EPSG:5070] + 10 + 0 + 30 + + 2 + + /home/egissi/Documenti/Git/qgis2fds/verification/tests/golden_gate_local/QGIS/sheets/wind.csv + + + + + + + + + + + PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]] + +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs + 3857 + 3857 + EPSG:3857 + WGS 84 / Pseudo-Mercator + merc + EPSG:7030 + false + + + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + + + + + + + + Emanuele Gissi + 2023-08-22T14:11:37 + + + + + + + + + + + PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]] + +proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + 28001 + 5070 + EPSG:5070 + NAD83 / Conus Albers + aea + EPSG:7019 + false + + + + + + + + + + + + + + + + + + + + + + GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]] + +proj=longlat +datum=WGS84 +no_defs + 3452 + 4326 + EPSG:4326 + WGS 84 + longlat + EPSG:7030 + true + + + + + + + diff --git a/verification/tests/golden_gate_remote/QGIS/layers/Extent.gpkg b/verification/tests/golden_gate_remote/QGIS/layers/Extent.gpkg new file mode 100644 index 0000000..4debf1d Binary files /dev/null and b/verification/tests/golden_gate_remote/QGIS/layers/Extent.gpkg differ diff --git a/verification/tests/golden_gate_remote/QGIS/layers/Fire.gpkg b/verification/tests/golden_gate_remote/QGIS/layers/Fire.gpkg new file mode 100644 index 0000000..283974e Binary files /dev/null and b/verification/tests/golden_gate_remote/QGIS/layers/Fire.gpkg differ diff --git a/verification/tests/golden_gate_remote/QGIS/sheets/Landfire F13 landuse type.csv b/verification/tests/golden_gate_remote/QGIS/sheets/Landfire F13 landuse type.csv new file mode 100644 index 0000000..6ac1d6e --- /dev/null +++ b/verification/tests/golden_gate_remote/QGIS/sheets/Landfire F13 landuse type.csv @@ -0,0 +1,22 @@ +landuse,SURF +0,"&SURF ID='NA' RGB=255,255,255 /" +1,"&SURF ID='A01' RGB=255,254,212 VEG_LSET_FUEL_INDEX=1 /" +2,"&SURF ID='A02' RGB=255,253,102 VEG_LSET_FUEL_INDEX=2 /" +3,"&SURF ID='A03' RGB=236,212,99 VEG_LSET_FUEL_INDEX=3 /" +4,"&SURF ID='A04' RGB=254,193,119 VEG_LSET_FUEL_INDEX=4 /" +5,"&SURF ID='A05' RGB=249,197,92 VEG_LSET_FUEL_INDEX=5 /" +6,"&SURF ID='A06' RGB=217,196,152 VEG_LSET_FUEL_INDEX=6 /" +7,"&SURF ID='A07' RGB=170,155,127 VEG_LSET_FUEL_INDEX=7 /" +8,"&SURF ID='A08' RGB=229,253,214 VEG_LSET_FUEL_INDEX=8 /" +9,"&SURF ID='A09' RGB=162,191,90 VEG_LSET_FUEL_INDEX=9 /" +10,"&SURF ID='A10' RGB=114,154,85 VEG_LSET_FUEL_INDEX=10 /" +11,"&SURF ID='A11' RGB=235,212,253 VEG_LSET_FUEL_INDEX=11 /" +12,"&SURF ID='A12' RGB=163,177,243 VEG_LSET_FUEL_INDEX=12 /" +13,"&SURF ID='A13' RGB=0,0,0 VEG_LSET_FUEL_INDEX=13 /" +91,"&SURF ID='Urban' RGB=186,119,80 /" +92,"&SURF ID='Snow-Ice' RGB=234,234,234 /" +93,"&SURF ID='Agricolture' RGB=253,242,242 /" +98,"&SURF ID='Water' RGB=137,183,221 /" +99,"&SURF ID='Barren' RGB=133,153,156 /" +1000,"&SURF ID='Ignition' VEG_LSET_IGNITE_TIME=0. COLOR='RED' /" +1001,"&SURF ID='Burned' RGB=20,20,20 /" diff --git a/verification/tests/golden_gate_remote/QGIS/sheets/wind.csv b/verification/tests/golden_gate_remote/QGIS/sheets/wind.csv new file mode 100644 index 0000000..fb6c862 --- /dev/null +++ b/verification/tests/golden_gate_remote/QGIS/sheets/wind.csv @@ -0,0 +1,4 @@ +Time,Speed,Direction +0,2,45 +180,5,90 +360,10,135