wavvylia
路人甲
路人甲
  • 注册日期2003-07-28
  • 发帖数384
  • QQ
  • 铜币555枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2259回复:5

能创建栅格目录,但是的导不进去数据!

楼主#
更多 发布于:2005-06-28 11:31
能创建栅格目录,但是的导不进去数据!一导数据就说RasterToGeodatabase函数失败。估计是License的问题,哪个兄弟有可用的可以给提供一个,在下将不胜感激!
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-06-28 17:24
你是在什么环境下编程实现的?
举报 回复(0) 喜欢(0)     评分
wavvylia
路人甲
路人甲
  • 注册日期2003-07-28
  • 发帖数384
  • QQ
  • 铜币555枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-07-05 08:50
<P>我使用的VB+AO,目前我倒是找到了新的License,能手动导入栅格目录了,但是用程序导入时就不行,附上我的导入程序:</P>
<P>Public Sub LoadToSDERasterCatalog(ByVal sDir As String, ByVal sFile As String, _<BR>      ByVal sRaster As String, ByVal sServer As String, ByVal sInstance As String, _<BR>      ByVal sDB As String, ByVal sUser As String, ByVal sPasswd As String, _<BR>      ByVal sSDECatalog As String, ByVal sTableSpace As String, ByVal blnCatalog As Boolean)<BR>  <BR>   ' sDir: the directory where the input rasters reside<BR>   ' sServer,sInstance,sDB,sUser,sPasswd: ArcSDE connection info<BR>   ' sSDECatalog: the output ArcSDE embedded raster catalog name<BR>   <BR>   Dim pSDEConn As IRasterSdeConnection2<BR>   Dim pSDEStorage As IRasterSdeStorage2<BR>   Dim pSDEOp As IRasterSdeServerOperation2<BR>   Dim pSDECatalog As IRasterSdeCatalog<BR>   Dim pRasterWSFact As IWorkspaceFactory<BR>   Dim pRasterWS As IWorkspace<BR>   Dim pEnumDataset As IEnumDataset<BR>   Dim pRasterDs As IDataset<BR>   Dim pGeoDs As IGeoDataset<BR>   Dim i As Integer<BR>   '   Dim sRaster As String<BR>   '   Dim HasExisted As Boolean<BR>   '   Dim blnExisted As Boolean '标志是否进行过导入<BR>   <BR>   ' Get all the datasets in the input directory<BR>   Set pRasterWSFact = New RasterWorkspaceFactory<BR>   Set pRasterWS = pRasterWSFact.OpenFromFile(sDir, 0)<BR>   '   Set pEnumDataset = pRasterWS.Datasets(esriDTRasterDataset)<BR>   <BR>   ' Initialize RasterSDELoader<BR>   Set pSDEConn = New RasterSdeLoader<BR>   ' Make connection<BR>   pSDEConn.ServerName = sServer<BR>   pSDEConn.Instance = sInstance<BR>   pSDEConn.Database = sDB<BR>   pSDEConn.UserName = sUser<BR>   pSDEConn.password = sPasswd<BR>   <BR>   ' Set raster catalog name<BR>   Set pSDECatalog = pSDEConn<BR>   pSDECatalog.CatalogName = sSDECatalog<BR>   '   HasExisted = RecordIsExisted(sSDECatalog)<BR>   ' Loop through all the datasets, create the catalog for the first time, and insert afterwards.<BR>   '   Set pRasterDs = pEnumDataset.Next<BR>   '   Dim part() As String<BR>   '   Do While Not pRasterDs Is Nothing<BR>      <BR>   '      sRaster = pRasterDs.Name<BR>   pSDEConn.InputRasterName = sDir ; "\" ; sFile<BR>   sRaster = UCase(sRaster)</P>
<P>   If HasImported(sSDECatalog, sRaster) Then</P>
<P>      MsgBox "该数据已经存在!", vbExclamation, "重复导入"<BR>      GoTo PROC_EXIT:<BR>      <BR>   End If</P>
<P>   '      sRaster = Replace(sRaster, ".", "_") ' replace "." with "_"<BR>   pSDECatalog.RasterName = sRaster<BR>      <BR>   ' Set storage parameters<BR>      <BR>   Set pSDEStorage = pSDEConn<BR>   '     pSDEStorage.keyword = "MAPDB"<BR>   ' Set spatialreference</P>
<P>   If Not blnCatalog Then</P>
<P>      Set pGeoDs = pRasterDs<BR>      Set pSDEStorage.SpatialReference = GetReference 'pGeoDs.SpatialReference<BR>      '         HasExisted = True<BR>   End If<BR>      <BR>   ' Set compression (LZ77)<BR>   pSDEStorage.CompressionType = esriRasterSdeCompressionTypeRunLength<BR>   pSDEStorage.Keyword = sTableSpace<BR>   ' Set tilesize<BR>   pSDEStorage.TileHeight = 128<BR>   pSDEStorage.TileWidth = 128<BR>   ' Pyramids option (bilinear)<BR>   pSDEStorage.PyramidOption = esriRasterSdePyramidBuildWithFirstLevel<BR>   pSDEStorage.PyramidResampleType = RSP_BilinearInterpolation<BR>      <BR>   ' Start loading<BR>   Set pSDEOp = pSDEConn<BR>   '      If i = 0 Then<BR>   '      pSDEOp.Create<BR>   '      Else<BR>   pSDEOp.Insert<BR>   '      End If<BR>      <BR>   ' Calculate stats (optional)<BR>   pSDEOp.ComputeStatistics<BR>      <BR>   ' Next<BR>   '      Set pRasterDs = pEnumDataset.Next<BR>   '      i = 1               '不再检查是否有空间参考坐标<BR>   '   Loop<BR>PROC_EXIT:<BR>   ' Cleanup<BR>   Set pSDEConn = Nothing<BR>   Set pSDEStorage = Nothing<BR>   Set pSDEOp = Nothing<BR>   Set pRasterWSFact = Nothing<BR>   Set pRasterWS = Nothing<BR>   Set pGeoDs = Nothing<BR>   Set pRasterDs = Nothing<BR>   Set pEnumDataset = Nothing<BR>   Set pSDECatalog = Nothing<BR>  <BR>End Sub<BR></P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2005-07-05 13:19
出现的是什么错误呢?
举报 回复(0) 喜欢(0)     评分
cl991036
管理员
管理员
  • 注册日期2003-07-25
  • 发帖数5913
  • QQ14265545
  • 铜币29654枚
  • 威望213点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • GIS帝国铁杆
4楼#
发布于:2005-07-05 15:40

<P>Public Sub AddrasterLayergisempire(gisempiredir As String, gisempiremap As IMap)<BR>            Dim pRasterLayer As IRasterLayer<BR>            Set pRasterLayer = New RasterLayer<BR>            pRasterLayer.CreateFromFilePath mkdir<BR>            mkmap.AddLayer pRasterLayer<BR>            Set pRasterLayer = Nothing<BR>End Sub</P>
没钱又丑,农村户口。头可断,发型一定不能乱。 邮箱:gisempire@qq.com
举报 回复(0) 喜欢(0)     评分
wavvylia
路人甲
路人甲
  • 注册日期2003-07-28
  • 发帖数384
  • QQ
  • 铜币555枚
  • 威望0点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2005-07-08 08:59
呵呵,我不是加载显示,而是要导入到SDE的栅格目录中去。现在导是能够导入,但导入的数据显示的都是黑块。用Catalog导入则不会存在这样的问题。
举报 回复(0) 喜欢(0)     评分
游客

返回顶部