• How can I get a layer's DataSource properties.


    http://forums.arcgis.com/threads/47114-How-can-I-get-a-layer-s-DataSource-properties. 获取图层名 IPublishLayer  ILayer IPublishLayer
    1. How can I get a layer's DataSource properties. I have some loaded layers in a map control, and I would like to get some information from these layers.Do you know what classes/interfaces I need to use in order to get theinformation that is displayed in a layer properties Source tab. (Seeattached pic) Keep in mind, these are ALREADY loaded layers. I'm not attempting norable to load the layers myself and get the information at that point.(if that makes any difference) I'm looking for the data for these items
      • Data Type:
      • Feature Class:
      • SERVER:
      • INSTANCE:
      • Location:
      • AUTHENTICATION_MODE:
      • VERSION:
      I already have the information for
      • Feature Type
      • Geometry Type
      Attached Thumbnails  Reply With QuoteTopBottom
    2. 01-05-2012 04:04 PM#2renon Bing ZHENG
      Join Date
      Apr 2010
      Posts
      19
      Points
      0
      Answers Provided
      0

      0 Re: How can I get a layer's DataSource properties. Just for reference, may be wrong •Data Type: IFeatureLayer.DataSourceType •Feature Class: IFeatureLayer.featureClass •SERVER: IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("Server") •INSTANCE:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("Instance") •Location:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("database") •AUTHENTICATION_MODE:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("AUTHENTICATION_MODE") •VERSION:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("version") Regards, Bing Reply With QuoteTopBottom
    3. 01-05-2012 04:07 PM#3Pimplebutt ESRI Customer
      Join Date
      Jun 2010
      Posts
      38
      Points
      0
      Answers Provided
      0

      0 Re: How can I get a layer's DataSource properties. Originally Posted by renonJust for reference, may be wrong •Data Type: IFeatureLayer.DataSourceType •Feature Class: IFeatureLayer.featureClass •SERVER: IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("Server") •INSTANCE:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("Instance") •Location:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("database") •AUTHENTICATION_MODE:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("AUTHENTICATION_MODE") •VERSION:IFeatureLayer.featureClass->Idataset->IpropertySet->GetProperty("version") Regards, Bing Thanks a lot. I'll try those and report back. Reply With QuoteTopBottom
    4. 01-17-2012 07:08 AM#4abridle Andy Bridle
      Join Date
      Jan 2012
      Posts
      3
      Points
      0
      Answers Provided
      0

      0 Re: How can I get a layer's DataSource properties. have you got a sample of this working? I'm trying to do exactly thesame thing with some SDE layers in a map but hitting an error. pfeatureclass = pfeaturelayer.FeatureClass pdataset = pfeatureclass.FeatureDataset MsgBox(pdataset.PropertySet.GetProperty("Server")) pfeatureclass seems to be set okay but pdataset is always nothing which then causes the propertyset to fail Reply With QuoteTopBottom
    5. 01-17-2012 07:31 AM#5sshetty Swapna Shetty
      Join Date
      Jun 2011
      Posts
      111
      Points
      30
      Answers Provided
      4

      0 Re: How can I get a layer's DataSource properties. You can use pfeatureclass.FeatureDataset if the feature class is storedinside feature dataset. if not use below statement to convertifeatureclass to idataset and then get the connection properties. IDataset pdataset = pfeatureclass as IDataset; Reply With QuoteTopBottom
    6. 01-17-2012 10:39 AM#6ldonahue Leo Donahue
      Join Date
      Apr 2010
      Posts
      233
      Points
      1
      Answers Provided
      0

      0 Re: How can I get a layer's DataSource properties. Well, another option, if the data is published via server, would be to use: .NET IPublishLayer.DataDetails http://help.arcgis.com/en/sdk/10.0/a...0p29000000.htm Java FeatureLayer.getDataDetails() http://help.arcgis.com/en/sdk/10.0/j...tureLayer.html You get a nicely formatted String with those properties you're looking for. Data Type: ArcSDE Database Location: Server: Server Name User: username Instance: sde:sqlserver:whatever Version: dbo.DEFAULT Description: Instance default version. Feature Class: server.owner.name And, as you can see the Java version gets the output wrong. I reported as a potential bug...
  • 相关阅读:
    【题解】P3388 【模板】割点(割顶)
    【题解】T156527 直角三角形
    【题解】T156526 各数字之和
    【题解】P5318 【深基18.例3】查找文献
    数据结构:邻接表
    【题解】P3387 【模板】缩点
    全网最最详细!一文讲懂Tarjan算法求强连通分量&缩点
    vue组件间通信
    vue实现头像上传
    解读JavaScript中的Hoisting机制(js变量声明提升机制)
  • 原文地址:https://www.cnblogs.com/adodo1/p/4328046.html
Copyright © 2020-2023  润新知