...ArcEngine+C# 中实现栅格数据投影转换?求救,急急!!!答案有帮助的加 ...
发布网友
发布时间:2024-10-20 15:24
我来回答
共2个回答
热心网友
时间:2024-11-19 22:05
搜索半天没一个靠谱的答案,自己写了一个下面 的代码仅供参考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-11-19 22:04
下面是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.