<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844835#M4011</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I am.&amp;nbsp; For example, for a feature class in a geodatabase, I would like it to return "&lt;SPAN style="background-color: #ffffff;"&gt;C:/Path/To/Geodatabase.gdb/FeatureClass"&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 May 2019 18:54:35 GMT</pubDate>
    <dc:creator>JohnPhillipsGeo</dc:creator>
    <dc:date>2019-05-09T18:54:35Z</dc:date>
    <item>
      <title>How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844833#M4009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems like it should be pretty straight-forward but I cannot figure out how to get a layer object's filepath as a string.&amp;nbsp; Any help is much appreciated.&amp;nbsp; For example:&lt;BR /&gt;&lt;BR /&gt;I have a layer object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().First()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to get lyr.Path() or something like that.&amp;nbsp; So that it will return:&lt;BR /&gt;&lt;BR /&gt;C:/Path/To/Layer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 18:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844833#M4009</guid>
      <dc:creator>JohnPhillipsGeo</dc:creator>
      <dc:date>2019-05-09T18:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844834#M4010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to get the file path for the data that the layer is pointed to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 18:33:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844834#M4010</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-05-09T18:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844835#M4011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I am.&amp;nbsp; For example, for a feature class in a geodatabase, I would like it to return "&lt;SPAN style="background-color: #ffffff;"&gt;C:/Path/To/Geodatabase.gdb/FeatureClass"&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 18:54:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844835#M4011</guid>
      <dc:creator>JohnPhillipsGeo</dc:creator>
      <dc:date>2019-05-09T18:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844836#M4012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Geodatabase feature classes rarely correspond to a single file on disk. &amp;nbsp;If you open up a File Geodatabase using File Explorer, you'll see there's a large number of different files. &amp;nbsp;So there isn't really a path to a feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is (sometimes) a path to the geodatabase itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the feature class belongs to a file geodatabase (Geodatabase.GetGeodatabaseType() returns GeodatabaseType.LocalDatabase) , the Geodatabase.GetConnector() routine will return a FileGeodatabaseConnectionPath object. &amp;nbsp;This object has a Path property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other kinds of geodatabases, of course, including SDE geodatabases and feature service workspaces. &amp;nbsp;SDE geodatabases may or may not be opened from a .SDE file, but feature service workspaces don't have a file at all, just a URL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps explain why it isn't straightforward!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:22:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844836#M4012</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2019-05-09T19:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844837#M4013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var gdbPath = lyr.GetTable().GetDatastore().GetPath().ToString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is pretty close to what I'm looking for, I am trying to feed it into&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Geoprocessing.MakeValueArray&lt;BR /&gt;&lt;BR /&gt;To use as a parameter for a tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Geoprocessing.ExecuteToolAsync()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Do you know if passing the string path of a layer into a tool is the best way to go about it?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;JP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844837#M4013</guid>
      <dc:creator>JohnPhillipsGeo</dc:creator>
      <dc:date>2019-05-09T19:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844838#M4014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, we actually added Datastore.GetPath() for use with&amp;nbsp;geoprocessing. &amp;nbsp;Use this and append the table name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Uri path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geodatabase&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetPath&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; fullPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;Path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Combine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;LocalPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TABLE_NAME&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/844838#M4014</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2021-12-12T10:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get the path for a layer as a string (ArcGIS Pro SDK)?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/1121159#M7392</link>
      <description>&lt;P&gt;You can simply use it:&lt;/P&gt;&lt;P&gt;var layer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault();&lt;BR /&gt;var layerPath = await QueuedTask.Run(() =&amp;gt; layer.GetPath());&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 08:13:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-you-get-the-path-for-a-layer-as-a-string/m-p/1121159#M7392</guid>
      <dc:creator>osmansheikh</dc:creator>
      <dc:date>2021-11-30T08:13:49Z</dc:date>
    </item>
  </channel>
</rss>

