Beispiel #1
0
 private void OnValidate(object sender, EventArgs e)
 {
     try
     {
         double   lat, lon, d, m, s;
         DMS.Flag ind;
         int      len;
         string   tmp;
         DMS.Decode("34d22\'34.567\"", out ind);
         DMS.Decode(-86.0, 32.0, 34.214);
         DMS.DecodeAngle("-67.4532");
         DMS.DecodeAzimuth("85.3245W");
         DMS.DecodeLatLon("86d34\'24.5621\"", "21d56\'32.1234\"", out lat, out lon, false);
         DMS.Encode(-86.453214, out d, out m);
         DMS.Encode(-86.453214, out d, out m, out s);
         DMS.Encode(-86.453214, DMS.Component.SECOND, 12, DMS.Flag.LONGITUDE, 0);
         DMS.Encode(-86.453214, 12, DMS.Flag.LONGITUDE, 0);
         Geohash.DecimalPrecision(12);
         Geohash.Forward(31.23456, -86.43678, 12, out tmp);
         Geohash.GeohashLength(0.001);
         Geohash.GeohashLength(0.002, 0.003);
         Geohash.LatitudeResolution(12);
         Geohash.LongitudeResolution(12);
         Geohash.Reverse("djds54mrfc0g", out lat, out lon, out len, true);
         GARS.Forward(32.0, -86.0, 2, out tmp);
         GARS.Reverse("189LE37", out lat, out lon, out len, true);
         Georef.Forward(32.0, -86.0, 2, out tmp);
         Georef.Reverse("GJEC0000", out lat, out lon, out len, true);
         MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception xcpt)
     {
         MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }