public void Load() { FileCode = Util.FromBigEndian(br.ReadInt32()); br.BaseStream.Seek(20, SeekOrigin.Current); FileLength = Util.FromBigEndian(br.ReadInt32()) * 2; FileVersion = br.ReadInt32(); ShpType = (ShapeType)br.ReadInt32(); TotalXYRange = new RangeXY(); ZRange = new Range(); MRange = new Range(); TotalXYRange.Load(ref br); ZRange.Load(ref br); MRange.Load(ref br); ContentLength = FileLength - 100; long curPoint = 0; RecordSet = new List <ShpRecord>(); while (curPoint < ContentLength) { ShpRecord record = new ShpRecord(ShpType); record.Load(ref br); long size = record.GetLength(); RecordSet.Add(record); curPoint += record.GetLength(); } }
public void Load(ref BinaryReader br) { XYRange = new RangeXY(); XYRange.Load(ref br); NumPoints = br.ReadInt32(); Points = new Point[NumPoints]; for (int i = 0; i < NumPoints; i++) { Points[i] = new Point(); Points[i].Load(ref br); } ZRange = new Range(); ZRange.Load(ref br); ZValues = new double[NumPoints]; for (int i = 0; i < NumPoints; i++) { ZValues[i] = br.ReadDouble(); } MRange = new Range(); MRange.Load(ref br); MValues = new double[NumPoints]; for (int i = 0; i < NumPoints; i++) { MValues[i] = br.ReadDouble(); } }
public void Load(ref BinaryReader br) { XYRange = new RangeXY(); XYRange.Load(ref br); NumPoints = br.ReadInt32(); Points = new Point[NumPoints]; for (int i = 0; i < NumPoints; i++) { Points[i] = new Point(); Points[i].Load(ref br); } }
public void Load() { FileCode = Util.FromBigEndian(br.ReadInt32()); br.BaseStream.Seek(20, SeekOrigin.Current); FileLength = Util.FromBigEndian(br.ReadInt32()) * 2; FileVersion = br.ReadInt32(); ShpType = (ShapeType)br.ReadInt32(); TotalXYRange = new RangeXY(); ZRange = new Range(); MRange = new Range(); TotalXYRange.Load(ref br); ZRange.Load(ref br); MRange.Load(ref br); int ContentLength = FileLength - 100; long curPoint = 0; RecordSet = new List <ShxRecord>(); while (curPoint < ContentLength) { ShxRecord record = new ShxRecord(); record.Load(ref br); RecordSet.Add(record); curPoint += record.GetLength(); } try { ContentsFile = (ShpFile)FileFactory.CreateInstance(shpPath); } catch (Exception) { ContentsFile = null; } }