public LasFile(string filename, bool useShortFormat = true) { if (!File.Exists(filename)) { throw new FileNotFoundException(string.Format("File {0} don`t exist!", filename), filename); } Filename = filename; LasHeader = new LasHeader(filename, this); LasVariableLengthRecords = new LasVariableLengthRecords(filename, LasHeader.NumberOfVariableLengthRecords); LasPointDataRecords = new LasPointDataRecords(LasHeader, 250, useShortFormat); }
public LasPointDataRecords(LasHeader header, int cols, bool useShortFormat) { double lengthY = header.MaxY - header.MinY; double lengthX = header.MaxX - header.MinX; double ratio = lengthY / lengthX; _columns = cols; _rows = (int)Math.Ceiling(ratio * cols); _mapPoints = new List <int> [_rows, cols]; _classificationMap = new Dictionary <LasPoint.ClassificationType, List <int> >(); _stepX = lengthX / _columns; _stepY = lengthY / _rows; _points = new List <LasPoint>((int)header.NumberOfPointRecords); _shortFormat = useShortFormat; _header = header; Format = (PointsFormat)header.PointDataFormatId; ReadPoints(); }