Difference between revisions of "QGIS TUFLOW Increment Layer"

From Tuflow
Jump to navigation Jump to search
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
= Introduction =
 
This tool takes the active layer (as selected in the layer control) and saves a copy of this with a new filename.  By default the currently open file will be closed and the new version opened, however there is the option to keep both versions open in the workspace. The new layer will adopt the same styling as the old layer.<br>
 
This tool takes the active layer (as selected in the layer control) and saves a copy of this with a new filename.  By default the currently open file will be closed and the new version opened, however there is the option to keep both versions open in the workspace. The new layer will adopt the same styling as the old layer.<br>
 +
 +
= Running the Tool =
 +
In QGIS, the tool can be found in the TUFLOW Plugin toolbar, or via the top dropdown menu options Plugins >> TUFLOW >> Editing >> Increment Selected Layer.<br>
 +
 +
[[File: TUFLOW_plugin_increment_layer.png]]<br>
 
<br>
 
<br>
===Running the Tool===
+
Example 'Increment Selected Layer' dialog:<br>
The tool can be found in the TUFLOW Plugin toolbar, or via the QGIS menu '''Plugins >> TUFLOW >> Editing >> Increment Selected Layer'''.<br><br>
+
 
[[File: increment_layer_toolicon.PNG]]<br>
+
[[File: Increment_Layer_01a.png]]<br>
[[File:QGIS TUFLOW Increment 03.png]]
 
 
<br>
 
<br>
The components are described below.
+
The parameters are described below:
 
<ol>
 
<ol>
<li> '''Source Layer''' - drop box for selecting the layer to be incremented.  This defaults to the current layer in the layer control.
+
<li> '''Source Layer:''' Drop box for selecting the layer to be incremented.  This defaults to the layer currently selected in the QGIS Layers panel.  
<li> '''Keep source formatting''' - ''Depcrecated'' - this option is no longer available. The source formatting is now always retained (it also no longer creates a .QML file).
+
<li> '''Output Folder:''' The location for the folder to be saved into. This defaults to the folder location where the current file is saved and is updated if the 'Source Layer' dropbox is changed.
<li> '''Output Folder''' - The location for the folder to be saved into. This defaults to the location of the current file and is updated if the '''Source Layer''' dropbox is changed.
+
<li> '''Output Filename:''' The output file, the tool will attempt to guess a filename by incrementing the current filename by 1.  For example the source layer with name '2d_bc_M10_001_L' will guess '2d_bc_M10_00'''2'''_L'.  This will be updated if the 'Source Layer' dropbox is changed.
<li> '''Output Filename''' - The output file, the tool will attempt to guess a filename by incrementing the current filename by 1.  For example the source layer with name '''2d_code_M01_001_R''' will guess '''2d_code_M01_002_R'''.  This will be updated if the '''Source Layer''' dropbox is changed.
+
<li> '''Move Source Layer to Superseded Folder:''' This option will move the source layer to a new folder call 'SS' (superseded) once the new incremented layer has been created. This is intended to help users keep their GIS files tidy, with only current layers being present.
<li> '''Move Source Layer to Superseded Folder''' - This option will move the source layer to a new folder call 'SS' (superseded) once the new incremented layer has been created. This is intended to help users keep their GIS files tidy, with only current layers being present.
+
<li> '''Remove/Keep Source Layer in Workspace:''' This option will determine whether the original source layer is removed from the workspace or not. It is possible to use the option to 'Keep Source Layer in Workspace' and 'Move Source Layer to Superseded Folder' together.
<li> '''Remove/Keep Source Layer in Workspace''' - This option will determine whether the original source layer is removed from the workspace or not. It is possible to use the option to keep the source layer in the workspace and "Move Source Layer to Superseded Folder" together.
 
 
</ol>
 
</ol>
 +
:''Note:'' The 'Keep source formatting' option is no longer available. The source formatting is now always retained (it also no longer creates a .QML file).
 
The tool also checks if an existing file with the name and location specified already exists, if so, a warning will appear alerting the user. If the existing layer is open in QGIS (or another GIS program) the tool will produce an error.
 
The tool also checks if an existing file with the name and location specified already exists, if so, a warning will appear alerting the user. If the existing layer is open in QGIS (or another GIS program) the tool will produce an error.
 
<br>
 
<br>
<Br>
+
 
===Working with GPKG===
+
= Working with GeoPackage =
''Available since v3.3''<br>
+
:''Available since v3.3''<br>
If the source layer is a GPKG, the user will be given additional options:<Br>
+
If the source layer is in a GeoPackage (GPKG), the user will be given additional options:<Br>
'''Note: <b>Save layer out into superseded folder</b> is available since v3.7.0.25'''<br>
+
:'''Note:''' <u>[[QGIS_TUFLOW_Increment_Layer#Save_Layer_Out_Into_Superseded_Folder|Save layer out into superseded folder]]</u> is available since v3.7.0.25<br>
: [[File: increment_layer_spatial_database_options.PNG]]
+
 
* '''Increment Layer Only''' - this will only save the individual layer from the GPKG database into a new or existing GPKG database. The tool will attempt to increment the name of both the GPKG database and layer when the layer is first selected.
+
[[File: Increment_Layer_02a.png]]<br>
* '''Increment Layer and Preserve Database''' - This option will give the user the ability to determine which layers from the existing GPKG database they would like to keep and/or increment into a new GPKG database. The database can be a new or existing GPKG database. The tool will automatically try and increment the output database and layer names when the layer is first selected.
+
<br>
** Checked layers will be copied to the new database
+
A summary of the options is described below and more details are given further on:
** Layer names can be incremented (or given a new name) by providing one under the "Incremented Layer" column in the table. Otherwise if the "Incremented Layer" cell is blank, the layer will be copied with the same name.
+
* '''<u>[[QGIS_TUFLOW_Increment_Layer#Increment_Layer_Only|Increment Layer Only]]</u>:''' Saves the individual layer from the GPKG database into a new or existing GPKG database. Other layers in the GPKG will not be copied.
: [[File: increment_layer_spatial_database_preserve_database.PNG]]
+
* '''<u>[[QGIS_TUFLOW_Increment_Layer#Increment_Layer_and_Preserve_Database|Increment Layer and Preserve Database]]</u>:''' Allows the user to increment or copy multiple layers from the same GPKG into a new or existing GPKG.
 +
* '''<u>[[QGIS_TUFLOW_Increment_Layer#Save_Layer_Out_Into_Superseded_Folder|Save Layer Out Into Superseded Folder]]</u>:''' Saves the currently selected layer into a new location but does not open it in QGIS. This option allows users to use centralised databases without having to increment the entire database each time. The user saves the superseded layer into a new location for posterity and continues to work with the layer in the centralised database.<br>
 +
 
 +
== Increment Layer Only ==
 +
This option saves the layer selected in the dropbox into a new or existing GPKG. Other layers in the GPKG will not be copied or incremented in the process. The tool automatically provided an incremented name (that the user can edit) for the output database and layer name when the layer is selected in the dropdown box. The ability to move the old layer to the superseded folder and/or keep the old layer open is available for this increment option.
 +
 
 +
== Increment Layer and Preserve Database ==
 +
This option gives the user the ability to copy or increment multiple layers from the same GPKG. All layers in the GPKG will be listed for the user to decide whether to copy, increment, or discard. A given layer will be copied if it is checked on, it will be incremented if is checked on and new name is provided in the right column, and a given layer will discarded (i.e. not copied) if the layer is checked off. The tool will automatically give an incremented name of the layer selected in the dropdown box and will automatically update the datasource of any open layers in QGIS if required. To increment multiple layers within the same GPKG, it is possible to manually edit the filename of any layer in the incremented the GPKG within the 'Incremented Layer' column.<br>
 +
The option to move superseded files to a new separate folder and/or keep the old layers open is available for this increment option.<br>
 +
 
 +
[[File: Increment_Layer_03a.png]]<Br>
 +
 
 +
== Save Layer Out Into Superseded Folder ==
 +
The option saves the layer selected in the dropdown box into a new location (called a superseded folder) by the tool and keeps the current layer open in QGIS. This option allows users to use a centralised database without having to increment the entire database each time. The user saves the superseded layer in a new location for posterity and continues to work the layer in the centralised database. The user is given the option to let the tool automatically supersede the layer or customise the supersede location. The automatic option will save the layer into a folder called '''ss''' in the same location as the GPKG (each layer will be given a new GPKG with the same name as the layer).<br>
 
<br>
 
<br>
 +
If the user has the '''File Management''' plugin installed, an option to increment the active layer is also available. This simply renames the layer inside the GPKG (no copying is done in this step) and allows the usual workflow of incrementing names to be used with this approach. The File Management plugin is required as this plugin has solved the problem of renaming a layer that is actively open in QGIS.<br>
  
===Examples===
+
[[File: Increment_Layer_04a.png]]<br>
'''Example 1 - Shapefile'''<Br>
 
[[File: increment_layer_example.gif]]
 
 
<br>
 
<br>
 +
 +
= Examples =
 +
=== Example 1 - Shapefile ===
 +
{{Video|name=Animation_Increment_Layer_eg_SHP_01a.mp4|width=1184}}
 
<br>
 
<br>
'''Example 2 - GPKG'''<Br>
+
 
[[File: increment_layer_example_gpkg.gif]]
+
=== Example 2 - GeoPackage ===
 +
{{Video|name=Animation_Increment_Layer_eg_GPKG_01a.mp4|width=1184}}
 
<Br>
 
<Br>
<br>
+
 
 +
 
 
{{Tips Navigation
 
{{Tips Navigation
 
|uplink=[[TUFLOW_QGIS_Plugin#Usage| Back to TUFLOW QGIS Plugin Main Page]]
 
|uplink=[[TUFLOW_QGIS_Plugin#Usage| Back to TUFLOW QGIS Plugin Main Page]]
 
}}
 
}}

Latest revision as of 10:34, 27 August 2024

Introduction

This tool takes the active layer (as selected in the layer control) and saves a copy of this with a new filename. By default the currently open file will be closed and the new version opened, however there is the option to keep both versions open in the workspace. The new layer will adopt the same styling as the old layer.

Running the Tool

In QGIS, the tool can be found in the TUFLOW Plugin toolbar, or via the top dropdown menu options Plugins >> TUFLOW >> Editing >> Increment Selected Layer.

TUFLOW plugin increment layer.png

Example 'Increment Selected Layer' dialog:

Increment Layer 01a.png

The parameters are described below:

  1. Source Layer: Drop box for selecting the layer to be incremented. This defaults to the layer currently selected in the QGIS Layers panel.
  2. Output Folder: The location for the folder to be saved into. This defaults to the folder location where the current file is saved and is updated if the 'Source Layer' dropbox is changed.
  3. Output Filename: The output file, the tool will attempt to guess a filename by incrementing the current filename by 1. For example the source layer with name '2d_bc_M10_001_L' will guess '2d_bc_M10_002_L'. This will be updated if the 'Source Layer' dropbox is changed.
  4. Move Source Layer to Superseded Folder: This option will move the source layer to a new folder call 'SS' (superseded) once the new incremented layer has been created. This is intended to help users keep their GIS files tidy, with only current layers being present.
  5. Remove/Keep Source Layer in Workspace: This option will determine whether the original source layer is removed from the workspace or not. It is possible to use the option to 'Keep Source Layer in Workspace' and 'Move Source Layer to Superseded Folder' together.
Note: The 'Keep source formatting' option is no longer available. The source formatting is now always retained (it also no longer creates a .QML file).

The tool also checks if an existing file with the name and location specified already exists, if so, a warning will appear alerting the user. If the existing layer is open in QGIS (or another GIS program) the tool will produce an error.

Working with GeoPackage

Available since v3.3

If the source layer is in a GeoPackage (GPKG), the user will be given additional options:

Note: Save layer out into superseded folder is available since v3.7.0.25

Increment Layer 02a.png

A summary of the options is described below and more details are given further on:

  • Increment Layer Only: Saves the individual layer from the GPKG database into a new or existing GPKG database. Other layers in the GPKG will not be copied.
  • Increment Layer and Preserve Database: Allows the user to increment or copy multiple layers from the same GPKG into a new or existing GPKG.
  • Save Layer Out Into Superseded Folder: Saves the currently selected layer into a new location but does not open it in QGIS. This option allows users to use centralised databases without having to increment the entire database each time. The user saves the superseded layer into a new location for posterity and continues to work with the layer in the centralised database.

Increment Layer Only

This option saves the layer selected in the dropbox into a new or existing GPKG. Other layers in the GPKG will not be copied or incremented in the process. The tool automatically provided an incremented name (that the user can edit) for the output database and layer name when the layer is selected in the dropdown box. The ability to move the old layer to the superseded folder and/or keep the old layer open is available for this increment option.

Increment Layer and Preserve Database

This option gives the user the ability to copy or increment multiple layers from the same GPKG. All layers in the GPKG will be listed for the user to decide whether to copy, increment, or discard. A given layer will be copied if it is checked on, it will be incremented if is checked on and new name is provided in the right column, and a given layer will discarded (i.e. not copied) if the layer is checked off. The tool will automatically give an incremented name of the layer selected in the dropdown box and will automatically update the datasource of any open layers in QGIS if required. To increment multiple layers within the same GPKG, it is possible to manually edit the filename of any layer in the incremented the GPKG within the 'Incremented Layer' column.
The option to move superseded files to a new separate folder and/or keep the old layers open is available for this increment option.

Increment Layer 03a.png

Save Layer Out Into Superseded Folder

The option saves the layer selected in the dropdown box into a new location (called a superseded folder) by the tool and keeps the current layer open in QGIS. This option allows users to use a centralised database without having to increment the entire database each time. The user saves the superseded layer in a new location for posterity and continues to work the layer in the centralised database. The user is given the option to let the tool automatically supersede the layer or customise the supersede location. The automatic option will save the layer into a folder called ss in the same location as the GPKG (each layer will be given a new GPKG with the same name as the layer).

If the user has the File Management plugin installed, an option to increment the active layer is also available. This simply renames the layer inside the GPKG (no copying is done in this step) and allows the usual workflow of incrementing names to be used with this approach. The File Management plugin is required as this plugin has solved the problem of renaming a layer that is actively open in QGIS.

Increment Layer 04a.png

Examples

Example 1 - Shapefile


Example 2 - GeoPackage



Up
Go-up.png Back to TUFLOW QGIS Plugin Main Page