How can I get a layer's DataSource properties.
2012-07-16 18:46
267 查看
http://forums.arcgis.com/threads/47114-How-can-I-get-a-layer-s-DataSource-properties.
获取图层名 IPublishLayer ILayer
IPublishLayer
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
01-05-2012 04:04 PM#2renon
View Profile
View Forum Posts
Private Message
Bing ZHENG
Join DateApr 2010Posts19Points0Answers Provided0
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
01-05-2012 04:07 PM#3Pimplebutt
View Profile
View Forum Posts
Private Message
ESRI Customer
Join DateJun 2010Posts38Points0Answers Provided0
0
Re: How can I get a layer's DataSource properties.
Originally Posted by renon
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 Thanks a lot. I'll try those and report back.
Reply With QuoteTopBottom
01-17-2012 07:08 AM#4abridle
View Profile
View Forum Posts
Andy Bridle
Join DateJan 2012Posts3Points0Answers Provided0
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
01-17-2012 07:31 AM#5sshetty
View Profile
View Forum Posts
Private Message
Swapna Shetty
Join DateJun 2011Posts111Points30Answers Provided4
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
01-17-2012 10:39 AM#6ldonahue
View Profile
View Forum Posts
Private Message
Leo Donahue
Join DateApr 2010Posts233Points1Answers Provided0
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...
获取图层名 IPublishLayer ILayer
IPublishLayer
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
01-05-2012 04:04 PM#2renon
View Profile
View Forum Posts
Private Message
Bing ZHENG
Join DateApr 2010Posts19Points0Answers Provided0
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
01-05-2012 04:07 PM#3Pimplebutt
View Profile
View Forum Posts
Private Message
ESRI Customer
Join DateJun 2010Posts38Points0Answers Provided0
0
Re: How can I get a layer's DataSource properties.
Originally Posted by renon
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 Thanks a lot. I'll try those and report back.
Reply With QuoteTopBottom
01-17-2012 07:08 AM#4abridle
View Profile
View Forum Posts
Andy Bridle
Join DateJan 2012Posts3Points0Answers Provided0
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
01-17-2012 07:31 AM#5sshetty
View Profile
View Forum Posts
Private Message
Swapna Shetty
Join DateJun 2011Posts111Points30Answers Provided4
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
01-17-2012 10:39 AM#6ldonahue
View Profile
View Forum Posts
Private Message
Leo Donahue
Join DateApr 2010Posts233Points1Answers Provided0
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...
相关文章推荐
- How can I get a layer's DataSource properties.
- Learning Perl: 1.3. How Can I Get Perl?
- How to get the published properties of an persistent object
- How Can I Get 300 Mbps (or Higher) Speed on My 802.11n Network?
- Given a code_combination_id how can i get the code description? 获取科目组合描述
- How can I get “Copy to Output Directory” to work with Unit Tests?
- 【转】How do I use MDGModifier so I can get reliable Undo/Redo?
- How can i get access to a Highcharts chart through a DOM-Container
- How can I get the baseurl of site?
- How can I get file extensions with JavaScript?
- How can i specify the resource to get from R.res.drawable dynamically?
- MDX-How can I get attribute key with MDX
- how can i get [5, 7, 13, 2] to go to [5*0, 7*1, 13*2, 2*3] then get the sum of this array.
- How Can I Get the Unique ID for the Last Inserted Row
- how to get source sde database type of layer
- How can i get hold of all of the visible items in my QListView?
- how to get geometry type of layer using IMapServer3 and IMapLayerInfo? (C#)
- How to Compare two layer’s object: Get AOT objects both modified in USR & SL1 layer
- How can i get FWHM?
- How can I get a String from HID device in Python with evdev?