Difference between revisions of "QGIS to update MapInfo model"

From Tuflow
Jump to navigation Jump to search
Line 5: Line 5:
 
Follow these steps:
 
Follow these steps:
 
<ol>
 
<ol>
<li> Familarise yourself with the projection of the MapInfo files used by the model.
+
<li> Open  QGIS.
 +
<li> Familarise yourself with the projection of the MapInfo files used by the 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.
 +
* Right click the MapInfo File in the QGIs Layer Panel and select Properties.
 +
* Select "Information" and review the CRS details.
 +
<li> Initialise your QGIS session using the TUFLOW Plugin:
 +
* Select ''Plugins >> TUFLOW >> Edditing > Create/Configure TUFLOW Project''.
 +
* Select the open MapInfo file via the ''Source Project Layer'' drop menu. this will populate the Projection infromation for you.
 +
* Select the folder that contains the TUFLOW model.
 +
* 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 (eg. TUFLOW/gis)
 +
* Tick Create Template Files. This will create the QGIS empty template files for any future additons to the model.
 +
<li> Open the two TCF Files:
 +
*''TUFLOW/runs/Create_Empties.tcf''; and
 +
* The TCF 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> 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> Save the command below <font color="blue"><tt>SHP Projection</tt></font> <font color="red"><tt>==</tt></font><tt> ..\model\gis\Projection.prj</tt>
 +
</tt> in the MapInfo model TCF file.
 +
<li> Also in the MapInfo model TCF file, change the command <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt><tt>MIF</tt> to <font color="blue"><tt>GIS Format</tt></font> <font color="red"><tt> == </tt><tt>SHP</tt>
 +
 
 +
 
 +
MI Projection == ..\model\mi\Projection.mif ! Sets the GIS projection for the TUFLOW Model
 +
 
 +
 
 +
Write Empty GIS Files == ..\model\gis\empty
 +
 
 +
 
 
</ol>
 
</ol>
  

Revision as of 15:44, 16 June 2021

Can I use QGIS for a model originally developed in MapInfo? The answer is, 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.

Follow these steps:

  1. Open QGIS.
  2. Familarise yourself with the projection of the MapInfo files used by the 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.
    • Right click the MapInfo File in the QGIs Layer Panel and select Properties.
    • Select "Information" and review the CRS details.
  3. Initialise your QGIS session using the TUFLOW Plugin:
    • Select Plugins >> TUFLOW >> Edditing > Create/Configure TUFLOW Project.
    • Select the open MapInfo file via the Source Project Layer drop menu. this will populate the Projection infromation for you.
    • Select the folder that contains the TUFLOW model.
    • 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 (eg. TUFLOW/gis)
    • Tick Create Template Files. This will create the QGIS empty template files for any future additons to the model.
  4. Open the two TCF Files:
    • TUFLOW/runs/Create_Empties.tcf; and
    • The TCF 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 TCF for the existing TUFLOW model using the MapInfo format inputs below, MI Projection ==
  7. Save the command below SHP Projection == ..\model\gis\Projection.prj in the MapInfo model TCF file.
  8. Also in the MapInfo model TCF file, change the command GIS Format == MIF to GIS Format == SHP MI Projection == ..\model\mi\Projection.mif ! Sets the GIS projection for the TUFLOW Model Write Empty GIS Files == ..\model\gis\empty
  • Use the same projection as MapInfo files and add SHP Projection == ..\model\gis\Projection.prj to the MI Projection command. Both should be included in the model.
  • Replace GIS Format == MIF with GIS Format == SHP. This will apply to check files and results.
  • Create empty TUFLOW files with Write Empty GIS Files == ..\model\gis\empty. These will automatically generate SHP format files when GIS Format == SHP is specified.

If changes need to be made to existing MapInfo layers, use QGIS to convert MIF to SHP by either:

  • Exporting MIF files to shapefiles.
  • Copying MIF features (points, lines and polygons separately) into a TUFLOW empty file in shapefile format.

After the conversion, attributes should be checked if they were transferred correctly.



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