///<summary> ///创建指定投影的数据集,只创建Tif格式的数据集 ///</summary> /// <param name="pSrcDS">源数据集</param> /// <param name="pszSrcWKT">源数据集坐标(WKT)描述,为NULL ///将从pSrcDS读出相应信息</param> /// <param name="pszDstWKT">目标数据集坐标(WKT)描述</param> /// <param name="pszDstFilePath">目标数据集所在位置,为NULL创建虚拟数据集</param> /// <param name="iWidth">目标数据集宽度,为0时用源图像对应的宽度</param> /// <param name="iHeight">目标数据集高度,为0时用源图像对应的高度</param> /// <param name="pAffine">仿射变换参数,为NULL时用源图像对应的参数,必须与width跟hieght ///相适应</param> public static EarthView.World.Spatial2D.Raster.RasterDataSet CreateDatasetForProj(EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDS, byte[] pszSrcWKT, byte[] pszDstWKT, byte[] pszDstFilePath, int iWidth, int iHeight, EarthView.World.Spatial2D.Raster.AffineTransform pAffine) { IntPtr __ptr = EarthView_World_Spatial2D_Raster_CReprojectAlg_createDatasetForProj_CRasterDataSet_CRasterDataSet_ev_char_ev_char_ev_char_ev_int32_ev_int32_CAffineTransform(object.Equals(pSrcDS, null) ? IntPtr.Zero : pSrcDS.NativeObject, pszSrcWKT, pszDstWKT, pszDstFilePath, iWidth, iHeight, object.Equals(pAffine, null) ? IntPtr.Zero : pAffine.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="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="pszpath">栅格数据集的路径,可以为空字符串,当为空时创建虚拟对象</param> /// <param name="iWidth">栅格数据集的宽度</param> /// <param name="iHeight">栅格数据集的高度</param> /// <param name="ibandCount">栅格数据集之波段数</param> /// <param name="edatatype">数据类型</param> /// <param name="erasterType">创建相应对象选项,如Tif,img等(PNG\JPG CrateCopy)</param> /// <returns>栅格数据集指针<returns> public static EarthView.World.Spatial2D.Raster.RasterDataSet Create(string pszpath, int iWidth, int iHeight, int ibandCount, EarthView.World.Spatial.GeoDataset.EVRASTERDATATYPE edatatype, EarthView.World.Spatial2D.Raster.EVDATASETFORMAT erasterType) { IntPtr __ptr = EarthView_World_Spatial2D_Raster_CRasterFileOperator_create_CRasterDataSet_EVString_ev_int32_ev_int32_ev_int32_EVRasterDataType_EVDataSetFormat(pszpath, iWidth, iHeight, ibandCount, edatatype, erasterType); 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="pFileBuffer">数据集的二进制流</param> /// <param name="erasterType">创建相应对象选项,如JPEG,Tif,img Png等</param> /// <returns>栅格数据集指针<returns> public static EarthView.World.Spatial2D.Raster.RasterDataSet CreateFormStream(byte[] pFileBuffer, ulong idataLenth, EarthView.World.Spatial2D.Raster.EVDATASETFORMAT erasterType) { IntPtr __ptr = EarthView_World_Spatial2D_Raster_CRasterFileOperator_createFormStream_CRasterDataSet_ev_uchar_ev_uint64_EVDataSetFormat(pFileBuffer, idataLenth, erasterType); 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="pszFullpathName">栅格数据的全路径</param> /// <param name="eAccess">栅格数据集的打开权限</param> /// <returns>栅格数据集指针<returns> public static EarthView.World.Spatial2D.Raster.RasterDataSet Open(string pszFullpathName, EarthView.World.Spatial2D.Raster.EVACCESS eAccess) { IntPtr __ptr = EarthView_World_Spatial2D_Raster_CRasterFileOperator_open_CRasterDataSet_EVString_EVAccess(pszFullpathName, eAccess); 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> /// <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="pszSrcWKT">源数据集坐标(WKT)描述,为NULL ///将从pSrcDS读出相应信息</param> /// <param name="pszDstWKT">目标数据集坐标(WKT)描述</param> /// <param name="iWidth">目标数据集宽度</param> /// <param name="iHeight">目标数据集高度</param> /// <param name="objAffine">仿射变换参数</param> public static void GetSuggestedOutput(EarthView.World.Spatial2D.Raster.RasterDataSet pSrcDS, byte[] pszSrcWKT, byte[] pszDstWKT, ref int iWidth, ref int iheight, ref EarthView.World.Spatial2D.Raster.AffineTransform objAffine) { EarthView_World_Spatial2D_Raster_CReprojectAlg_getSuggestedOutput_void_CRasterDataSet_ev_char_ev_char_ev_int32_ev_int32_CAffineTransform(object.Equals(pSrcDS, null) ? IntPtr.Zero : pSrcDS.NativeObject, pszSrcWKT, pszDstWKT, ref iWidth, ref iheight, object.Equals(objAffine, null) ? IntPtr.Zero : objAffine.NativeObject); }
///<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="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 name="pobjDataSet">栅格数据集指针</param> public static void Close(EarthView.World.Spatial2D.Raster.RasterDataSet pobjDataSet) { EarthView_World_Spatial2D_Raster_CRasterFileOperator_close_void_CRasterDataSet(object.Equals(pobjDataSet, null) ? IntPtr.Zero : pobjDataSet.NativeObject); }
/// <summary> /// 删除数据集 /// </summary> /// <param name=""></param> /// <returns></returns> public void DeleteDataset(EarthView.World.Spatial2D.Raster.RasterDataSet pobjDataSet) { EarthView_World_Spatial2D_Raster_CRasterFileOperator_deleteDataset_void_CRasterDataSet(this.NativeObject, object.Equals(pobjDataSet, null) ? IntPtr.Zero : pobjDataSet.NativeObject); }
public int CreateSlope(EarthView.World.Spatial2D.Raster.RasterDataSet psrcData, byte[] pszDstFile, double scale, int slopeFormat, EarthView.World.Spatial.GeoDataset.EVRASTERDATATYPE eDataType, byte[] pszFormat, int NoDataFlag) { int ret = EarthView_World_Spatial2D_Analyst_CRasterDataAnalysis_CreateSlope_ev_int32_CRasterDataSet_char_double_int_EVRasterDataType_char_int(this.NativeObject, object.Equals(psrcData, null) ? IntPtr.Zero : psrcData.NativeObject, pszDstFile, scale, slopeFormat, eDataType, pszFormat, NoDataFlag); return(ret); }
public int CreateAspect(EarthView.World.Spatial2D.Raster.RasterDataSet psrcData, byte[] pszDstFile, EarthView.World.Spatial.GeoDataset.EVRASTERDATATYPE eDataType, byte[] pszFormat, int NoDataFlag, int bAngleAsAzimuth) { int ret = EarthView_World_Spatial2D_Analyst_CRasterDataAnalysis_CreateAspect_ev_int32_CRasterDataSet_char_EVRasterDataType_char_int_int(this.NativeObject, object.Equals(psrcData, null) ? IntPtr.Zero : psrcData.NativeObject, pszDstFile, eDataType, pszFormat, NoDataFlag, bAngleAsAzimuth); return(ret); }
///<summary> ///图像aoi裁切(由数据集) ///<summary> /// <param = "Dataset">待裁切的数据集</param> ///<param = "pszDstFile">输出文件路径</param> ///<param = "feature">要素类</param> ///<returns>返回值</returns> ///<summary> // ev_int32 ImageCutByAOIByFeature(EarthView::World::Spatial2D::Raster::CRasterDataSet* Dataset, const char* pszDstFile, //EarthView::World::Spatial::GeoDataset::IFeatureClass* featureclass); ///<summary> ///图像aoi裁切(由数据集) ///<summary> /// <param = "Dataset">待裁切的数据集</param> ///<param = "pszDstFile">输出文件路径</param> ///<param = "feature">多边形类</param> ///<returns>返回值</returns> ///<summary> public int ImageCutByAOIByPolygon(EarthView.World.Spatial2D.Raster.RasterDataSet Dataset, byte[] pszDstFile, EarthView.World.Spatial.Geometry.Polygon polygon) { int ret = EarthView_World_Spatial2D_Analyst_CImageCut_ImageCutByAOIByPolygon_ev_int32_CRasterDataSet_char_CPolygon(this.NativeObject, object.Equals(Dataset, null) ? IntPtr.Zero : Dataset.NativeObject, pszDstFile, object.Equals(polygon, null) ? IntPtr.Zero : polygon.NativeObject); return(ret); }