void parseDDMParams() { string[] s = File.ReadAllLines(Path.ChangeExtension(_fileName, "hdr")); _comment = "This is a DTM file in Hungarian DDM format"; _coordSystem = s[1]; _dataType = "Hungarian DTM"; _cellsize = Convert.ToInt16(s[12]); _nRows = Convert.ToInt16(s[10].Split(' ')[0]); _nCols = Convert.ToInt16(s[10].Split(' ')[1]); _nBits = 16; _nBands = 1; _bytesPerPixel = 2; string xmn = (s[2].Split(' ')[0]).Replace('.', ','); _ulxmap = Convert.ToSingle(xmn); string ymn = s[2].Split(' ')[1].Replace('.', ','); _ulymap = Convert.ToSingle(ymn); _fileType = fTypes.DDM; if (_cellsize != 0) { _xdim = _cellsize; } _ydim = _cellsize; }
} // the current file name is needed for set _fileName property #region functions and methods // functions and methods ------------------------------------------------------------- void setUpFileType() // set _fileType which is just read { switch (Path.GetExtension(_fileName).ToUpper()) { case ".BIL": _fileType = fTypes.BIL; _comment = "This is an ESRI BIL file"; string fn = Path.ChangeExtension(_fileName, "hdr"); if (File.ReadAllText(fn).Contains("ENVI")) { _fileType = fTypes.ENVI; _comment = "This is an ENVI file"; } return; case ".BSQ": _fileType = fTypes.BSQ; _comment = "This is a BSQ file"; string fnm = Path.ChangeExtension(_fileName, "hdr"); if (File.ReadAllText(fnm).Contains("ENVI")) { _fileType = fTypes.ENVI; _comment = "This is a BSQ file"; } return; case ".CUE": _fileType = fTypes.BSQ; _comment = "This is a Cue file"; string fnn = Path.ChangeExtension(_fileName, "hdr"); if (File.ReadAllText(fnn).Contains("ENVI")) { _fileType = fTypes.ENVI; _comment = "This is a Cue file"; } return; case ".TIF": _fileType = fTypes.TIF; _comment = "No comment"; return; case ".JPG": _fileType = fTypes.JPG; _comment = "No comment"; return; case ".GWH": _fileType = fTypes.GWH; _comment = "No comment"; return; case ".DDM": _fileType = fTypes.DDM; _comment = "No comment"; return; default: _fileType = fTypes.UNKOWN; _comment = "This is an UNKNOWN format"; return; } }
public oFieldRef(fTypes e = fTypes.Default) { switch (e) { case fTypes.Average: ret = ret.Replace(">", " Type='AVG'>"); break; case fTypes.Count: ret = ret.Replace(">", " Type='COUNT'>"); break; case fTypes.Max: ret = ret.Replace(">", " Type='MAX'>"); break; case fTypes.Min: ret = ret.Replace(">", " Type='MIN'>"); break; case fTypes.Sum: ret = ret.Replace(">", " Type='SUM'>"); break; case fTypes.StdDeviation: ret = ret.Replace(">", " Type='STDEV'>"); break; case fTypes.Variance: ret = ret.Replace(">", " Type='VAR'>"); break; default: break; } }