+}
+
+QString HYDROData_ShapeFile::GetShapeTypeName(int theType)
+{
+ switch (theType)
+ {
+ case 0:
+ return "null shape";
+ case 1:
+ return "point (unsupported by HYDRO)";
+ case 3:
+ return "arc/polyline (supported by HYDRO)";
+ case 5:
+ return "polygon (supported by HYDRO)";
+ case 8:
+ return "multipoint (unsupported by HYDRO)";
+ case 11:
+ return "pointZ (unsupported by HYDRO)";
+ case 13:
+ return "arcZ/polyline (supported by HYDRO)";
+ case 15:
+ return "polygonZ (unsupported by HYDRO)";
+ case 18:
+ return "multipointZ (unsupported by HYDRO)";
+ case 21:
+ return "pointM (unsupported by HYDRO)";
+ case 23:
+ return "arcM/polyline (supported by HYDRO)";
+ case 25:
+ return "polygonM (unsupported by HYDRO)";
+ case 28:
+ return "multipointM (unsupported by HYDRO)";
+ case 31:
+ return "multipatch (unsupported by HYDRO)";
+ default:
+ return "unknown";
+ }
+}
+
+int HYDROData_ShapeFile::TryOpenShapeFile(QString theFileName)
+{
+ QString aSHPfile = theFileName.simplified();
+ QString aSHXfile = theFileName.simplified().replace( ".shp", ".shx", Qt::CaseInsensitive);
+ FILE* pFileSHP = NULL;
+ pFileSHP = fopen (aSHPfile.toAscii().data(), "r");
+ FILE* pFileSHX = NULL;
+ pFileSHX = fopen (aSHXfile.toAscii().data(), "r");
+
+ if (pFileSHP == NULL || pFileSHX == NULL)
+ {
+ if (pFileSHP == NULL)
+ return -1;
+ if (pFileSHX == NULL)
+ return -2;
+ }
+
+ fclose (pFileSHP);
+ fclose (pFileSHX);
+ return 0;