Difference between revisions of "TUFLOW Message 0305"

From Tuflow
Jump to navigation Jump to search
Line 3: Line 3:
 
|alt_msg=WARNING 0305 - Projection of .shp file is different to that specified by the GIS Projection == command.
 
|alt_msg=WARNING 0305 - Projection of .shp file is different to that specified by the GIS Projection == command.
 
|type=[[ERROR]] <br> [[WARNING]]
 
|type=[[ERROR]] <br> [[WARNING]]
|message_desc=By default, TUFLOW checks that the projection in each .mif file matches that specified in the <font color="green"><tt>MI Projection == </tt></font> command. This ensures that incoming files are in the same projection as the TUFLOW model. TUFLOW is not a GIS software and does not use the projection information in each file (apart for the check). TUFLOW uses the co-ordinates of the objects in the GIS and locates in the TUFLOW model. Hence the need for a projection check. All model input files should be in the same projection, if inputs are not in the correct projection the data will be in the wrong location and won't be used. If your model is in (for example) MGA 94 zone 56, and the 2d materials (2d_mat) file is in the wrong projection (e.g. NSW ISG 56/1), these material regions (polygons) will be in the wrong location (probably in the middle of the ocean) and they won't be assigned to any model cells.
+
|message_desc=By default, TUFLOW checks that the projection in each '''.shp''' or '''.mif''' file matches that specified in the SHP Projection == or MI Projection == command, respectively. This ensures that incoming files are in the same projection as the TUFLOW model. TUFLOW is not a GIS software and does not use the projection information in each file (apart for the check). TUFLOW uses the co-ordinates of the objects in the GIS layer and locates them in the TUFLOW model. Hence the need for a projection check. All model input files should be in the same projection, if inputs are not in the correct projection the data will be in the wrong location and won't be used. If your model is in (for example) MGA 94 zone 56, and the 2d materials (2d_mat) file is in the wrong projection (e.g. NSW ISG 56/1), these material regions (polygons) will be in the wrong location (probably in the middle of the ocean) and they won't be assigned to any model cells.<br>
<br>
+
This check prevents problems with the data provided having a different projection than the TUFLOW model.<br><br>
This check prevents problems with the data provided having a different projection than the TUFLOW model.<br>
+
<u>Check File Options</u><br>
 +
This check can be set to give either an error (this is the default): <br>
 +
<font color="green"><tt>
 +
SHP Projection Check == ERROR<br>
 +
MI Projection Check == ERROR</tt></font><br>
 +
 
 +
This message can be downgraded to a warning: <br>
 +
<font color="green"><tt>
 +
SHP Projection Check == WARNING<br>
 +
MI Projection Check == WARNING</tt></font><br>
 +
 
 +
Or this check can be turned off entirely using (use with caution!): <br>
 +
<font color="green"><tt>
 +
SHP Projection Check == OFF<br>
 +
MI Projection Check == OFF</tt></font><br>
  
This check can be set to give either an error (this is the default):
+
Care should be taken if turning this check off that all files are in the correct projection.<br>
<font color="green"><tt>MI Projection Check == ERROR</tt></font><br>
 
This message can be downgraded to a warning:
 
<font color="green"><tt>MI Projection Check == WARNING</tt></font><br>
 
Or this check can be turned off entirely using:
 
<font color="green"><tt>MI Projection Check == OFF</tt></font><br>
 
  
Care should be taken if turning this check off!!
 
  
The fourth line of a .mif file contains the projection information, for example it may look like this:<br>
+
<u>Projection Files'''</u><br>
 +
The .prj file associate with each shapefile, or the fourth line of a .mif file contains the projection information. For example it may look like this:<br>
 
<tt>CoordSys Earth Projection 8, 104, "m", 177, 0, 0.9996, 500000, 10000000 Bounds (-7745844.29597, 2035.05676326) (8745844.29597, 19997964.9432)</tt><br>
 
<tt>CoordSys Earth Projection 8, 104, "m", 177, 0, 0.9996, 500000, 10000000 Bounds (-7745844.29597, 2035.05676326) (8745844.29597, 19997964.9432)</tt><br>
 
<br>
 
<br>
Occasionally the last few numbers which are the bounds of the projection, can change even when the projection is the same.  Of this occurs TUFLOW will report a "Message 0305". 
 
  
|suggestions=Check the projection of the problem file.  This can be done in MapInfo by Selecting Table >> Maintenance >> Table Structure and selecting the Projection button.
+
Occasionally the last few numbers which are the bounds of the projection, can change even when the projection is the same. If this occurs, TUFLOW will report a "Message 0305". This is a common occurrence when the same projection is written differently. There are two examples below that are the same projection however written differently:<br>
 +
 
 +
Example 1:<br>
 +
<tt>PROJCS["<font color="red">GDA94</font>_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137,298.257222101]<br>
 +
PROJCS["<font color="red">GDA_1994</font>_MGA_Zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137,298.257222101]</tt><br><br>
 +
Example 2:<br>
 +
<tt>PROJCS["GDA94_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980","<font color="red">6378137</font>,298.257222101]<br>
 +
PROJCS["GDA94_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980","<font color="red">6378137.0</font>,298.257222101]</tt><br><br>
 +
 
 +
In the above case there is a slight difference in the number due to the decimals. Build 2020-01-AB parses the parameter data into number values and compares each of these numbers to check they are consistent. This should provide a more robust check less prone to falsely flagging the projections as different. A new '''.tcf''' command has been added to allow setting to the previous “Simple” string compare:<br>
 +
<font color="green"><tt>SHP Projection Check Method == SIMPLE </tt></font><br>
 +
 
 +
 
 +
|suggestions=As described above, different software (or even different versions of the same GIS software!) can write the same projection in a different way.
 +
To avoid this happening, it is best to develop a model entirely within one GIS software (with the same version number). This can be difficult when given a model created by others or updated an existing model. If this is the case, we suggest:<br>
 +
Check the projection of the problem file.  This can be done in <br>
 +
*QGIS by Layer Properties >> Source under the “Assigned Coordinate Reference System (CRS) header.<br>
 +
*MapInfo by Selecting Table >> Maintenance >> Table Structure and selecting the Projection button.<br>
 
If this is different from the projection of the model, re-project to the correct projection.<br>
 
If this is different from the projection of the model, re-project to the correct projection.<br>
  
If the table is in the same projection as the TUFLOW model, compare the projection line from the .mif file with that specified in the <font color="green"><tt>MI Projection == </tt></font> command.  If the bounds are different, you can overwrite the projection line (line 4) in the problem .mif file with that in the projection.mif, re-import the file and export the file (backup first).  This should correct the issue of the TUFLOW error without changing the GIS data.  If multiple files are different, this message can be set to warning, however you should check all files with this warning to ensure that they are in the same projection as the TUFLOW.mif!<br>
+
If the file is in the same projection as the TUFLOW model, compare the projection line from the '''.shp''' or '''.mif''' file with that specified in the <font color="green"><tt>SHP Projection == </tt></font> or <font color="green"><tt>MI Projection == </tt></font> command.  If the bounds are different, you can overwrite the '''.prj''' file associated with the shapefile with that in the '''projection.shp'''<br>
 +
 
 +
Or for MapInfor, overwrite the projection line (line 4) in the problem .mif file with that in the projection.mif, re-import the file and export the file (backup first).  This should correct the issue of the TUFLOW error without changing the GIS data.  If multiple files are different, this message can be set to warning (as described above), however you should check all files with this warning to ensure that they are in the same projection<br>
 
<br>
 
<br>
 
In order to change the projection in MapInfo it is necessary to save a copy of the table.  To do this:<br>
 
In order to change the projection in MapInfo it is necessary to save a copy of the table.  To do this:<br>

Revision as of 14:42, 28 May 2021

TUFLOW Message
ERROR 0305 - Projection of .mif file is different to that specified by the MI Projection == command.

Alternate Message
WARNING 0305 - Projection of .shp file is different to that specified by the GIS Projection == command.

Message Type
ERROR
WARNING

Description
By default, TUFLOW checks that the projection in each .shp or .mif file matches that specified in the SHP Projection == or MI Projection == command, respectively. This ensures that incoming files are in the same projection as the TUFLOW model. TUFLOW is not a GIS software and does not use the projection information in each file (apart for the check). TUFLOW uses the co-ordinates of the objects in the GIS layer and locates them in the TUFLOW model. Hence the need for a projection check. All model input files should be in the same projection, if inputs are not in the correct projection the data will be in the wrong location and won't be used. If your model is in (for example) MGA 94 zone 56, and the 2d materials (2d_mat) file is in the wrong projection (e.g. NSW ISG 56/1), these material regions (polygons) will be in the wrong location (probably in the middle of the ocean) and they won't be assigned to any model cells.
This check prevents problems with the data provided having a different projection than the TUFLOW model.

Check File Options
This check can be set to give either an error (this is the default):
SHP Projection Check == ERROR
MI Projection Check == ERROR

This message can be downgraded to a warning:
SHP Projection Check == WARNING
MI Projection Check == WARNING

Or this check can be turned off entirely using (use with caution!):
SHP Projection Check == OFF
MI Projection Check == OFF

Care should be taken if turning this check off that all files are in the correct projection.


Projection Files
The .prj file associate with each shapefile, or the fourth line of a .mif file contains the projection information. For example it may look like this:
CoordSys Earth Projection 8, 104, "m", 177, 0, 0.9996, 500000, 10000000 Bounds (-7745844.29597, 2035.05676326) (8745844.29597, 19997964.9432)

Occasionally the last few numbers which are the bounds of the projection, can change even when the projection is the same. If this occurs, TUFLOW will report a "Message 0305". This is a common occurrence when the same projection is written differently. There are two examples below that are the same projection however written differently:

Example 1:
PROJCS["GDA94_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137,298.257222101]
PROJCS["GDA_1994_MGA_Zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980",6378137,298.257222101]


Example 2:
PROJCS["GDA94_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980","6378137,298.257222101]
PROJCS["GDA94_MGA_zone_54",GEOGCS["GCS_GDA_1994",DATUM["D_GDA_1994",SPHEROID["GRS_1980","6378137.0,298.257222101]


In the above case there is a slight difference in the number due to the decimals. Build 2020-01-AB parses the parameter data into number values and compares each of these numbers to check they are consistent. This should provide a more robust check less prone to falsely flagging the projections as different. A new .tcf command has been added to allow setting to the previous “Simple” string compare:
SHP Projection Check Method == SIMPLE

Suggestions
As described above, different software (or even different versions of the same GIS software!) can write the same projection in a different way. To avoid this happening, it is best to develop a model entirely within one GIS software (with the same version number). This can be difficult when given a model created by others or updated an existing model. If this is the case, we suggest:
Check the projection of the problem file. This can be done in

  • QGIS by Layer Properties >> Source under the “Assigned Coordinate Reference System (CRS) header.
  • MapInfo by Selecting Table >> Maintenance >> Table Structure and selecting the Projection button.

If this is different from the projection of the model, re-project to the correct projection.

If the file is in the same projection as the TUFLOW model, compare the projection line from the .shp or .mif file with that specified in the SHP Projection == or MI Projection == command. If the bounds are different, you can overwrite the .prj file associated with the shapefile with that in the projection.shp

Or for MapInfor, overwrite the projection line (line 4) in the problem .mif file with that in the projection.mif, re-import the file and export the file (backup first). This should correct the issue of the TUFLOW error without changing the GIS data. If multiple files are different, this message can be set to warning (as described above), however you should check all files with this warning to ensure that they are in the same projection

In order to change the projection in MapInfo it is necessary to save a copy of the table. To do this:

  • Select File >> Save Copy As
  • Select the table to be saved
  • Select the Projection... button in the dialogue box
  • In the Choose Projection dialogue set the desired projection
  • Set a new file name and select Save

Some images are provided below.
File:Error0305 01.jpg

File:Error0305 02.jpg


Up
Go-up.png 0xxx Messages