Exemplo n.º 1
0
        private static void Test_ReadA()
        {
            ReaderFactory factory = new ReaderFactory();

            SWIGTYPE_p_std__istream ifs = Liblas.ReaderFactory.FileOpen(fileA);

            // the "using" here is required, because it forces the Reader
            // to be disposed before the stream explicitly goes away
            using (Reader reader = factory.CreateWithStream(ifs))
            {
                TestReader.Test_A(reader);

                Header header = reader.GetHeader();
                TestHeader.Test_A(header);

                TestGuid.Test_A(header.GetProjectId());

                VectorVariableRecord vlrs = header.GetVLRs();
                TestVariableRecord.Test_A(vlrs);

                SpatialReference srs = header.GetSRS();
                TestSpatialReference.Test(srs);

                bool ok = reader.ReadPointAt(2);
                Debug.Assert(ok);
                Point pt = reader.GetPoint();
                TestPoint.Test_A2(pt);
            }

            Liblas.ReaderFactory.FileClose(ifs);
        }
Exemplo n.º 2
0
        private static void Test_ReadT()
        {
            SWIGTYPE_p_std__istream ifs = Liblas.ReaderFactory.FileOpen(fileT);

            ReaderFactory factory = new ReaderFactory();

            using (Reader reader = factory.CreateWithStream(ifs))
            {
                TestReader.Test_T(reader);

                Header header = reader.GetHeader();
                TestHeader.Test_T(header);

                TestGuid.Test_T(header.GetProjectId());

                VectorVariableRecord vlrs = header.GetVLRs();
                TestVariableRecord.Test_T(vlrs);

                SpatialReference srs = header.GetSRS();
                TestSpatialReference.Test(srs);

                bool ok = reader.ReadPointAt(2);
                Debug.Assert(ok);
                Point pt = reader.GetPoint();
                TestPoint.Test_B2(pt);
            }
            Liblas.ReaderFactory.FileClose(ifs);
        }