阅读:2083回复:1
Load image to Raster Column in a Geodatabase Table
<P>arcgis9.0 以后,可以在单个Geodatabase Table 设 Raster Field, 可以将图像文件存放到数据库中,在HELP中有Load Raster to Raster Column in a Geodatabase Table<BR>一个例子</P>
<P>Load Raster to Raster Column in a Geodatabase Table </P> <P><BR>Description: </P> <P>This sample shows how to load a raster to a raster column of a table in the geodatabase. Products: Engine</P> <P><BR>Platforms: Windows</P> <P>Minimum ArcGIS Release: 9.0 </P> <P>How to use: <BR>Call this function from VB6 or VBA. <BR> <BR>Sub LoadToRasterColumn(pTable As ITable, oid As Long, _<BR> pRasterDs As IRasterDataset)</P> <P> 'This procedure load pRasterDs to the raster field of the row with objectid<BR> 'of oid in a table pTable<BR> </P> <P> Dim pRow As IRow<BR> Dim iRaster As Integer 'id for raster column<BR> Dim iCnt As Integer<BR> Dim pValue As IRasterValue<BR> <BR> Set pValue = New RasterValue<BR> <BR> Set pRow = pTable.GetRow(oid)<BR> <BR> iRaster = -1 <BR> ' get the raster field id<BR> <BR> For iCnt = 0 To pTable.Fields.FieldCount - 1<BR> If pTable.Fields.Field(iCnt).Type = esriFieldTypeRaster Then<BR> iRaster = iCnt<BR> Exit For<BR> End If<BR> Next iCnt<BR> <BR> If iRaster = -1 Then<BR> MsgBox "no raster column exists in the table"<BR> Exit Sub<BR> End If<BR> <BR> ' set the raster dataset to the raster field <BR> Set pValue.RasterDataset = pRasterDs<BR> pRow.Value(iRaster) = pValue<BR> pRow.Store</P> <P> ' clean up <BR> Set pValue = Nothing<BR> Set pRow = Nothing</P> <P>End Sub</P> <P> 但是如果是具体的图像文件, 如何放到数据库中, 是否用</P> <P>在 Set pValue.RasterDataset = LOAD(D:\image\s.jpg),这种形式, </P> <P>请指点. 谢谢!<BR></P> |
|
1楼#
发布于:2007-01-10 20:51
可以用raster catalog,也可以用raster dataset来保存影像数据
|
|
|