做网站网页尺寸是多少钱,网站备案帐号是什么意思,网站建设推广注册公司,网络方案ArcGIS中的投影和坐标转换 1 ArcGIS中坐标系统的定义 一般情况下地理数据库#xff08;如Personal GeoDatabase的 Feature DataSet 、Shape File等#xff09;在创建时都具有空间参考的属性#xff0c;空间参考定义了该数据集的地理坐标系统或投影坐标系统#xff0c;没有…ArcGIS中的投影和坐标转换 1 ArcGIS中坐标系统的定义 一般情况下地理数据库如Personal GeoDatabase的 Feature DataSet 、Shape File等在创建时都具有空间参考的属性空间参考定义了该数据集的地理坐标系统或投影坐标系统没有坐标系统的地理数据在生产应用过程中是毫无意义的但由于在数据格式转换、转库过程中可能造成坐标系统信息丢失或创建数据库时忽略了坐标系统的定义因此需要对没有坐标系统信息的数据集进行坐标系统定义。 坐标系统的定义是在不改变当前数据集中特征X Y值的情况下对该数据集指定坐标系统信息。 操作方法运行ArcGIS9中的ArcMap打开ArcToolBox打开 Data Management Tools -Projections and Transformations-Define Projection 项打开坐标定义对话框。介下来在Input DataSet or Feature Class栏中输入或点击旁边的按钮选择相应的DataSet或Feature Class在Coordinate System栏中输入或点击旁边的按钮选择需要为上述DataSet或Feature定义的坐标系统。最后点OK键即可。 例如 某点状shape文件中 某点P的坐标为 X 112.2 Y 43.3 且该shape文件没有带有相应的Prj文件即没有空间参考信息也不知道X Y 的单位。通过坐标系统定义的操作定义其为Beijing1954坐标那么点P的信息是东经112.2度 北纬43.3度。 2 ArcGIS中的投影方法 投影的方法可以使带某种坐标信息数据源进行向另一坐标系统做转换并对源数据中的X和Y值进行修改。我们生产实践中一个典型的例子是利用该方法修正某些旧地图数据中X,Y值前加了带数和分带方法的数值。 操作方法运行ArcGIS9中的ArcMap打开ArcToolBox打开 Data Management Tools -Projections and Transformations-Feature-Project 项打开投影对话框。在Input DataSet or Feature Class栏中输入或点击旁边的按钮选择相应的DataSet或Feature Class带有空间参考Output DataSet or Feature Class栏中输入或点击旁边的按钮选择目标DataSet或Feature Class在Output Coordinate System 栏中输入或点击旁边的按钮选择目标数据的坐标系统。最后点OK键即可。 例如 某点状shape文件中 某点P的坐标为 X 40705012 Y 3478021 且该shape文件坐标系统为中央为东经120度的高斯克吕格投影在数据使用过程中为了将点P的值改为真实值X 705012 Y478021首先将源数据的投影参数中False_Easting和False_Northing值分别加上40000000和3000000作为源坐标系统修改参数前的坐标系统作为投影操作的目标坐标系统然后通过投影操作后生成一新的Shape文件且与源文件中点P对应的点的坐标为X 705012 Y478021。 3 编程实现坐标转换和投影 3.1 矢量数据投影和坐标转换 相关接口 3.1.1 IGeometry.Project方法 该方法声明如下: (C#语法) public void Project ( ISpatialReference newReferenceSystem ); 该方法对实现Igeoemtry的对象进行投影操作, 参数为目标空间参考.以下代码中实现了对Point对象从一个空间参考到另一个空间参考的投影操作: //Create Spatial Reference Factory ISpatialReferenceFactory srFactory new SpatialReferenceEnvironmentClass(); ISpatialReference sr1; //GCS to project from IGeographicCoordinateSystem gcs srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_NAD1983); sr1 gcs; sr1.SetFalseOriginAndUnits(-180, -90, 1000000); //Projected Coordinate System to project into IProjectedCoordinateSystem pcs srFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1983N_AmericaLambert); pcs.SetFalseOriginAndUnits(0, 0, 1000); ISpatialReference sr2; sr2 pcs; //Point to project IPoint point new PointClass() as IPoint; point.PutCoords(-117.17, 34.06); //Geometry Interface to do actual project IGeometry geometry; geometry point; geometry.SpatialReference sr1; geometry.Project(sr2); point geometry as IPoint; double x; double y; point.QueryCoords(out x, out y); Debug.Print(X: x.ToString()); Debug.Print(Y: y.ToString()); IGeometry接口的Project方法提供的投影操作实现了最基本的坐标转换功能. 实际数据处理过程中, 比较明确数据转换前后空间参考信息情况下一般用此方法作坐标转换,不同投影带之间的坐标转换就是一个典型. 3.1.2 ITransform2D接口 ITransform2D接口不仅提供了图形平移, 旋转和缩放,还提供了更加强大的坐标转换方法Transform. 其定义如下:C#语法 public void Transform ( esriTransformDirection direction, ITransformation transformation ); 在该方法中, 参数direction是转换方向, transformation是一个Itransformation接口, 而Itransformation接口由很多类实现,这意味着不同的实现类,所包含的坐标转换数学公式是不一的, 这里面包括二次多项式转换(AffineTransformation2D), AbridgedMolodensky转换(AbridgedMolodenskyTransformation)等。每一种实现类的转换方法这里不再赘述可参照ArcObjects联机帮助获得更详细的信息下面举例来说明该方法的使用Delphi 代码 procedure Transform_(FromPtColl, ToPtColl: IPointCollection; pGeo as IGeometry); var pAffineTransformation2D: IAffineTransformation2D; ControlPtCnt: integer; FormPtArray: array of IPoint; ToPtArray: array of IPoint; i: integer; pTransform2D: ITransform2D; begin //判断给定的控制点是否合法 if FromPtColl.PointCount ToPtColl.PointCount then begin //控制点不成对错误 exit; end; if FromPtColl.PointCount 4 then begin //控制点不能少于4个 exit; end; ControlPtCnt : FromPtColl.PointCount; SetLength(FormPtArray, ControlPtCnt); SetLength(ToPtArray, ControlPtCnt); for i : 0 to ControlPtCnt -1 do begin FormPtArray[i] : CoPoint.Create as IPoint; FormPtArray[i].PutCoords(FromPtColl.Point[i].X, FromPtColl.Point[i].Y); ToPtArray[i] : CoPoint.Create as IPoint; ToPtArray[i].PutCoords(ToPtColl.Point[i].X, ToPtColl.Point[i].Y); end; //创建 AffineTransformation2D 对象 pAffineTransformation2D : CoAffineTransformation2D.Create as IAffineTransformation2D; //设置控制点信息 pAffineTransformation2D.DefineFromControlPoints(ControlPtCnt, FormPtArray[0], ToPtArray[0]); //转到ITransform2D接口 pTransform2D : pGeo as ITransform2D; //坐标转换 pTransform2d.Transform(esriTransformForward, pAffineTransformation2D); end; ITransform接口较Igeoemtry提供了更加丰富的坐标转换方法。 3.2 影像数据纠正。 影像数据纠正可以通过IrasterGeometryProc接口实现。该接口提供了影像Clip, Filp, Merge, Mirror以及Mosaic等操作。如果通过控制点的方式对影像进行纠正处理可以通过该接口的wrap方法。该方法声明如下:(C#语法) public void Warp ( IPointCollection sourceControlPoints, IPointCollection targetControlPoints, esriGeoTransTypeEnum transformType, IRaster ipRaster ); 参数 sourceControlPoints和targetControlPoint定义了控制点信息, transformType定义了坐标转换方法, ipRaster是需要转换的Raster对象. 以下代码是该接口使用的例子: public static void GeoreferenceRaster(IRasterDataset2 rasterDataset, IPointCollection sourcePoints, IPointCollection targetPoints) { //this sample show how to georeference a raster using control points // sourcePoints: represents source control points // targetPoints: represents target control points IRasterGeometryProc rasterPropc new RasterGeometryProcClass(); IRaster raster rasterDataset.CreateDefaultRaster(); //set the transformatin rasterPropc.Warp(sourcePoints, targetPoints, esriGeoTransTypeEnum.esriGeoTransPolyOrder1, raster); //There are two ways to get the georeferenced result: to save the transformation with the input raster dataset rasterPropc.Register(raster); //or save to another new raster dataset rasterPropc.Rectify(c:\temp\georeferencing_output.img, IMAGINE Image, raster); } 需要注意的是当选择不同的转换类型时(参数transformType取值不同时), 对控制点的对数也有不同的要求. 这个可以参照联机帮助中的详细说明. 此外, 使用IrasterGeometryProc.Wrap方法, 会略微改变影像图的色彩值, 当对一幅影像图前后转换作对比时会发现这种色彩的变化情况. 个人认为,ArcGIS对影像图的处理功能较其他一些专业影像处理软件来讲,还是稍显逊色了些. 转载于:https://www.cnblogs.com/zany-hui/articles/1272568.html