PPTOK课件站

展开

首页 > 科学课件PPT
GIS二次开发-几何对象与空间参考PPT
  • 立即下载
  • PPT预览

    • GIS二次开发-几何对象与空间参考PPT

    PPT摘要

    这是GIS二次开发-几何对象与空间参考PPT下载,主要介绍了几何对象与空间参考;几何对象概述;高级几何对象包括以下类型;Polygon对象;画单个点;画两个单独的点;几何图形的包络线;路径(Path)对象;Polygon对象;空间参考;2000大地坐标系统简介;传统做法;桥接模式;装饰模式,欢迎点击下载哦。

    第5章 几何对象与空间参考
    几何对象概述
    使用几何对象
    空间参考
    几何对象与桥接模式
    5.1 几何对象概述
    Geometry对象用于表达要素或元素的几何形状。
    ArcGIS的几何对象被分为两个层次
    一是构成要素形状的几何图形,称为“高级几何对象”
    另一种是组成这些高级几何对象的构件
    GEOMETRY模型图
    高级几何对象包括以下类型:
    Point:具有X、Y坐标值,以及可选的属性,如高程(Z值),测量值(M)和ID号。
    Multipoint:是无序点的群集,它用于表示具有相同属性设置的同一组点。
    Polyline:是一个有序路径(Path)的集合,这些路径既可以是连续的,也可以是离散的。
    Polygon:是环(Ring)的集合,环是一种封闭的路径。Polygon可以由一个或者多个环组成,甚至环内套环,形成岛环的情况,但是内外环之间不能重叠。
    Envelope:是一个矩形,它用于表示要素的空间范围。它覆盖了几何对象的最小坐标和最大坐标、Z值和M值的变化范围。
    几何构件:Paths, Rings and Segments用于构建 polylines 和polygons. Polylines contain paths and polygons contain rings. Paths and Rings are sequences of vertices connected by segments.
    Polyline(多义线)对象是相连或不相连的路径对象的有序集合,它可以分别是单个路径、多个不相连的路径和多个相连路径的集合。
    路径是连续Segment对象的集合,除了路径的第一个和最后一个Segment外,每一个Segment的起始点都是前一个片断的终止点,即路径对象中的Segment不能出现分离的情况。路径可以是任意数目的Line、CircularArc、EllipticArc和BezierCurve的组合。一个或多个路径对象组成一个Polyline对象。
    Polygon对象
    Polygon(多边形)对象是一个有序环对象的集合,这些环可以是一个或者多个。多边形对象通常可以用于描述具有面积的多边形离散矢量对象。
    一个几何对象的每个顶点,除了有XY坐标值外,还可以有其它可选属性,如Z值、M值和ID。
    IZAware
    IMAware
     IPointIDAware
    画单个点
    IPoint pnt = new PointClass() as IPoint;
    pnt.PutCoords(100, 100);
    IZAware zAware = pnt as IZAware;
    zAware.ZAware = true;
     pnt.Z = 11.1;
     axMapControl1.DrawShape(pnt);
    5.1.1 Point 与 Multipoint 对象
    5.1.2 Point对象
    可参看组件对象模型图
    沿线构造法
    角平分线构造法
    构造角度交点
    构造角度距离点
    构造角度偏转交点
    5.1.3 Multipoint 对象
    画两个单独的点
                object Missing = Type.Missing;
                IPoint pP1, pP2;
                pP1 = new PointClass();
                pP2 = new PointClass();
                pP1.PutCoords(100, 100);
                pP2.PutCoords(150, 150);
                IPointCollection lp;
                lp = new  MultipointClass() ;                    
                lp.AddPoint(pP1, ref Missing, ref  Missing);
                lp.AddPoint(pP2, ref Missing, ref Missing);
                axMapControl1.DrawShape(lp as IGeometry);
    构造圆弧点
    构造等长度点
    构造交点
    产生一个点的曲线两个切点
    5.1.4 包络线 Envelope
    几何图形的包络线
    交集
    并集
    IEnvelope运算
             object Missing = Type.Missing;
                IEnvelope penv, penv2, penv3;
                penv = (IEnvelope)g1.Envelope;
                penv2 = (IEnvelope)g2.Envelope;
                MessageBox.Show(penv2.XMax.ToString());
                penv2.Intersect(penv);
                MessageBox.Show(penv2.XMax.ToString());
    5.1.5 曲线(Curve)
    5.1.5 Segment
    5.1.5.1 CircularArc
    5.1.5.2 Line 对象
    构造线段
    pLine1.FromPoint = pPoint1;
    pLine1.ToPoint = pPoint2;
    pLine2.FromPoint = pPoint2;
    pLine2.ToPoint = pPoint3;
    ISegmentCollection pPath;
    pPath = new PathClass();
    pPath.AddSegment(pLinel);
    pPath.AddSegment(pLine2);
    5.1.5.3 EllipticArc对象
    5.1.5.4 BezierCurve 对象
    产生BezierCurve 曲线
    Dim pBezier As IBezierCurve
    pBezier = New BezierCurveClass()
    Dim pPoint As IPoint
    pPoint = New PointClass()
    pPoint.PutCoords(20, 30)
    pBezier.PutCoord(2, pPoint)
    5.1.6 􄏃路径(Path)对象􁇍􄈵
    产生Path
    pLine1.FromPoint = pPoint1;
    pLine1.ToPoint = pPoint2;
    pLine2.FromPoint = pPoint2;
    pLine2.ToPoint = pPoint3;
    ISegmentCollection pPath;
    pPath = new PathClass();
    pPath.AddSegment(pLinel);
    pPath.AddSegment(pLine2);
    5.1.7 环(Ring)对象
    环的几个重要属性
    产生环(Ring)对象
    5.1.8 PolyCurve对象
    5.1.9 Polyline对象
    //’产生构造线段的点
    IPoint pPoint1;IPoint pPoint2;
    pPoint1 = new PointClass();
    pPoint1.PutCoords(100, 20);
    pPoint2 = new PointClass();
    pPoint2.PutCoords(20, 310);
    IGeometryCollection pPolyline;
    pPolyline = new PolylineClass();
    ISegmentCollection pPath;
    pPath = new PathClass();
    //产生线段对象将其添加到段
    ILinepLine;
    object Missing1 = Type.Missing;
    object Missing2 = Type.Missing;
    pLine = new LineClass();
    pLine.PutCoords(pPoint1, pPoint2);
    pPath.AddSegment(pLine as ISegment,ref Missing, ref Missing2);
    ‘将路径对象添加到多义线对象
    pPolyline.AddGeometry(pPath as IGeometry,ref Missing, ref Missing2);
    5.1.10 Polygon对象
    使用段来构造多边形
    //产生一个环,向其添加段对象
    ISegmentCollection pSegCol;
    pSegCol = new RingClass();
    object Missing1 = Type.Missing;
    object Missing2 = Type.Missing;
    pSegCol.AddSegment(pSegmentA,ref Missing1, ref Missing2);
    pSegCol.AddSegment(pSegmentB,ref Missing1, ref Missing2
    //封闭环对象,使其有效
    IRing pRing ;
    pRing = pSegCol as IRing;;
    pRing.Close();
    //使用用环来构造多边形
    IGeometryCollection pPolygon;
    pPolygon = new PolygonClass();
    pPolygon.AddGeometry(pRing,ref Missing1, ref Missing2);
    5.1.11Multipatch
    Multipatch     Multipatch用于描述3D面状几何类型,由一系列的矢量三角形构成,如果其中的part是一个ring,那么它必须是封闭的,第一个节点和最后一个节点相同,另外每个part所包含节点的顺序非常重要,Inner Rings在Outer Rings之后,代表单个表面patch的一系列rings必须由第一个ring开始。
    5.1.11.1Triangle strip
    5.1.11.2 Trangle Fan
    5.1.11.3 Triangle
    5.12 Geomtry集合
    5.12.1     IGeomtryCollection
    5.12.2   ISegmentCollection
    5.12.2   IPointCollection
    5.1.13 几何对象小结
    5.2  使用几何对象
    5.2.1 Working with the geometry environment
    The GeometryEnvironment object is a singleton object, so calling new several times does not create a new object each time. Instead, it returns a reference to the existing GeometryEnvironment.
    GeometryEnvironment provides a way of creating geometries from different inputs and setting or getting global variables for controlling the behavior of geometry methods. It also provides Java and .NET friendly versions of methods originally defined on other geometry objects (see the IGeometryBridge and IGeometryBridge2 interfaces). 
    See “Using IGeometryBridge or IGeometryBridge2”
    5.2.2  Create a multipoint
    Building a multipoint using points
    The following code shows how to build a multipoint using a collection of points. This approach is preferred when the user has a sequence of vertices as input.
    Creating a multipoint using existing geometries
    A multipoint can be created based on existing geometries. In the following code, a multipoint is generated by buffering an existing polyline and getting the vertices of the result polygon:
    Building a multipoint using points
    public void SetWKSPoints()
    {   int length = 10;    WKSPoint[] pointArray = new WKSPoint[length];
        for (int i = 0; i < length; i++)
        {  pointArray[i] = new WKSPoint();   
           pointArray[i].X = i * 10;       pointArray[i].Y = i * 10;   }
        IPointCollection4 pointCollection = new MultipointClass();
        //add points to pointCollection
       IGeometryBridge2 geometryBridge = new GeometryEnvironmentClass();
       geometryBridge.AddWKSPoints(pointCollection, ref pointArray);
    }
    Creating a multipoint using existing geometries
     public void CreateMultipointFromExistingGeometry(IPolyline pPoly)
            {  ITopologicalOperator2 pTopoOp2 = pPoly as ITopologicalOperator2;
                pTopoOp2.IsKnownSimple_2 = false;    
                pTopoOp2.Simplify();
                IPolygon pBufferedPoly = pTopoOp2.Buffer(5) as IPolygon;
                IPointCollection pPointCollPoly = pBufferedPoly as IPointCollection;
                IGeometry pMultipoint = new MultipointClass();
                pMultipoint.SpatialReference = pPoly.SpatialReference;
                IPointCollection pPointCollMultipoint = pMultipoint as IPointCollection;
                pPointCollMultipoint.AddPointCollection(pPointCollPoly);
            }
    5.2.3  Create a polyline
    Building a polyline using points
    Building a polyline using segments
    Creating a polyline using existing geometries
    Building a polyline using points
    public void CreatePolylineByPoints()
            {   int length = 10;
                WKSPoint[] pointArray = new WKSPoint[length];
                for (int i = 0; i < length; i++)
                {   pointArray[i] = new WKSPoint();
                    pointArray[i].X = i * 10;    pointArray[i].Y = i * 10;
                }
                IPointCollection4 pointCollection = new PolylineClass();
                IGeometryBridge2 geometryBridge = new GeometryEnvironmentClass();
                geometryBridge.SetWKSPoints(pointCollection, ref pointArray);
            }
    Building a polyline using segments
    public void CreatePolylineBySegments()
            {   IPolyline pSegPoly = new PolylineClass();
                ICircularArc cArc = new CircularArcClass();
                IBezierCurve bCur = new BezierCurveClass();
                ILine line = new LineClass();
                ISegmentCollection path1 = new PathClass();
                ISegmentCollection path2 = new PathClass();
                object obj=Type.Missing;
                path1.AddSegment(cArc as ISegment,ref obj,ref obj);
                path2.AddSegment(bCur as ISegment, ref obj, ref obj);
                path2.AddSegment(line as ISegment, ref obj, ref obj);
                IGeometryCollection pGeoColl = pSegPoly as IGeometryCollection;
                pGeoColl.AddGeometry(path1 as IGeometry ,ref obj,ref obj);
                pGeoColl.AddGeometry(path2 as IGeometry, ref obj, ref obj);
    IPoint pPnt = new PointClass();
                pPnt.X = -10;
                pPnt.Y = 0;
                cArc.PutCoordsByAngle(pPnt, 0, 3.14159265358979, 10.0);
                IPoint[] pntArray = new IPoint[4];
                for (int i = 0; i <= 4; i++) pntArray[i] = new PointClass();
                pntArray[0].X = 10; pntArray[0].Y = 0;
                pntArray[1].X = 10; pntArray[1].Y = 10;
                pntArray[2].X = 20; pntArray[2].Y = 10;
                pntArray[3].X = 20; pntArray[3].Y = 0;
                bCur.PutCoords(4,ref pntArray[0]);
                line.FromPoint.PutCoords(20, 0);
                line.ToPoint.PutCoords(30, 0);
                pGeoColl.GeometriesChanged();
            }
    Creating a polyline using existing geometries
    public void CreatePolylineFromExistingGeometries ( IPolygon pPolygon1, IPolygon pPolygon2)
            {   //Build a new polyline by intersecting two existing polygons.
                ITopologicalOperator2 pTopoOp2 = pPolygon1 as ITopologicalOperator2;
                pTopoOp2.IsKnownSimple_2 = false;
                pTopoOp2.Simplify();
                IPolyline pPoly = pTopoOp2.Intersect(pPolygon2, esriGeometryDimension.esriGeometry1Dimension) as IPolyline;
            }
    4.2.4 Create a polygon
    Building a polygon using points
    Building a polygon using segments
    Creating a polygon using existing geometries
    Building a polygon using points
    public void CreatePolygonByPoints()
            {   int length = 10;
                WKSPoint[] pointArray = new WKSPoint[length];
                for (int i = 0; i < length; i++)
                {   pointArray[i] = new WKSPoint();
                    pointArray[i].X = i * 10;       pointArray[i].Y = i * 10;
                }
                IGeometryBridge2 pGeoBrg = new GeometryEnvironmentClass();
                IPointCollection4 pPointColl = new PolygonClass();
                //add points to pointCollection
                pGeoBrg.SetWKSPoints(pPointColl, ref pointArray);
            }
    Building a polygon using segments
    public void CreatePolygonBySegments()
            {
                IPolygon pSegPoly = new PolygonClass();
                ICircularArc cArc = new CircularArcClass();
                IBezierCurve bCur = new BezierCurveClass();
                ISegmentCollection ring1 = new RingClass();
                ISegmentCollection ring2 = new RingClass();
                object obj = Type.Missing;
                ring1.AddSegment(cArc as ISegment, ref obj, ref obj);
                ring2.AddSegment(bCur as ISegment, ref obj, ref obj);
                IGeometryCollection pGeoColl = pSegPoly as IGeometryCollection;
                pGeoColl.AddGeometry(ring1 as IGeometry, ref obj, ref obj);
                pGeoColl.AddGeometry(ring2 as IGeometry, ref obj, ref obj);
    IPoint pPnt = new PointClass();
                pPnt.X = -10; pPnt.Y = 0;
                cArc.PutCoordsByAngle(pPnt, 0, 2 * 3.14159265358979, 10.0);
                IPoint[] pntArray = new IPoint[4];
                for (int i = 0; i <= 4; i++) pntArray[i] = new PointClass();
                pntArray[0].X = 10; pntArray[0].Y = 0;
                pntArray[1].X = 10; pntArray[1].Y = 10;
                pntArray[2].X = 20; pntArray[2].Y = 10;
                pntArray[3].X = 20; pntArray[3].Y = 0;
                bCur.PutCoords(4, ref pntArray[0]);
                pGeoColl.GeometriesChanged();
            }
    Creating a polygon using existing geometries
    public void CreatePolygonFromExistingGeometries(IPolygon pPolygon1, IPolygon pPolygon2)
            {
                ITopologicalOperator2 pTopoOp2 = pPolygon1 as ITopologicalOperator2;
                pTopoOp2.IsKnownSimple_2 = false;
                pTopoOp2.Simplify();
                IPolygon pPoly = pTopoOp2.Union(pPolygon2) as IPolygon;
            }
    4.2.5  Creating a union of several polygons
    private IPolygon GeometryBag_Example(IFeatureClass featureClass)
            { 
                if (featureClass == null) return null;           
                IGeoDataset geoDataset = featureClass as IGeoDataset;
                IGeometry geometryBag = new GeometryBagClass();
                geometryBag.SpatialReference = geoDataset.SpatialReference;
                IFeatureCursor featureCursor = featureClass.Search(null, false);
                IGeometryCollection geometryCollection = geometryBag as IGeometryCollection;
                IFeature currentFeature = featureCursor.NextFeature();
    while (currentFeature != null)
         {  
             object missing = Type.Missing;
             geometryCollection.AddGeometry(currentFeature.Shape, ref missing, ref missing);
             currentFeature = featureCursor.NextFeature();       
         }
             ITopologicalOperator unionedPolygon = new PolygonClass();
            unionedPolygon.ConstructUnion(geometryBag as IEnumGeometry);
            return unionedPolygon as IPolygon;
            }
    4.2.6  Modify a specific vertex of a polyline
     public void modifyOneVertexOfAPolyline(IPolyline polyline)
            {   double dr=1;      double dht = 0;     int lPart = 0;
                int lVertex = 0;          bool bright = false;
                IGeometryCollection pPolColl = polyline as IGeometryCollection;
                IPolyline pPol = polyline;
                IHitTest pHitTest = pPolColl as IHitTest;
                IPoint querypt = pPol.FromPoint;
                IPoint pHit = new PointClass();
                pHitTest.HitTest(querypt, dr, esriGeometryHitPartType.esriGeometryPartVertex, pHit, ref dht, ref lPart, ref lVertex, ref bright);
                IPointCollection pPathColl = pPolColl.get_Geometry(lPart) as IPointCollection;
                ITransform2D pTrans2D = pPathColl.get_Point(lVertex) as ITransform2D;
                pTrans2D.Move(-10, 0);
                pPathColl.UpdatePoint(lVertex, pTrans2D as IPoint);
            }
    public bool HitTest (    
       IPoint QueryPoint,    
       double searchRadius,    
       esriGeometryHitPartType geometryPart,    
       IPoint hitPoint,    
       ref double hitDistance,    
       ref int hitPartIndex,    
       ref int hitSegmentIndex,    
       ref bool bRightSide );
    The segment index returned has different meanings depending on the esriGeometryHitPartType used .
    EsriGeometryPartVertex: returns a vertex index
    EsriGeometryPartBoundary, esriGeometryPartMidpoint and esriGeometryPartEndpoint: return a segment index
    EsriGeometryPartCentroid: Always returns 0 for the part index and the segment index.
    brightside: Indicates if the input point is on the right side of the input geometry
    5.3  空间参考
    空间参考(Spatial Reference)是GIS数据的骨骼框架,能够将我们的数据定位到相应的位置,为地图中的每一点提供准确的坐标。
    Geodatabase中新建一个要素数据集或一个单独的要素类都必须设置它们的空间参考
    5.3.1 空间参考概述
    坐标是GIS数据的骨骼框架,能够将我们的数据定位到相应的位置,为地图中的每一点提供准确的坐标。     ArcGIS自带了多种坐标系统,在${ArcGISHome}\Coordinate Systems\目录下可以看到三个文件夹,分别是Geographic Coordinate Systems、Projected Coordinate Systems、Vertical Coordinate Systems,中文翻译为地理坐标系、投影坐标系、垂直坐标系。
    Geographic Coordinate Systems
        在Geographic Coordinate Systems目录中,我们可以看到已定义的许多坐标系信息,典型的如Geographic Coordinate Systems\World目录下的WGS 1984.prj,里面所定义的坐标参数:     GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]     里面描述了地理坐标系的名称、大地基准面、椭球体、起始坐标参考点、单位等。
     Projected Coordinate Systems
        在Projected Coordinate Systems目录中同样存在许多已定义的投影坐标系,我国大部分地图所采用的北京54和西安80坐标系的投影文件就在其中,它们均使用高斯-克吕格投影,前者使用克拉索夫斯基椭球体,后者使用国际大地测量协会推荐的IAG 75地球椭球体。如Beijing 1954 3 Degree GK CM 75E.prj定义的坐标参数:     PROJCS["Beijing_1954_3_Degree_GK_CM_75E",GEOGCS["GCS_Beijing_1954",DATUM["D_Beijing_1954",SPHEROID["Krasovsky_1940",6378245.0,298.3]],PRIMEM ["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",500000.0],PARAMETER ["False_Northing",0.0],PARAMETER["Central_Meridian",75.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
    北京54和西安80是我们使用最多的坐标系,先简单介绍高斯-克吕格投影的基本知识,了解就直接跳过,我国大中比例尺地图均采用高斯-克吕格投影,其通常是按6度和3度分带投影,1:2.5万-1:50万比例尺地形图采用经差6度分带,1:1万比例尺的地形图采用经差3度分带。
    具体分带法是:6度分带从本初子午线开始,按经差6度为一个投影带自西向东划分,全球共分60个投影带,带号分别为1-60;
    3度投影带是从东经1度30秒经线开始,按经差3度为一个投影带自西向东划分,全球共分120个投影带。为了便于地形图的测量作业,在高斯-克吕格投影带内布置了平面直角坐标系统,具体方法是,规定中央经线为X轴,赤道为Y轴,中央经线与赤道交点为坐标原点,x值在北半球为正,南半球为负,y值在中央经线以东为正,中央经线以西为负。由于我国疆域均在北半球,x值均为正值,为了避免y值出现负值,规定各投影带的坐标纵轴均西移500km,中央经线上原横坐标值由0变为500km。为了方便带间点位的区分,可以在每个点位横坐标y值的百千米位数前加上所在带号,如20带内A点的坐标可以表示为YA=20 745 921.8m。
     Beijing 1954 3 Degree GK CM 75E.prj     Beijing 1954 3 Degree GK Zone 25.prj     Beijing 1954 GK Zone 13.prj     Beijing 1954 GK Zone 13N.prj     对它们的说明分别如下:     三度分带法的北京54坐标系,中央经线在东75度的分带坐标,横坐标前不加带号     三度分带法的北京54坐标系,中央经线在东75度的分带坐标,横坐标前加带号     六度分带法的北京54坐标系,分带号为13,横坐标前加带号     六度分带法的北京54坐标系,分带号为13,横坐标前不加带号
    Vertical Coordinate Systems
        Vertical Coordinate Systems定义了测量海拔或深度值的原点
    2000大地坐标系统简介
    我国于上世纪50年代和80年代,分别建立了国家大地坐标系统—1954年北京坐标系和1980西安坐标系,测制了各种比例尺地形图,为国民经济和社会发展提供了基础的测绘保障,目前市面已出版地图多以北京54坐标系和西安80坐标系。随着社会的进步,国民经济建设、国防建设和社会发展、科学研究等对国家大地坐标系提出了新的要求,迫切需要采用原点位于地球质量中心的坐标系统(以下简称地心坐标系)作为国家大地坐标系。采用地心坐标系,有利于采用现代空间技术对坐标系进行维护和快速更新,测定高精度大地控制点三维坐标,并提高测图工作效率。 国务院批准自2008年7月1日启用我国的地心坐标系—2000国家大地坐标系,英文名称为China Geodetic Coordinate System 2000,英文缩写为CGCS2000。
    5.3.2 ArcGIS中的坐标系统
    ArcGIS自带了多种坐标系统,在${ArcGISHome}\Coordinate Systems\目录下可以看到三个文件夹,分别是Geographic Coordinate Systems、Projected Coordinate Systems、Vertical Coordinate Systems,分别存储了地理坐标系、投影坐标系、垂直坐标系的定义。
    Geographic Coordinate Systems
    地理坐标系统是确定地物在地球上位置的坐标系。它是以经纬度为地图的存储单位的,而经纬度是角度。
    GEOGCS["GCS_Xian_1980",DATUM["D_Xian_1980",SPHEROID["Xian_1980",6378140.0,298.257] ],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
    Projected Coordinate Systems
    PROJCS["Xian_1980_3_Degree_GK_Zone_38",GEOGCS["GCS_Xian_1980",DATUM["D_Xian_1980",SPHEROID["Xian_1980",6378140.0,298.257]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",38500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",114.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
    Projection: Gauss_Kruger
    False_Easting: 38500000.000000
    False_Northing: 0.000000
    Central_Meridian: 114.000000
    Scale_Factor: 1.000000
    Latitude_Of_Origin: 0.000000
    Linear Unit: Meter (1.000000)
    Geographic Coordinate System: GCS_Xian_1980
    Angular Unit: Degree (0.017453292519943299)
    Prime Meridian: Greenwich (0.000000000000000000)
    Datum: D_Xian_1980
      Spheroid: Xian_1980
        Semimajor Axis: 6378140.000000000000000000
        Semiminor Axis: 6356755.288157528300000000
        Inverse Flattening: 298.257000000000010000
    在Coordinate Systems\Projected Coordinate Systems\Gauss Kruger\Beijing 1954目录中,我们可以看到四种不同的命名方式:
    Beijing 1954 3 Degree GK CM 114E.prj:三度分带法的北京54坐标系,中央经线在东114度的分带坐标,横坐标前不加带号;
    Beijing 1954 3 Degree GK Zone 38.prj:三度分带法的北京54坐标系,中央经线在东114度的分带坐标,横坐标前加带号;
    Beijing 1954 GK Zone 13.prj:六度分带法的北京54坐标系,分带号为13,横坐标前加带号;
    Beijing 1954 GK Zone 13N.prj:六度分带法的北京54坐标系,分带号为13,横坐标前不加带号。
    Vertical Coordinate Systems
    A vertical coordinate system defines the origin for height or depth values.
    Perhaps the most important part of a vertical coordinate system is its unit of measure. The unit of measure is always linear (e.g., international feet or meters). Another important part is whether the z values represent heights (elevations) or depths. For each type, the z-axis direction is positive "up" or "down", respectively.
    VERTCS["Yellow_Sea_1985",VDATUM["Yellow_Sea_1985"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]
    5.3use the SpatialReferenceEnvironment
    The ISpatialReferenceFactory interface provides methods that use the FactoryCode to generate predefined factory spatial reference objects. There are three types of functions on this interface:
    Those that return single object
    Those that return a set of objects of the same type
    Those that are used to import and export SpatialReference objects to and from a PRJ file or a PRJ string representation
    private void PrintPreDefinedProjections()
    { ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
    ISet projectionSet = spatialReferenceFactory.CreatePredefinedProjections(); MessageBox.Show("Number of predefined Projections = " + projectionSet.Count);
    projectionSet.Reset();
    for(int i = 0; i < projectionSet.Count; i++)
    { IProjection projection = projectionSet.Next() as IProjection; MessageBox.Show(projection.Name); }
    }
    private IProjectedCoordinateSystem LoadProjectedCoordinateSystem()
    { ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
      IProjectedCoordinateSystem projectedCoordinateSystem = spatialReferenceFactory.CreateESRISpatialReferenceFromPRJFile("C:\\Program Files\\ArcGIS\\Coordinate Systems\\Projected Coordinate Systems\\World\\Mollweide (world).prj") as IProjectedCoordinateSystem;
    return projectedCoordinateSystem;
     }
    Creating a predefined vertical coordinate system
    private static void GetVCSList()
    {  ISpatialReferenceFactory srFact = new SpatialReferenceEnvironmentClass(); ISpatialReferenceFactory3 srFact3 = srFact as ISpatialReferenceFactory3;
       ISet vcsSet = srFact3.CreatePredefinedVerticalCoordinateSystems();
       vcsSet.Reset();
       IVerticalCoordinateSystem vcs;
      for (int i = 0; i < vcsSet.Count; i++)
      { vcs = vcsSet.Next() as IVerticalCoordinateSystem;
       Console.WriteLine("VCS Name: {0} (Code: {1})", vcs.Name, vcs.FactoryCode);
      }
    }
    private void CreateVerticalReferenceSystem()
    {
     ISpatialReferenceFactory3 spatialReferenceFactory3 = new SpatialReferenceEnvironmentClass();
    IVerticalCoordinateSystem verticalCoordinateSystem = spatialReferenceFactory3.CreateVerticalCoordinateSystem((int) esriSRVerticalCSType.esriSRVertCS_Alicante);
    }
    5.4GeometryEnvironment
     GeometryEnvironment提供了从不同的输入、设置或获取全局变量来创建几何图形的方法,以便控制geometry方法的行为。GeometryEnvironment对象是一个单例对象。
    通过实例来看: IPolyline TestGeometryEnvironment() 引出来:
    5.4.5设计模式-----桥接模式(Bridge Pattern)
    生活中的一个例子:     就拿汽车在路上行驶的来说。即有小汽车又有公共汽车,它们都不但能在市区中的公路上行驶,也能在高速公路上行驶。这你会发现,对于交通工具(汽车)有不同的类型,然而它们所行驶的环境(路)也在变化,在软件系统中就要适应两个方面的变化?怎样实现才能应对这种变化呢?
    结合源码
    概述: 在软件系统中,某些类型由于自身的逻辑,它具有两个或多个维度的变化,那么如何应对这种“多维度的变化”?如何利用面向对象的技术来使得该类型能够轻松的沿着多个方向进行变化,而又不引入额外的复杂度?这就要使用Bridge模式。 意图:    将抽象部分与实现部分分离,使它们都可以独立的变化。                                  ——《设计模式》GOF
    传统做法
    缺点
    首先它在遵循开放-封闭原则的同时,违背了类的单一职责原则,即一个类只有一个引起它变化的原因,而这里引起变化的原因却有两个,即路类型的变化和汽车类型的变化;其次是重复代码会很多,不同的汽车在不同的路上行驶也会有一部分的代码是相同的;再次是类的结构过于复杂,继承关系太多,难于维护,最后最致命的一点是扩展性太差。如果变化沿着汽车的类型和不同的道路两个方向变化,我们会看到这个类的结构会迅速的变庞大。
    Bridge 模式
    Bridge 模式
    优点
    通过对象组合的方式,Bridge 模式把两个角色之间的继承关系改为了耦合的关系,从而使这两者可以从容自若的各自独立的变化,这也是Bridge模式的本意。       这样增加了客户程序与路与汽车的耦合。其实这样的担心是没有必要的,因为这种耦合性是由于对象的创建所带来的,完全可以用创建型模式去解决。
    桥接模式
    桥接模式则把原来的基类的实现化细节抽象出来,在构造到一个实现化的结构中,然后再把原来的基类改造成一个抽象化的等级结构,这样就可以实现系统在多个维度上的独立变化
    装饰模式
          这两个模式在一定程度上都是为了减少子类的数目,避免出现复杂的继承关系。但是它们解决的方法却各有不同,装饰模式把子类中比基类中多出来的部分放到单独的类里面,以适应新功能增加的需要,当我们把描述新功能的类封装到基类的对象里面时,就得到了所需要的子类对象,这些描述新功能的类通过组合可以实现很多的功能组合
     

    相关PPT

    高二地理海洋空间的开发利用 PPT:这是高二地理海洋空间的开发利用PPT下载,主要介绍了探究;海洋空间的开发利用;可利用空间;空间特点;开发利用特点;意义;缺点;丹麦海峡;卡特加特海峡;麦哲伦海峡;海洋交通与通讯的;造陆;海底储藏;利用方式,欢迎点击下载哦。
    第四讲空间开发与PPT:这是第四讲空间开发与PPT下载,主要介绍了空间开发与场地设计;空间;空间形式认知与分析;空间的影响力;空间要素;空间的界定;底面;顶面;垂直物;空间设计;场地设计;地形;地形概念;地形在设计中的作用;利用地形塑造空间;地形的主要类型;地形的设计原则;地形与绿化/道路/建筑的关系,欢迎点击下载哦。
    第四节海洋空间的开发利用PPT:这是第四节海洋空间的开发利用PPT下载,主要介绍了海洋空间开发利用的特点和意义;海洋空间开发利用的主要方式;海洋交通与通讯;围海填海造陆;围海填海造陆;探究;我国沿海地区,尤其是沿海城市人口对土地的压力十分大,请问为何我国目前尚无海上城市;如果你是某海上城市的总设计师,你将重点考虑哪些问题;围海、填海造陆是否越多越好?造陆可能会出现哪些问题,欢迎点击下载哦。
    《GIS二次开发-几何对象与空间参考PPT》是由用户小青鲤于2017-11-05上传,属于科学课件PPT。

    相关PPT

    热门推荐

    热门下载

    举报