Exemplo n.º 1
0
        public void Test_Constructor()
        {
            VerticalDatum verticalDatum = new VerticalDatum(DatumType.IHD_Geocentric, "remarks", "authoritycode", "authority", "name", "alias", "abbreviation");

            Assertion.AssertEquals("ctor1.", "remarks", verticalDatum.Remarks);
            Assertion.AssertEquals("ctor2.", "authority", verticalDatum.Authority);
            Assertion.AssertEquals("ctor3.", "authoritycode", verticalDatum.AuthorityCode);
            Assertion.AssertEquals("ctor4.", "name", verticalDatum.Name);
            Assertion.AssertEquals("ctor5.", "alias", verticalDatum.Alias);
            Assertion.AssertEquals("ctor6.", "abbreviation", verticalDatum.Abbreviation);
            Assertion.AssertEquals("ctor7.", DatumType.IHD_Geocentric, verticalDatum.DatumType);
        }
        public void Test_Constructor()
        {
            VerticalDatum datum = VerticalDatum.Ellipsoidal;
            IAxisInfo     axis  = AxisInfo.Altitude;
            ILinearUnit   unit  = LinearUnit.Meters;

            VerticalCoordinateSystem vcs = new VerticalCoordinateSystem("test1", datum, axis, unit);

            Assertion.AssertEquals("Test1", datum, vcs.VerticalDatum);
            Assertion.AssertEquals("Test2", 1.0, vcs.VerticalUnit.MetersPerUnit);
            Assertion.AssertEquals("ctor. 3", unit, vcs.VerticalUnit);
            Assertion.AssertEquals("ctor. 4", axis, vcs.GetAxis(0));
        }
Exemplo n.º 3
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(GeodeticDatum != null ? GeodeticDatum.ToStepValue() : "$");
            parameters.Add(VerticalDatum != null ? VerticalDatum.ToStepValue() : "$");
            parameters.Add(MapProjection != null ? MapProjection.ToStepValue() : "$");
            parameters.Add(MapZone != null ? MapZone.ToStepValue() : "$");
            parameters.Add(MapUnit != null ? MapUnit.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
        private static IVerticalDatum  ReadVerticalDatum(WktStreamTokenizer tokenizer)
        {
            //VERT_DATUM["Ordnance Datum Newlyn",2005,AUTHORITY["5101","EPSG"]]
            tokenizer.ReadToken("[");
            string datumName = tokenizer.ReadDoubleQuotedWord();

            tokenizer.ReadToken(",");
            tokenizer.NextToken();
            string datumTypeNumber = tokenizer.GetStringValue();

            tokenizer.ReadToken(",");
            string authority     = "";
            string authorityCode = "";

            tokenizer.ReadAuthority(ref authority, ref authorityCode);
            DatumType      datumType     = (DatumType)Enum.Parse(typeof(DatumType), datumTypeNumber);
            IVerticalDatum verticalDatum = new VerticalDatum(datumType, "", authorityCode, authority, datumName, "", "");

            tokenizer.ReadToken("]");
            return(verticalDatum);
        }
Exemplo n.º 5
0
        private static IVerticalDatum  ReadVerticalDatum(XmlTextReader reader)
        {
            /*
             *		<?xml version="1.0"?>
             *              <IVerticalDatum DatumType="2005">
             *  <IInfo AuthorityCode="5101" Abbreviation="ODN" Authority="EPSG" Name="Ordnance Datum Newlyn"/>
             * </IVerticalDatum>
             */
            if (!(reader.NodeType == XmlNodeType.Element && reader.Name == "CS_VerticalDatum"))
            {
                throw new ParseException(String.Format("Expected a IVerticalDatum but got a {0} at line {1} col {2}", reader.Name, reader.LineNumber, reader.LinePosition));
            }

            string    datumTypeString = reader.GetAttribute("DatumType");
            DatumType datumType = (DatumType)Enum.Parse(typeof(DatumType), datumTypeString, true);
            string    authority = "", authorityCode = "", abbreviation = "", name = "";

            reader.Read();
            ReadInfo(reader, ref authority, ref authorityCode, ref abbreviation, ref name);
            reader.Read();
            IVerticalDatum verticalDatum = new VerticalDatum(datumType, "", authorityCode, authority, name, "", abbreviation);

            return(verticalDatum);
        }