I would like to get information from each layer .
Each feature class read different data from different tables at my database .
How could I get information to know which tables used for each layer in ArcMap ?
Double click on the layer in the table-of-contents (or right click -> properties) to open the layer properties window.
Then go to the 'Source' tab at the top. There you can see the data source the layer is reading from
https://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/repairing-broken-data-links.htm
If you need to see the sources for all layers in the MXD or across multiple MXDs you can use a simple python script https://community.esri.com/t5/python-questions/script-to-print-all-data-layer-names-and-sources/td-p/203713
Hello SM90, I have not tried the following ArcPy Code. I just did a quick search online and found the following:
Actual feature class names (as in the data source names).https://gis.stackexchange.com/questions/423776/listing-all-feature-classes-from-an-arcgis-project-file-from-the-data-source
import arcpyimport osimport globimport pandas as pd
# ArcPro = arpx# ArcMap = mxdaprx_dir = r'H:\007_Services-GV\02_GV_Updates\2201xx_Engineering\*.aprx'
aprx_dict = {}
for aprx_file in glob.glob(aprx_dir):aprx = arcpy.mp.ArcGISProject(aprx_file)for m in aprx.listMaps():print (aprx_file)for layer in m.listLayers():print(layer.dataSource)
I hope this helps,
-Jeff
In the table of contents, you can also list by data source:
R_
Thanks for ur reply .
I have looked to data source and it show me the name of feature dataset and name feature class .
but feature class data collected from different tables .
i would like to get the name of tables that used to provide the data to this feature class .
How could I get the name of them for each feature class ?
It shows me only the feature dataset but I need to know the name of tables the provide data for each feature class or feature dataset ? How could I get table names ?
Thanks for the code.I thik the idea here to get the name of layers but I am looking to find the table names that provide data for each layer ?how could I achieve it ?
Are you talking about joined/related tables?
Basically, in my example above, "Centerlines" is a table in the geodatabase. It also has shape field holding the geometry so Arc can display it as a feature class when added.
So, the table "name" would be "Centerlines". If you right-click on it and open attribute table you can view it.
Not if the layer name has been changed in the TOC.
Or if you have an Alias set on it. That is why I used Centerlines as example, not Urban Growth Area (that is alias, but, it IS the table alias).
Just trying to clarify what a table that provides data for a layer is.....
As your example , you have centerlines as table .
but in my case , the name here is not the same name of table at my database .
May be 5 tables are providing data for layer and other layer get the data from others tables .
in my case ,if I select on a cable as example then check the log file .
It shows me in the log file, that many functions used to show the data on cable .
select * from table a
select * from table b
……….
i mean , each layer getting the data from different tables at my database ,how could I see that tables name that joined to bring the data on layer ?
So, sounds like maybe you have a combination of layer with joins and/or views going on.
List by source will show you all layers AND tables that are currently loaded into your map document (image show View, Table, and Feature Class):
You can right click the layer in ArcMap, properties, source tab to show you the layer/table name/location:
If you have joins or relates, you can look in the Joins and Relates tab to see what tables are joined or related:
For views, you can find the data location in the source tab, then get properties in ArcCatalog, the definition will show the SQL that creates the view:
And if you have relationship classes set up in the database, you can get that info from the Relationships tab in the properties in ArcCatalog.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.