<?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 Using arc.open function to import a feature class from SQL (ArcGIS for Server)? in R-ArcGIS Questions</title>
    <link>https://community.esri.com/t5/r-arcgis-questions/using-arc-open-function-to-import-a-feature-class/m-p/853116#M245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use the arc.open function to successfully import a local .shp file into R.&amp;nbsp; I can also successfully import regular old SQL tables into R using the&amp;nbsp;sqlQuery function in the RODBC package and an ODBC connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I cannot figure out how to import a feature class from SQL (Running ArcGIS for Server) into R directly?&amp;nbsp; I'd like to be able to import files directly so that I'm working with a live dataset, rather than pulling from a static dataset within a a .gdb file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Oct 2017 13:41:24 GMT</pubDate>
    <dc:creator>EQRGIS</dc:creator>
    <dc:date>2017-10-05T13:41:24Z</dc:date>
    <item>
      <title>Using arc.open function to import a feature class from SQL (ArcGIS for Server)?</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/using-arc-open-function-to-import-a-feature-class/m-p/853116#M245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use the arc.open function to successfully import a local .shp file into R.&amp;nbsp; I can also successfully import regular old SQL tables into R using the&amp;nbsp;sqlQuery function in the RODBC package and an ODBC connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I cannot figure out how to import a feature class from SQL (Running ArcGIS for Server) into R directly?&amp;nbsp; I'd like to be able to import files directly so that I'm working with a live dataset, rather than pulling from a static dataset within a a .gdb file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 13:41:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/using-arc-open-function-to-import-a-feature-class/m-p/853116#M245</guid>
      <dc:creator>EQRGIS</dc:creator>
      <dc:date>2017-10-05T13:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using arc.open function to import a feature class from SQL (ArcGIS for Server)?</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/using-arc-open-function-to-import-a-feature-class/m-p/853117#M246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the question, this is something that I'll add a note for me to document in the package documentation. To reference a database, there are a couple of approaches:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If you only need access to one layer: you'll need to create a layer file which references the data. You should be able to do this from within ArcMap or Pro by right clicking on the layer &amp;gt; Save as Layer File, if it's in your current map, or right click the layer in the Catalog pane and select "Create Layer". Once you've created that layer file, you can reference it directly with arc.open(), and it'll work like any other data source.&lt;/LI&gt;&lt;LI&gt;If you want to access arbitrary layers in your database: instead of creating an intermediary layer file, you can directly reference things from the .sde file. This file is created when you add a database connection, by default it'll end up in your user profile. You can find it from ArcMap for example by right clicking on the database, selecting Properties, the 'Name' field contains the full path to the sde file. You can copy this elsewhere, or reference it directly, using the syntax:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;r &amp;lt;- arc.open('c:/path/to/my.sde/dbname.layername')&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bridge doesn't currently have the underpinnings to figure out the necessary information directly, but either of the above approaches will give you direct access. Let us know if you need anything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shaun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 03:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/using-arc-open-function-to-import-a-feature-class/m-p/853117#M246</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2017-10-12T03:03:31Z</dc:date>
    </item>
  </channel>
</rss>

