Ejemplo n.º 1
0
 public virtual bool IsVerticalDatum(OgcDatumType type)
 {
     return(type == OgcDatumType.VerticalOther ||
            type == OgcDatumType.VerticalOrthometric ||
            type == OgcDatumType.VerticalEllipsoidal ||
            type == OgcDatumType.VerticalAltitudeBarometric ||
            type == OgcDatumType.VerticalNormal ||
            type == OgcDatumType.VerticalGeoidModelDerived ||
            type == OgcDatumType.VerticalDepth);
 }
Ejemplo n.º 2
0
 private void WriteBasicDatum(IDatum entity, WktKeyword keyword, OgcDatumType ogcDatumType)
 {
     Contract.Requires(entity != null);
     Write(keyword);
     WriteOpenParenthesis();
     WriteQuoted(entity.Name);
     WriteComma();
     WriteValue((int)ogcDatumType);
     if (null != entity.Authority)
     {
         WriteComma();
         Write(entity.Authority);
     }
     WriteCloseParenthesis();
 }
Ejemplo n.º 3
0
        public IDatum ReadBasicDatumFromParams(OgcDatumType defaultDatumType)
        {
            Contract.Ensures(Contract.Result <IDatum>() != null);
            IAuthorityTag authority = null;
            var           name      = String.Empty;
            var           datumType = OgcDatumType.None;

            foreach (var parameter in ReadParams())
            {
                if (parameter is string)
                {
                    name = (string)parameter;
                }
                else if (parameter is IAuthorityTag)
                {
                    authority = (IAuthorityTag)parameter;
                }
                else if (parameter is double)
                {
                    datumType = (OgcDatumType)(int)(double)parameter;
                }
                else if (parameter is int)
                {
                    datumType = (OgcDatumType)(int)parameter;
                }
            }

            if (null != authority)
            {
                var datum = Options.GetDatum(authority);
                if (null != datum)
                {
                    return(datum);
                }
            }

            return(new OgcDatum(
                       name,
                       datumType,
                       authority
                       ));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a local datum.
 /// </summary>
 /// <param name="name">The datum name.</param>
 /// <param name="type">The datum type code.</param>
 /// <param name="authority">The authority.</param>
 public OgcDatum(string name, OgcDatumType type, IAuthorityTag authority)
     : base(name, authority)
 {
     Contract.Requires(name != null);
     OgcType = type;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs a local datum.
 /// </summary>
 /// <param name="name">The datum name.</param>
 /// <param name="type">The datum type code.</param>
 /// <param name="authority">The authority.</param>
 public OgcDatum(string name, OgcDatumType type, IAuthorityTag authority)
     : base(name, authority)
 {
     Contract.Requires(name != null);
     OgcType = type;
 }