如何实现 ArcEngine+C# 中实现栅格数据投影转换?求救,急急!!!答案有...
发布网友
发布时间:2024-07-11 06:44
我来回答
共2个回答
热心网友
时间:2024-08-01 12:53
搜索半天没一个靠谱的答案,自己写了一个下面 的代码仅供参考public bool ChangeRasterCoordinate(string prjPath, string inputRasterPath, string outRasterPath)
{
var prj = SpatialReferenceHelper.ReadSR(prjPath);//prjPath即你要转换成的坐标系的prj文件;inputRasterPath:需要转换的文件路径;outRasterPath转换完成后的文件路径
Geoprocessor gp = new Geoprocessor();
ProjectRaster projectRaster = new ProjectRaster();
projectRaster.in_raster = inputRasterPath;
projectRaster.out_raster = outRasterPath;
projectRaster.cell_size = "10000";
projectRaster.out_coor_system = prj;
IGeoProcessorResult tGPResult = (IGeoProcessorResult)gp.Execute(projectRaster, null);
if (tGPResult.Status == ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded)
{
return true;
}
return false;
}
热心网友
时间:2024-08-01 12:51
下面是Desktop里面这个Tool参数的说明,我觉得问题可能出现在下面这点的设置上
geographic_transform (Required)
The transformation method used between two geographic systems or datums.
The geographic transformation is optional when the input and output coordinate systems have the same datum. If the input and output datum are different, a geographic transformation needs to be specified.
Learn about geographic transformation methods.
For information on each supported geographic (datum) transformations, see the geographic_transformations.pdf located in <install location>\ArcGIS\Documentation.