您的位置:首页 > 运维架构

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 Quote
TopBottom

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 Quote
TopBottom

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 Quote
TopBottom

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 Quote
TopBottom

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 Quote
TopBottom

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...
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: