Difference between revisions of "QGIS to update MapInfo model"

From Tuflow
Jump to navigation Jump to search
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Question''': Can I use QGIS as the modelling build/update environment if a model has previously been developed using MapInfo?<br>  
+
'''Question''': Can I use QGIS as the model build/update environment if a model has previously been developed using MapInfo?<br>  
'''Answer''': Yes<br>
+
'''Answer''': Yes. TUFLOW models can use a combination of MapInfo MIF/MID and QGIS SHP files. The existing MapInfo files can be left in their current form and new updates can be added using SHP format files created using QGIS (or other GIS software for that matter). <br><br>
  
 
 
TUFLOW models can use a combination of MapInfo MIF/MID and QGIS SHP files. The existing MapInfo files can be left in their current form and new updates can be added using SHP format. <br>
 
<br>
 
Follow these steps:
 
 
<ol>
 
<ol>
<li> Open  QGIS.
+
<li> Open  QGIS. If you haven't already, install the <u>[[TUFLOW_QGIS_Plugin | QGIS TUFLOW Plugin]]</u>.
<li> Familarise yourself with the projection of the MapInfo files used by the model. You can do this using QGIS:
+
<li> Familarise yourself with the projection of the MapInfo files used by the existing model. You can do this using QGIS:
* Drag a mif file from the existing model into the Map Window of QGIS. The will open it for viewing. Editing the read only file in QGIS is not possible.
+
* Drag a mif file from the existing model folder into the Map Window of QGIS. This will open it for viewing. Editing the read only file in QGIS will not possible.
* Right click the MapInfo File in the QGIs Layer Panel and select Properties.
+
* Right click the MapInfo file in the QGIS Layer Panel and select ''Properties''.
* Select "Information" and review the CRS details.
+
[[File:MapInfo_to_QGIS_006.PNG|450px]]<br>
 +
* Select ''Information'' in the left title block and review the listed CRS details.
 +
[[File:MapInfo_to_QGIS_007.PNG|450px]]<br>
 
<li> Initialise your QGIS session using the TUFLOW Plugin:
 
<li> Initialise your QGIS session using the TUFLOW Plugin:
 
* Select '''Plugins >> TUFLOW >> Editing > Create/Configure TUFLOW Project'''.
 
* Select '''Plugins >> TUFLOW >> Editing > Create/Configure TUFLOW Project'''.
* Select the open MapInfo file via the Source Project Layer drop menu. this will populate the Projection information for you.
+
* Select the open MapInfo file via the Source Project Layer drop menu. This will populate the Projection information for you. Check the projection details match the CRS details from the previous step.
* Select the folder that contains the TUFLOW model.
+
* Select the folder that contains the existing TUFLOW model using the MapInfo format inputs. You will be adding QGIS inputs to the same folder location.
 
* Select the TUFLOW Executable location.
 
* Select the TUFLOW Executable location.
* Tick TUFLOW Classic / HPC
+
* Tick TUFLOW Classic / HPC.
* Tick Save Default Settings
+
* Tick Save Default Settings.
* Tick Create Model Folder Structure. This will add any missing folders to the existing folder structure (e.g. TUFLOW/gis)  
+
* Tick Create Model Folder Structure. This will add any missing folders to the existing folder structure (e.g. TUFLOW/gis).
 
* Tick Create Template Files. This will create the QGIS empty template files for any future additions to the model.
 
* Tick Create Template Files. This will create the QGIS empty template files for any future additions to the model.
<li> Open the two TCF Files:  
+
* Select ''OK''.
*'''TUFLOW/runs/Create_Empties.tcf'''; and  
+
[[File:MapInfo_to_QGIS_008.PNG|450px]]<br>
* The TCF for the existing TUFLOW model using the MapInfo format inputs.
+
<li> Open the following two TCF Files:  
 +
*'''TUFLOW/runs/Create_Empties.tcf'''. this file was created when you completed the ''Create/Configure TUFLOW Project'' steps; and  
 +
* The TCF file for the existing TUFLOW model using the MapInfo format inputs.
 
<li> Copy the following command line to clipboard from '''Create_Empties.tcf''': <font color="blue"><tt>SHP Projection</tt></font> <font color="red"><tt>==</tt></font><tt> ..\model\gis\Projection.prj</tt>  
 
<li> Copy the following command line to clipboard from '''Create_Empties.tcf''': <font color="blue"><tt>SHP Projection</tt></font> <font color="red"><tt>==</tt></font><tt> ..\model\gis\Projection.prj</tt>  
<li> Paste the command to the TCF for the existing TUFLOW model using the MapInfo format inputs below <font color="blue"><tt>MI Projection</tt></font> <font color="red"><tt>==</tt></font>  
+
<li> Paste the command to the existing TUFLOW model TCF (the one using the MapInfo format inputs) below <font color="blue"><tt>MI Projection</tt></font> <font color="red"><tt>==</tt></font>  
<li> Also in the MapInfo model TCF file, change the command <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt></font> <tt>MIF</tt> to <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt></font> <tt>SHP</tt>
+
<li> Also in the existing TUFLOW model TCF, replace the command <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt></font> <tt>MIF</tt> with, <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt></font> <tt>SHP</tt><br>
 +
[[File:MapInfo_to_QGIS_009.PNG|450px]]<br>
 
</ol>
 
</ol>
 +
You will now be able to add compatible QGIS SHP format files to your model. The QGIS TUFLOW Plugin "Import empty file" tool is recommended when importing new template files to add new model inputs. <br>
 +
[[File:MapInfo_to_QGIS_010.PNG|450px]]<br>
  
You will now be able to add compatible QGIS SHP format files to your model.<br>
+
Where possible, when updating a model it is best practice to leave the MapInfo file references as is, and use TUFLOW's data layering functionality to add new GIS entries below existing MapInfo entries. Their location below the existing entries will mean they take precedence wherever the dataset overlap. For example.<br>
 
+
[[File:MapInfo_to_QGIS_012.PNG|800px]]<br>
It is best practice to leave the MapInfo file references as is, and use TUFLOW's data layering functionality the add new GIS entries below existing MapInfo entries. For example.
+
However, if you need to make changes to existing MIF files, follow these steps to convert the MIF files to SHP file format:
 
 
 
 
If you need to make changes to existing MIF files, follow these steps:
 
<ol>
 
<li> Open the MapInfo MIF file in GIS. If the file includes a combination of regions, lines and points QGIS will display a pop up message asking which of these features you would like to open. Select all. QGIS will split the MIF file into it's respective object types.
 
<li> Import empty QGIS SHP template files for the required object types.
 
<li> Copy the features from the MapInfo layers to the relevant new QGIS SHP files. Note, double check the attribute values have been correctly transferred to the new file. In some rare instances, when the field attribute type is incompatible this does not occur.
 
<li> Update the commands within your updated TUFLOW model to reference to the new QGIS SHP files. For future traceability it is best to comment out the prior MapInfo input commands, instead of deleting them.
 
 
<ol>
 
<ol>
 +
<li> Open the MapInfo MIF file in GIS. The easiest way to do this is to drag and drop the file from Windows Explorer to the QGIS Map or Layer Window. If the MapInfo file includes a combination of regions, lines and point objects QGIS will display a pop-up message asking which of these features you would like to open. Select "Select All", then "OK". QGIS will split the MIF file into its respective object types.
 +
<li> Import empty QGIS SHP template files for the required object types.<br>
 +
[[File:MapInfo_to_QGIS_010.PNG|450px]]<br>
 +
[[File:MapInfo_to_QGIS_014.PNG|600px]]<br>
 +
<li> Copy the features from the MapInfo layers to the relevant new QGIS SHP files. Note, double check the attribute values have been correctly transferred to the new file. In some rare instances when the field attribute type is incompatible this does not occur.
 +
<li> Update the commands within your updated TUFLOW model to reference to the new QGIS SHP files. For future traceability it is best to comment out the prior MapInfo input commands using <font color="green"><tt>!</tt></font>, instead of deleting them.<br>
 +
</ol>
 +
[[File:MapInfo_to_QGIS_013.PNG|800px]]<br>
  
 
<br>
 
<br>

Latest revision as of 09:16, 22 June 2021

Question: Can I use QGIS as the model build/update environment if a model has previously been developed using MapInfo?
Answer: Yes. TUFLOW models can use a combination of MapInfo MIF/MID and QGIS SHP files. The existing MapInfo files can be left in their current form and new updates can be added using SHP format files created using QGIS (or other GIS software for that matter).

  1. Open QGIS. If you haven't already, install the QGIS TUFLOW Plugin.
  2. Familarise yourself with the projection of the MapInfo files used by the existing model. You can do this using QGIS:
    • Drag a mif file from the existing model folder into the Map Window of QGIS. This will open it for viewing. Editing the read only file in QGIS will not possible.
    • Right click the MapInfo file in the QGIS Layer Panel and select Properties.
    MapInfo to QGIS 006.PNG
    • Select Information in the left title block and review the listed CRS details.
    MapInfo to QGIS 007.PNG
  3. Initialise your QGIS session using the TUFLOW Plugin:
    • Select Plugins >> TUFLOW >> Editing > Create/Configure TUFLOW Project.
    • Select the open MapInfo file via the Source Project Layer drop menu. This will populate the Projection information for you. Check the projection details match the CRS details from the previous step.
    • Select the folder that contains the existing TUFLOW model using the MapInfo format inputs. You will be adding QGIS inputs to the same folder location.
    • Select the TUFLOW Executable location.
    • Tick TUFLOW Classic / HPC.
    • Tick Save Default Settings.
    • Tick Create Model Folder Structure. This will add any missing folders to the existing folder structure (e.g. TUFLOW/gis).
    • Tick Create Template Files. This will create the QGIS empty template files for any future additions to the model.
    • Select OK.
    MapInfo to QGIS 008.PNG
  4. Open the following two TCF Files:
    • TUFLOW/runs/Create_Empties.tcf. this file was created when you completed the Create/Configure TUFLOW Project steps; and
    • The TCF file for the existing TUFLOW model using the MapInfo format inputs.
  5. Copy the following command line to clipboard from Create_Empties.tcf: SHP Projection == ..\model\gis\Projection.prj
  6. Paste the command to the existing TUFLOW model TCF (the one using the MapInfo format inputs) below MI Projection ==
  7. Also in the existing TUFLOW model TCF, replace the command GIS Format == MIF with, GIS Format == SHP
    MapInfo to QGIS 009.PNG

You will now be able to add compatible QGIS SHP format files to your model. The QGIS TUFLOW Plugin "Import empty file" tool is recommended when importing new template files to add new model inputs.
MapInfo to QGIS 010.PNG

Where possible, when updating a model it is best practice to leave the MapInfo file references as is, and use TUFLOW's data layering functionality to add new GIS entries below existing MapInfo entries. Their location below the existing entries will mean they take precedence wherever the dataset overlap. For example.
MapInfo to QGIS 012.PNG
However, if you need to make changes to existing MIF files, follow these steps to convert the MIF files to SHP file format:

  1. Open the MapInfo MIF file in GIS. The easiest way to do this is to drag and drop the file from Windows Explorer to the QGIS Map or Layer Window. If the MapInfo file includes a combination of regions, lines and point objects QGIS will display a pop-up message asking which of these features you would like to open. Select "Select All", then "OK". QGIS will split the MIF file into its respective object types.
  2. Import empty QGIS SHP template files for the required object types.
    MapInfo to QGIS 010.PNG
    MapInfo to QGIS 014.PNG
  3. Copy the features from the MapInfo layers to the relevant new QGIS SHP files. Note, double check the attribute values have been correctly transferred to the new file. In some rare instances when the field attribute type is incompatible this does not occur.
  4. Update the commands within your updated TUFLOW model to reference to the new QGIS SHP files. For future traceability it is best to comment out the prior MapInfo input commands using !, instead of deleting them.

MapInfo to QGIS 013.PNG



Up
Go-up.png Back to QGIS Tips And Tricks