hope_xt
路人甲
路人甲
  • 注册日期2004-04-10
  • 发帖数26
  • QQ
  • 铜币218枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1246回复:1

如何识别一个文件夹是不是Coverage类型

楼主#
更多 发布于:2005-06-24 12:04
<P>RT,该问题已经困惑我多天了,请个位高手赐教,这里谢谢了先。</P><BR>
<P>如何识别一个文件夹是不是Coverage类型。</P><BR>
喜欢0 评分0
hope_xt
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-06-24 16:52
<STRONG>Description:</STRONG> <BR><BR><TEXT>The following example creates a new Access database on your D drive, then converts a coverage feature dataset into feature dataset in the new Access database. The "canada" coverage from the data folder of the developer's samples is converted. <BR><BR>NOTE: to successfully run this script, you may need to modify the drive letter for the path to the input coverage data if it differs from where you installed the developer's samples. </TEXT>
<TABLE bgColor=#edf6fd>

<TR>
<TD><B>Products:</B>
<DIV 15px; POSITION: relative">
<br>Engine: VB6</DIV>
<p>
<p><B>Platforms: </B>Windows
<p><B>Minimum ArcGIS Release: </B>9.0</TD></TR></TABLE><BR><B>How to use:</B>
<DIV>
<OL>
<LI>Modify the code to fit your data.
<LI>Paste the code into your VBA Application. </LI></OL></DIV>
<DIV><PRE>          <DEVELOPENV>Sub CovertoAccess()
 ' create a new Access database to copy the feature dataset into. This new access
 ' database  will be called "canada.mdb" and will be located in "D:\data\canada". You can
 ' modify the script to change both the database name and its location.
  Dim pPropset As IPropertySet
  Dim pOutAcFact As IWorkspaceFactory
  Dim pOutAcWorkspaceName as IWorkspaceName
  Dim pOutAcFeatDSName As IFeatureDatasetName
  Dim pOutAcDSName As IDatasetName
  Dim pInCovWorkspaceName As IWorkspaceName
  Dim pFeatureDatasetName As IFeatureDatasetName
  Dim pCovDatasetName As IDatasetName
  Dim pCovtoFD As IFeatureDataConverter

  Set pPropset = New PropertySet
  pPropset.SetProperty "Database", "D:\data\canada"

  Set pOutAcFact = New AccessWorkspaceFactory
  Set pOutAcWorkspaceName = pOutAcFact.Create("D:\data\canada", "canada", pPropset, 0)
      
  ' create a new feature datset name object for the output Access feature dataset, call
  ' it "Country"
  Set pOutAcFeatDSName = New FeatureDatasetName
  Set pOutAcDSName = pOutAcFeatDSName
  Set pOutAcDSName.WorkspaceName = pOutAcWorkspaceName
  pOutAcDSName.name = "Country"
  
  ' now get the name object for the input coverage feature dataset name.
  Set pInCovWorkspaceName = New WorkspaceName
  pInCovWorkspaceName.pathname = "D:\data\canada"
  pInCovWorkspaceName.WorkspaceFactoryProgID = "esriDataSourcesFile.ArcInfoWorkspaceFactory.1"

  Set pFeatureDatasetName = New FeatureDatasetName
  Set pCovDatasetName = pFeatureDatasetName
  pCovDatasetName.name = "canada"
  Set pCovDatasetName.WorkspaceName = pInCovWorkspaceName
  
  ' now use the conversion function convert the coverage to an Access feature dataset
  Set pCovtoFD = New FeatureDataConverter
  pCovtoFD.ConvertFeatureDataset pCovDatasetName, pOutAcDSName, Nothing, "", 1000, 0
  
  MsgBox "Coverage conversion complete!"
End Sub</DEVELOPENV>
</PRE></DIV>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
游客

返回顶部