///<summary> ///重投影影像,一幅影像转换到另一 ///投影下的一幅影像 ///</summary> /// <param name="pSrcDS">源数据集</param> /// <param name="pszSrcWKT">源数据集坐标(WKT)描述,为NULL ///将从pSrcDS读出相应信息</param> /// <param name="pDstDS">目标数据集</param> /// <param name="pszDstWKT">目标数据集坐标(WKT)描述,为NULL ///将从pSrcDS读出相应信息</param> /// <param name="eResampleMthd">采样方法</param> /// <param name="dfMaxErro">最大误差单位是pixel,用于创建近似变换</param> /// <param name="pfnProgress">进度解析函数 ,可为NULL</param> /// <param name="pProgressArg">进度反馈对象,可为NULL</param> ///<returns>1,表示投影成功,0表示变换失败</returns> public static bool ReprojectImage(EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDS, byte[] pszSrcWKT, EarthView.World.Spatial2D.Raster.RasterDataSet pDstDS, byte[] pszDstWKT, EarthView.World.Spatial2D.Raster.EVRESAMPLEMETHOD eResampleMthd, double dfMaxErro, EarthView.World.Spatial2D.Raster.ProgressInfo pProgressArg) { byte ret = EarthView_World_Spatial2D_Raster_CReprojectAlg_reprojectImage_ev_bool_CRasterDataSet_ev_char_CRasterDataSet_ev_char_EVResampleMethod_ev_real64_CProgressInfo(object.Equals(pSrcDS, null) ? IntPtr.Zero : pSrcDS.NativeObject, pszSrcWKT, object.Equals(pDstDS, null) ? IntPtr.Zero : pDstDS.NativeObject, pszDstWKT, eResampleMthd, dfMaxErro, object.Equals(pProgressArg, null) ? IntPtr.Zero : pProgressArg.NativeObject); return(Convert.ToBoolean(ret)); }
///<summary>/////////////////////////////////////////////////////////////////////// ///重投影影像,一幅影像转换到创建指定 ///投影的一幅影像 ///</summary> /// <param name="pSrcDS">源数据集</param> /// <param name="ptans">变换类</param> /// <param name="pszDstFilename">指定创建后目标数据集的文件夹</param> /// <param name="eDatasetFormat">要创建的目标数据集类型</param> /// <param name="eResampleMthd">采样方法</param> /// <param name="dfMaxErro">最大误差单位是pixel,用于创建近似变换</param> /// <param name="pfnProgress">进度解析函数 </param> /// <param name="pProgressArg">进度反馈对象</param> ///<returns>1,表示投影成功,0表示变换失败</returns> public static bool CreateAndReprojectImage(EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDS, EarthView.World.Spatial.Utility.CoordinateTransformation ptans, byte[] pszDstFilename, EarthView.World.Spatial2D.Raster.EVDATASETFORMAT eDatasetFormat, EarthView.World.Spatial2D.Raster.EVRESAMPLEMETHOD eResampleMthd, double dfMaxErro, EarthView.World.Spatial2D.Raster.ProgressInfo pProgressArg) { byte ret = EarthView_World_Spatial2D_Raster_CReprojectAlg_createAndReprojectImage_ev_bool_CRasterDataSet_CCoordinateTransformation_ev_char_EVDataSetFormat_EVResampleMethod_ev_real64_CProgressInfo(object.Equals(pSrcDS, null) ? IntPtr.Zero : pSrcDS.NativeObject, object.Equals(ptans, null) ? IntPtr.Zero : ptans.NativeObject, pszDstFilename, eDatasetFormat, eResampleMthd, dfMaxErro, object.Equals(pProgressArg, null) ? IntPtr.Zero : pProgressArg.NativeObject); return(Convert.ToBoolean(ret)); }
///<summary> ///复制一个数据集 ///</summary> /// <param name="pszCopypath">目标数据集路径,为""创建内存数据集</param> /// <param name="pSrcDataset">源数据集对象</param> /// <param name="erasterType">创建相应对象选项,如JPEG,Tif,img Png等</param> /// <param name="pfnProgress">进度函数</param> /// <param name="pProssiInfo">进度信息类</param> ///<returns>返回一个数据集对象,要显示调用close函数才能将数据集刷到硬盘</returns> public static EarthView.World.Spatial2D.Raster.RasterDataSet CreateCopy(string pszCopypath, EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDataset, EarthView.World.Spatial2D.Raster.EVDATASETFORMAT erasterType, EarthView.World.Spatial2D.Raster.ProgressInfo pProssiInfo) { IntPtr __ptr = EarthView_World_Spatial2D_Raster_CRasterFileOperator_createCopy_CRasterDataSet_EVString_CRasterDataSet_EVDataSetFormat_CProgressInfo(pszCopypath, object.Equals(pSrcDataset, null) ? IntPtr.Zero : pSrcDataset.NativeObject, erasterType, object.Equals(pProssiInfo, null) ? IntPtr.Zero : pProssiInfo.NativeObject); if (__ptr == IntPtr.Zero) { return(null); } EarthView.World.Spatial2D.Raster.RasterDataSet csObj = new EarthView.World.Spatial2D.Raster.RasterDataSet(CreatedWhenConstruct.CWC_NotToCreate); csObj.BindNativeObject(__ptr, "CRasterDataSet"); IClassFactory csObjClassFactory = GlobalClassFactoryMap.Get(csObj.GetCppInstanceTypeName()); if (csObjClassFactory != null) { csObj.Delegate = true; csObj = csObjClassFactory.Create() as EarthView.World.Spatial2D.Raster.RasterDataSet; csObj.BindNativeObject(__ptr, "CRasterDataSet"); } return(csObj); }
///<summary> ///重投影影像,一幅无投影影像转换到 ///一幅有投影的影像上 ///</summary> /// <param name="pSrcDS">源数据集</param> ///将从pSrcDS读出相应信息</param> /// <param name="pszDstFilename">指定创建后目标数据集的文件夹</param> /// <param name="pszDstWKT">目标数据集坐标(WKT)描述</param> /// <param name="eDatasetFormat">要创建的目标数据集类型</param> /// <param name="pfnProgress">进度解析函数 ,可为NULL</param> /// <param name="pProgressArg">进度反馈对象,可为NULL</param> ///<returns>1,表示投影成功,0表示变换失败</returns> public static bool DefineProjectImage(EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDS, byte[] pszDstFilename, byte[] pszDstWKT, EarthView.World.Spatial2D.Raster.EVDATASETFORMAT eDatasetFormat, EarthView.World.Spatial2D.Raster.ProgressInfo pProgressArg) { byte ret = EarthView_World_Spatial2D_Raster_CReprojectAlg_DefineProjectImage_ev_bool_CRasterDataSet_ev_char_ev_char_EVDataSetFormat_CProgressInfo(object.Equals(pSrcDS, null) ? IntPtr.Zero : pSrcDS.NativeObject, pszDstFilename, pszDstWKT, eDatasetFormat, object.Equals(pProgressArg, null) ? IntPtr.Zero : pProgressArg.NativeObject); return(Convert.ToBoolean(ret)); }
///<summary> ///栅格矢量化 ///<summary> ///<param = "pszSrcFile">输入文件路径</param> ///<param = "pszDstFile">输出文件路径</param> ///<param = "iBandIndex">指定输出栅格文件要处理的波段,默认为第一波段</param> ///<param = "bIs8Con">连通方式,八连通还是四连通,true为8联通(默认),false为四连通</param> ///<param = "pszFormat">输出文件格式,默认为ESRI Shapefile</param> ///<returns>返回值</returns> ///<summary> public bool ImagePolygonize(byte[] pszSrcFile, byte[] pszDstFile, int iBandIndex, bool bIs8Con, byte[] pszFormat, EarthView.World.Spatial2D.Raster.ProgressInfo pProgressArg) { byte ret = EarthView_World_Spatial2D_Analyst_CRasterDataAnalysis_ImagePolygonize_ev_bool_char_char_int_bool_char_CProgressInfo(this.NativeObject, pszSrcFile, pszDstFile, iBandIndex, Convert.ToByte(bIs8Con), pszFormat, object.Equals(pProgressArg, null) ? IntPtr.Zero : pProgressArg.NativeObject); return(Convert.ToBoolean(ret)); }