/// <summary>
 /// Creates a new instance of GeographicInfo
 /// </summary>
 public GeographicInfo()
 {
     _datum = new Datum();
     _meridian = new Meridian();
     _unit = new AngularUnit();
 }
 private void cmbDatums_SelectedIndexChanged(object sender, EventArgs e)
 {
     Datum d = new Datum((string)cmbDatums.SelectedItem);
     _selectedProjectionInfo.GeographicInfo.Datum = d;
     switch(d.DatumType)
     {
         case DatumTypes.GridShift:
             radGridShift.Checked = true;
             break;
         case DatumTypes.Param3:
             rad3.Checked = true;
             break;
         case DatumTypes.Param7:
             rad7.Checked = true;
             break;
         case DatumTypes.WGS84:
             radWGS84.Checked = true;
             break;
     }
     cmbEllipsoid.SelectedItem = d.Spheroid.Name;
 }
Example #3
0
 /// <summary>
 /// Compares two datums to see if they are actually describing the same thing and
 /// therefore don't need to be transformed.
 /// </summary>
 /// <param name="otherDatum">The other datum to compare against</param>
 /// <returns>The boolean result of the operation.</returns>
 public bool Matches(Datum otherDatum)
 {
     if (_datumtype != otherDatum.DatumType) return false;
     if (_spheroid.EquatorialRadius != otherDatum.Spheroid.EquatorialRadius) return false;
     if (_spheroid.PolarRadius != otherDatum.Spheroid.PolarRadius) return false;
     if(_datumtype == DatumTypes.Param3)
     {
         if (_toWGS84[0] != otherDatum.ToWGS84[0]) return false;
         if (_toWGS84[1] != otherDatum.ToWGS84[1]) return false;
         if (_toWGS84[2] != otherDatum.ToWGS84[2]) return false;
         return true;
     }
     if(_datumtype == DatumTypes.Param7)
     {
         if (_toWGS84[0] != otherDatum.ToWGS84[0]) return false;
         if (_toWGS84[1] != otherDatum.ToWGS84[1]) return false;
         if (_toWGS84[2] != otherDatum.ToWGS84[2]) return false;
         if (_toWGS84[3] != otherDatum.ToWGS84[3]) return false;
         if (_toWGS84[4] != otherDatum.ToWGS84[4]) return false;
         if (_toWGS84[5] != otherDatum.ToWGS84[5]) return false;
         if (_toWGS84[6] != otherDatum.ToWGS84[6]) return false;
         return true;
     }
     if (_datumtype == DatumTypes.GridShift)
     {
         if (_nadGrids.Length != otherDatum.NadGrids.Length) return false;
         for(int i = 0; i < _nadGrids.Length; i++)
         {
             if(_nadGrids[i] != otherDatum.NadGrids[i]) return false;
         }
         return true;
     }
     return false;
 }