Hello everyone,
Using ArcCatalog, how can I search for a FC that is located in a FD, but I do not know the FD where it is located.
Thanks
Are you looking a GUI option or some Python code to run in the interactive Python window?
+1 for Joshua Bixby's comment
Your title indicates Feature Service (FS) but the body of your post indicates Feature dataset (FD).
Walk? Walk—Data Access module | ArcGIS Desktop
Find the featureclass, hence the featuredataset. Of course limiting the start point would be the key
As for FS? FD? which
If the Database Connection is indexed, you can directly search in the Desktop interface.
Using search in ArcGIS—Help | ArcGIS Desktop
Good morning,
Sorry I mean Feature Dataset. We have an SDE database with more than 1000 Feature classes and tables. most of the FC are inside Feature Datasets.. So when we get a call for an user asking for the location of a FC it will be very helpfull to have a tool to search for a FC.
Hi Jose
You can use the script below in ArcCatalog's python window (Change fcName and pathToSDEConnectionFile)
<SPAN class="comment token"># Feature Class Name (E.g. TestDB.DBO.TestPolygonFeatureClass)</SPAN> fcName <SPAN class="operator token">=</SPAN> <SPAN class="string token">'TestGDB.DBO.TestPolygonFeatureClass'</SPAN> <SPAN class="comment token"># Path to the sde connection file </SPAN> pathToSDEConnectionFile <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'C:\tmp\sdeConnections\localhost.sde'</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> pathToSDEConnectionFile datasets <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListDatasets<SPAN class="punctuation token">(</SPAN>feature_type<SPAN class="operator token">=</SPAN><SPAN class="string token">'feature'</SPAN><SPAN class="punctuation token">)</SPAN> datasets <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">''</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">+</SPAN> datasets <SPAN class="keyword token">if</SPAN> datasets <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> None <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">for</SPAN> ds <SPAN class="keyword token">in</SPAN> datasets<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">for</SPAN> fc <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN>feature_dataset<SPAN class="operator token">=</SPAN>ds<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN> fc<SPAN class="punctuation token">.</SPAN>upper<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">==</SPAN> fcName<SPAN class="punctuation token">.</SPAN>upper<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Feature Class '</SPAN> <SPAN class="operator token">+</SPAN> fc <SPAN class="operator token">+</SPAN> <SPAN class="string token">' found in '</SPAN> <SPAN class="operator token">+</SPAN> ds <SPAN class="operator token">+</SPAN> <SPAN class="string token">' Dataset'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Regards,
Leo
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.