Beispiel #1
0
        public void WriteThenReadVerticalDatum()
        {
            VerticalDatumInfo vdi = CreateVDI();

            var locationInfo = new LocationInformation();
            LocationInformation loc;

            locationInfo.XOrdinate         = 765.432;
            locationInfo.VerticalDatumInfo = vdi;
            string path    = "a/b/Location Info";
            var    dssFile = "WriteThenReadVerticalDatum.dss";

            File.Delete(dssFile);
            using (var w = new DssWriter(dssFile))
            {
                w.StoreLocation(path, locationInfo);
            }

            using (var r = new DssReader(dssFile))
            {
                loc = r.GetLocationInfo(path);
                DoAssertions(CreateVDI(), loc.VerticalDatumInfo);
                Assert.AreEqual(locationInfo.XOrdinate, loc.XOrdinate);
            }

            Console.WriteLine(loc.VerticalDatumInfo.ToXml(true));
        }
Beispiel #2
0
 public void ReadLocationFromVersion6File()
 {
     using (var r = new DssReader(TestUtility.BasePath + "sample.dss"))
     {
         string path = "//SACRAMENTO/TEMP-MAX/01JAN1877/1DAY/OBS/";
         var    L    = r.GetLocationInfo(path);
     }
 }
Beispiel #3
0
        public void ReadTsWithLocationInfo()
        {
            DssPath path = new DssPath("/MISSISSIPPI/ST. LOUIS/FLOW//1Day/OBS/");

            using (DssReader r = new DssReader(TestUtility.BasePath + "sample7.dss"))
            {
                DateTime t1 = DateTime.Parse("1861-01-02");
                DateTime t2 = DateTime.Parse("1861-01-18");

                var s = r.GetTimeSeries(path, t1, t2);

                var loc = s.LocationInformation;

                Console.WriteLine(loc.CoordinateID);
                Console.WriteLine(loc.XOrdinate);
                Console.WriteLine(loc.YOrdinate);
                Console.WriteLine(loc.ZOrdiante);

                Assert.AreEqual(-901047.2, loc.XOrdinate);
                Assert.AreEqual(383744.4, loc.YOrdinate);
                Assert.AreEqual(CoordinateSystem.LatLong, loc.CoordinateSystem);

                var dt = s.ToDataTable();
                //Assert.AreEqual(15, s.Count);
                Assert.AreEqual(1861, s[14].DateTime.Year);
                Assert.AreEqual(39800, s[16].Value);

                Console.WriteLine(s);


                // read location standalone.

                //var loc2 = r.GetLocationInfo("/MISSISSIPPI/ST. LOUIS/Location Info///");
                var loc2 = r.GetLocationInfo(path.FullPath);

                Console.WriteLine(loc2);

                Assert.AreEqual(-901047.2, loc2.XOrdinate);
                Assert.AreEqual(383744.4, loc2.YOrdinate);
                Assert.AreEqual(CoordinateSystem.LatLong, loc2.CoordinateSystem);
            }
        }
Beispiel #4
0
        public void SupplementalInfo()
        {
            using (var r = new DssReader(TestUtility.BasePath + "VerticalDatumTest_v7.dss"))
            {
                var P = r.GetCatalog();
                for (int i = 0; i < P.Count; i++)
                {
                    if (P[i].Cpart.ToLower().StartsWith("location"))
                    {
                        Console.WriteLine(P[i].FullPath);
                    }
                }

                var L = r.GetLocationInfo("//KEYS/Location Info////");

                Console.WriteLine(L.Supplemental);
                //verticalDatumInfo:H4sIAAAAAAAAAHXQwQrCMAwG4PueouzedQ4mE2phIHjz6D1oCoWuhTXt89taUNR5C/8fvkBkwpXMDSy/A8WFG6c9i87QsdXUqoYx6YBMwtqry/l64sNBio+0rKHFlDPv1H43doMU76DUXuuAxDCQWYAw82ADPi/klvy3/0rqQgIbUfVdL0Udiykquu3TGjf4OfPT9JcfN/kc/n5JNQ84o4x9PAEAAA==;

                /**
                 *
                 * <vertical-datum-info unit="ft">
                 * <native-datum>NGVD-29</native-datum>
                 * <elevation>615.2</elevation>
                 * <offset estimate="false">
                 *  <to-datum>NGVD-29</to-datum>
                 *  <value>0.0</value>
                 * </offset>
                 * <offset estimate="true">
                 *  <to-datum>NAVD-88</to-datum>
                 *  <value>0.5</value>
                 * </offset>
                 * </vertical-datum-info>
                 *
                 *
                 **/
                var vdi = L.VerticalDatumInfo;
                var xml = vdi.ToXml(true);
                Console.WriteLine(xml);
                DoAssertions(CreateVDI(), vdi);
            }
        }