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


C# ISpatialReference.GetFalseOriginAndUnits方法代码示例

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


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

示例1: FormatSpatialReference

 public static string FormatSpatialReference(ISpatialReference sr)
 {
     try
     {
         if (sr == null)
         {
             return "";
         }
         StringBuilder builder = new StringBuilder();
         if (sr is UnknownCoordinateSystemClass)
         {
             builder.Append("UnknownCoordinateSystem");
         }
         else
         {
             if (sr.Name == "Unknown")
             {
                 builder.Append("UnknownCoordinateSystem");
             }
             else
             {
                 IGeographicCoordinateSystem system2;
                 if (sr is IProjectedCoordinateSystem)
                 {
                     Exception exception;
                     IProjectedCoordinateSystem system = sr as IProjectedCoordinateSystem;
                     builder.Append("投影坐标系:\n");
                     builder.Append("  Name:").Append(system.Name).Append("\n");
                     builder.Append("  Alias:").Append(system.Alias).Append("\n");
                     builder.Append("  Abbreviation:").Append(system.Abbreviation).Append("\n");
                     builder.Append("  Remarks:").Append(system.Remarks).Append("\n");
                     builder.Append("投影:").Append(system.Projection.Name).Append("\n");
                     builder.Append("投影参数:\n");
                     builder.Append("   False_Easting:").Append(system.FalseEasting).Append("\n");
                     builder.Append("   False_Northing:").Append(system.FalseNorthing).Append("\n");
                     builder.Append("   Central_Meridian:").Append(system.get_CentralMeridian(true)).Append("\n");
                     try
                     {
                         builder.Append("   Scale_Factor:").Append(system.ScaleFactor).Append("\n");
                     }
                     catch { }
                     builder.Append("   Latitude_Of_Origin:0\n");
                     builder.Append("Linear Unit:").Append(system.CoordinateUnit.Name).Append("(").Append(system.CoordinateUnit.MetersPerUnit).Append(")\n");
                     builder.Append("Geographic Coordinate System:\n");
                     system2 = system.GeographicCoordinateSystem;
                     builder.Append("  Name:").Append(system2.Name).Append("\n");
                     builder.Append("  Alias:").Append(system2.Alias).Append("\n");
                     builder.Append("  Abbreviation:").Append(system2.Abbreviation).Append("\n");
                     builder.Append("  Remarks:").Append(system2.Remarks).Append("\n");
                     builder.Append("  Angular Unit:").Append(system2.CoordinateUnit.Name).Append("(").Append(system2.CoordinateUnit.RadiansPerUnit).Append(")\n");
                     builder.Append("  Prime Meridian:").Append(system2.PrimeMeridian.Name).Append("(").Append(system2.PrimeMeridian.Longitude).Append(")\n");
                     builder.Append("  Datum:").Append(system2.Datum.Name).Append("\n");
                     builder.Append("    Spheroid:").Append(system2.Datum.Spheroid.Name).Append("\n");
                     builder.Append("      Semimajor Axis:").Append(system2.Datum.Spheroid.SemiMajorAxis).Append("\n");
                     builder.Append("      Semiminor Axis:").Append(system2.Datum.Spheroid.SemiMinorAxis).Append("\n");
                     builder.Append("      Inverse Flattening:").Append((double)(1.0 / system2.Datum.Spheroid.Flattening)).Append("\n");
                     builder.Append("X/Y Domain:\n");
                     try
                     {
                         double num = 0.0;
                         double num2 = 0.0;
                         double num3 = 0.0;
                         double num4 = 0.0;
                         double num5 = 0.0;
                         sr.GetDomain(out num, out num3, out num2, out num4);
                         sr.GetFalseOriginAndUnits(out num, out num2, out num5);
                         builder.Append(" Min X:").Append(num).Append("\n");
                         builder.Append(" Min Y:").Append(num2).Append("\n");
                         builder.Append(" Max X:").Append(num3).Append("\n");
                         builder.Append(" Max Y:").Append(num4).Append("\n");
                         builder.Append(" XYScale:").Append(num5).Append("\n");
                         builder.Append("\n");
                     }
                     catch (Exception exception1)
                     {
                         exception = exception1;
                     }
                     builder.Append("Z Domain:\n");
                     try
                     {
                         double num6;
                         double num7;
                         double num8 = 0.0;
                         sr.GetZDomain(out num6, out num7);
                         sr.GetZFalseOriginAndUnits(out num6, out num8);
                         builder.Append("  Min Z:").Append(num6).Append("\n");
                         builder.Append("  Max Z:").Append(num7).Append("\n");
                         builder.Append("  ZScale:").Append(num8).Append("\n");
                         builder.Append("\n");
                     }
                     catch (Exception exception2)
                     {
                         exception = exception2;
                     }
                     try
                     {
                         double num9;
                         double num10;
                         builder.Append("M Domain:\n");
                         double num11 = 0.0;
//.........这里部分代码省略.........
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:101,代码来源:SpatialReferenceHelper.cs


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