当前位置: 首页>>代码示例>>C#>>正文


C# GeoPoint.CalcUTM方法代码示例

本文整理汇总了C#中GeoPoint.CalcUTM方法的典型用法代码示例。如果您正苦于以下问题:C# GeoPoint.CalcUTM方法的具体用法?C# GeoPoint.CalcUTM怎么用?C# GeoPoint.CalcUTM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeoPoint的用法示例。


在下文中一共展示了GeoPoint.CalcUTM方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestCalcUTM

        public void TestCalcUTM()
        {
            // Dresden according to Wikipedia : 13° 44' 29"E 51° 02' 55"N
            GeoPoint basePoint = new GeoPoint(51.0 + 02.0 / 60.0 + 55.0 / 3600.0, 13.0 + 44.0 / 60.0 + 29.0 / 3600.0);
            UtmPoint utmPoint = basePoint.CalcUTM();

            // Expected result: Zone 33 North, Northing 5655984 Easting 411777
            UtmPoint expected = new UtmPoint(411777, 5655984, 33, true);
            Assert.IsTrue(expected.Equals(utmPoint));
        }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:10,代码来源:GeoPoint_Test.cs

示例2: SameZone

 private Boolean SameZone(UtmPoint point)
 {
     GeoPoint geoPoint = new GeoPoint(point, Datum);
     UtmPoint realUtm = geoPoint.CalcUTM();
     Boolean result = (CentralPoint.ZoneNumber == realUtm.ZoneNumber);
     return result;
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:7,代码来源:MgrsGridElement.cs

示例3: LimitToZone

 private UtmPoint LimitToZone(UtmPoint point)
 {
     UtmPoint result = new UtmPoint(point);
     Int32 minEasting = 0;
     Int32 maxEasting = 0;
     if ( point.Easting < CentralPoint.Easting )
     {
         minEasting = point.Easting;
         maxEasting = minEasting + GridSize(_Digits);
     }
     else
     {
         maxEasting = point.Easting;
         minEasting = maxEasting - GridSize(_Digits);
     }
     Int32 leftZone = 0;
     {
         UtmPoint tempUtmPoint = new UtmPoint(point);
         tempUtmPoint.Easting = minEasting;
         GeoPoint tempGeoPoint = new GeoPoint(tempUtmPoint, Datum);
         tempUtmPoint = tempGeoPoint.CalcUTM();
         leftZone = tempUtmPoint.ZoneNumber;
     }
     Int32 eastingDiff = maxEasting - minEasting;
     while ( eastingDiff > 1 )
     {
         Int32 tempEasting = minEasting + eastingDiff / 2;
         result = new UtmPoint(point);
         result.Easting = tempEasting;
         GeoPoint tempGeoPoint = new GeoPoint(result, Datum);
         UtmPoint empUtmPoint = tempGeoPoint.CalcUTM();
         if ( empUtmPoint.ZoneNumber > leftZone )
         {
             maxEasting = tempEasting;
         }
         else
         {
             minEasting = tempEasting;
         }
         eastingDiff = eastingDiff / 2;
     }
     return result;
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:43,代码来源:MgrsGridElement.cs

示例4: edt_LatLong_TextChanged

 private void edt_LatLong_TextChanged(object sender, EventArgs e)
 {
     if ( !_Changing )
     {
         GeoPoint geoPoint = null;
         UtmPoint utmPoint = null;
         try
         {
             _Changing = true;
             geoPoint = new GeoPoint(edt_LatLong.Text);
             geoPoint.Datum = (GeoDatum)cbx_datum.SelectedItem;
             GeoPoint lGeoOtherDatum = new GeoPoint(geoPoint);
             lGeoOtherDatum.Datum = (GeoDatum)cbx_datum.SelectedItem;
             utmPoint = lGeoOtherDatum.CalcUTM();
         }
         catch
         {
             // invalid string
             geoPoint = null;
             utmPoint = null;
         }
         SetValues(geoPoint, utmPoint, sender);
         _Changing = false;
     }
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:25,代码来源:GeoCoordinateForm.cs


注:本文中的GeoPoint.CalcUTM方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。