<?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: arc.write: unknown structure error in R-ArcGIS Questions</title>
    <link>https://community.esri.com/t5/r-arcgis-questions/arc-write-unknown-structure-error/m-p/825195#M196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Francesco,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I think what's happening is that after you've performed the join, the data frame structure is changed to accommodate the join. So the rows don't line up with what arcgisbinding expects, and there's a mismatch between data structures.&amp;nbsp; I've discussed this with another developer, and probably the most robust way for us to support this is to implement direct support for the dplyr style joins. For now, please see this example which uses spdplyr to do the join with sp class objects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://community.esri.com/thread/196578-impossible-to-use-dplyr-join-functions-on-data-frames"&gt;https://community.esri.com/thread/196578-impossible-to-use-dplyr-join-functions-on-data-frames&lt;/A&gt;&amp;nbsp;&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>Wed, 02 Aug 2017 19:09:24 GMT</pubDate>
    <dc:creator>ShaunWalbridge</dc:creator>
    <dc:date>2017-08-02T19:09:24Z</dc:date>
    <item>
      <title>arc.write: unknown structure error</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/arc-write-unknown-structure-error/m-p/825194#M195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting an "unknown structure error" when using arc.write from the latest arcgisbindings pkg. I tried to follow the example in the package vignette for arc.write. I am guessing it is not using the correct &lt;EM&gt;coords&lt;/EM&gt; or &lt;EM&gt;shape_info&lt;/EM&gt; like it should...Any idea how should I fix this? Here are my steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Reading a &lt;EM&gt;polygon&lt;/EM&gt; shp,&lt;/P&gt;&lt;P&gt;2) Extracting its data.frame,&lt;/P&gt;&lt;P&gt;3) Joining it with an existing R data.frame (by a common attribute name)&lt;/P&gt;&lt;P&gt;4) Saving it back to a new shp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;fc&amp;nbsp;&amp;lt;- arc.open(&amp;lt;&lt;EM&gt;input_shapefile&amp;gt;&lt;/EM&gt;)&lt;BR /&gt;fc.df &amp;lt;- arc.select(fc)&lt;/P&gt;&lt;P&gt;fc.df_join &amp;lt;- left_join(fc.df, &lt;EM&gt;&amp;lt;existing_dataframe&amp;gt;&lt;/EM&gt;, by = 'ISO_3_CODE')&lt;/P&gt;&lt;P&gt;dim(&lt;SPAN&gt;fc.df_join&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;[1] 211 11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arc.write(path="./output.shp", data=&lt;SPAN&gt;fc.df_join&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;coords = arc.shapeinfo(fc)$WKT,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;shape_info = arc.shapeinfo(fc))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error in .call_proxy("arc_export2dataset", path, data, coords, shape_info) : &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; unknown structure&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;In addition: Warning message:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;In .call_proxy("arc_export2dataset", path, data, coords, shape_info) :&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; length of shape != data.frame length&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/arc-write-unknown-structure-error/m-p/825194#M195</guid>
      <dc:creator>FrancescoTonini2</dc:creator>
      <dc:date>2017-07-27T13:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: arc.write: unknown structure error</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/arc-write-unknown-structure-error/m-p/825195#M196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Francesco,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I think what's happening is that after you've performed the join, the data frame structure is changed to accommodate the join. So the rows don't line up with what arcgisbinding expects, and there's a mismatch between data structures.&amp;nbsp; I've discussed this with another developer, and probably the most robust way for us to support this is to implement direct support for the dplyr style joins. For now, please see this example which uses spdplyr to do the join with sp class objects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://community.esri.com/thread/196578-impossible-to-use-dplyr-join-functions-on-data-frames"&gt;https://community.esri.com/thread/196578-impossible-to-use-dplyr-join-functions-on-data-frames&lt;/A&gt;&amp;nbsp;&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>Wed, 02 Aug 2017 19:09:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/arc-write-unknown-structure-error/m-p/825195#M196</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2017-08-02T19:09:24Z</dc:date>
    </item>
  </channel>
</rss>

