阅读:1081回复:0
用程序将遥感数据集Raster或者DEM加到RasterCatalog问题
<P>我在用程序将遥感数据集Raster或者DEM加到RasterCatalog时,出现the raster buffer size is too small错误,请问高手如何解决?蓝颜色位置处代码出错</P>
<P>Public Sub DirToGDB(pWs As IWorkspace, pCatalog As IFeatureClass)<BR> Dim pSDERasterWs As IRasterWorkspaceEx<BR> Dim pEunmDatasets As IEnumDataset<BR> Dim pCatalogFeature As IRasterCatalogItem<BR> Dim pRasterDs As IRasterDataset<BR> Dim pCursor As IFeatureCursor<BR> Dim pRow As IFeatureBuffer<BR> <BR> ' get the list of datasets in the input workspace<BR> Set pEunmDatasets = pWs.Datasets(esriDTRasterDataset)<BR> pEunmDatasets.Reset<BR> <BR> ' load raster datasets from the input workspace<BR> Set pRasterDs = pEunmDatasets.Next<BR> Set pCursor = pCatalog.Insert(False)<BR> <BR> Dim pCat As IRasterCatalog<BR> Set pCat = pCatalog<BR> <BR> ' loop through all the datasets and load<BR> Do While Not pRasterDs Is Nothing<BR> Set pRow = pCatalog.CreateFeatureBuffer<BR> pRow.Value(pCat.RasterFieldIndex) = createRasterValue(pRasterDs)<BR> <FONT color=#113dee><STRONG><EM><U>pCursor.InsertFeature pRow (出错位置</U></EM></STRONG><FONT color=#0909f7>the raster buffer size is too small</FONT><STRONG><EM><U>)<BR></U></EM></STRONG></FONT> Set pRasterDs = pEunmDatasets.Next<BR> Loop<BR> <BR> ' cleanup<BR> Set pCatalog = Nothing<BR> Set pSDERasterWs = Nothing<BR> Set pEunmDatasets = Nothing<BR> Set pCatalogFeature = Nothing<BR> Set pRasterDs = Nothing</P> <P>End Sub</P> |
|