<?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: join/merge csv-file &amp; shapefile in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/join-merge-csv-file-shapefile/m-p/103437#M1024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't think of&amp;nbsp;a direct way&amp;nbsp;to do this yet (essentially you want a join between the Shapefile and a CSV), but it would help to understand the nature of your data. In particular, how is the CSV contents related to the shapefile records, and does the contents of the CSV change frequently or is it pretty static? Also, is the shapefile very large (i.e. do you want to operate directly against the shapefile, or could you work with an in-memory copy of it?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the data, one approach you could take would be to create an &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html"&gt;&lt;STRONG&gt;AGSFeatureCollectionTable&lt;/STRONG&gt;&lt;/A&gt; from the result of a query against the shapefile using &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html#a6fd994fc6260f63042463fc927ba9d61"&gt;featureCollectionTableWithFeatureSet()&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;(an AGSFeatureQueryResult &lt;EM&gt;is&lt;/EM&gt; an AGSFeatureSet). Create an &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_layer.html"&gt;&lt;STRONG&gt;AGSFeatureCollectionLayer&lt;/STRONG&gt;&lt;/A&gt; using that. In the layers collection, you'll see a single AGSFeatureLayer that you can set your renderer on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;AGSFeatureCollectionTable you create would essentially be an in-memory version of the shapefile data in which you could then edit the "KTNR" values based off the CSV contents without modifying the shapefile itself. Or if you prefer to merge/import some other field from the CSV to key your renderer off, you could populate the AGSFeatureCollectionTable slightly more manually using &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html#aa9d8fcf24b0c164e8ddfbcb8cae47cca"&gt;featureCollectionTableWithGeoElements:fields()&lt;/A&gt;&lt;/STRONG&gt;&amp;nbsp;copying the fields from the Shapefile (or a subset if you don't need them all), and add an additional field that the renderer will be keyed on, populating that from the CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you give us some more information on the nature of the CSV and how it relates to the Shapefile?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Apr 2019 20:49:27 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2019-04-16T20:49:27Z</dc:date>
    <item>
      <title>join/merge csv-file &amp; shapefile</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/join-merge-csv-file-shapefile/m-p/103436#M1023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I managed to load a shapefile and color the the layer based on the value of the field "KTNR" with following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Instantiate a map using a basemap.&lt;/SPAN&gt;
map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Create a shapefile feature table from a named bundle resource.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; shapefileTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSShapefileFeatureTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"g1g14vz"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Create a feature layer for the shapefile feature table.&lt;/SPAN&gt;
featureLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSFeatureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureTable&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; shapefileTable&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; lineSymbol &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSSimpleLineSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;style&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;solid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; color&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;UIColor&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;white&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; alpha&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; width&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; symbol1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSSimpleFillSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;style&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;solid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; color&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;yellow&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outline&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; lineSymbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; symbol2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSSimpleFillSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;style&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;solid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; color&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;red&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outline&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; lineSymbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; symbol3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSSimpleFillSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;style&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;solid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; color&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;blue&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outline&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; lineSymbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; classBreak1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSClassBreak&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0 to 5"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; label&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0 to 5"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; minValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; maxValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; symbol&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; symbol1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; classBreak2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSClassBreak&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"5 to 10"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; label&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"5 to 10"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; minValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; maxValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; symbol&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; symbol2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; classBreak3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSClassBreak&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10 to 30"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; label&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10 to 30"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; minValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; maxValue&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; symbol&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; symbol3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; classBreakRenderer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;AGSClassBreaksRenderer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fieldName&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"KTNR"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; classBreaks&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt; classBreak1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; classBreak2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; classBreak3&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
featureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;renderer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; classBreakRenderer

&lt;SPAN class="comment token"&gt;// Add the layer to the map.&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;operationalLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureLayer&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm now trying to do is using the data from a&amp;nbsp;csv-file as the field for the&amp;nbsp;&lt;SPAN&gt;AGSClassBreaksRenderer instead of "KTNR". After hours of googling and checking the sample iOS ArcGIS projekt I still don't know how to accomplish that. Can I somehow join the data from the csv to the data from the shapefile? Or can I add the csv-data as another layer and then reference that layer in&amp;nbsp;AGSClassBreaksRenderer? Or can I merge the shapefile with the csv-file somehow and create a new layer out of them? Or is there a different approach to my problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/join-merge-csv-file-shapefile/m-p/103436#M1023</guid>
      <dc:creator>MichaelStöckli</dc:creator>
      <dc:date>2021-12-11T06:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: join/merge csv-file &amp; shapefile</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/join-merge-csv-file-shapefile/m-p/103437#M1024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't think of&amp;nbsp;a direct way&amp;nbsp;to do this yet (essentially you want a join between the Shapefile and a CSV), but it would help to understand the nature of your data. In particular, how is the CSV contents related to the shapefile records, and does the contents of the CSV change frequently or is it pretty static? Also, is the shapefile very large (i.e. do you want to operate directly against the shapefile, or could you work with an in-memory copy of it?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the data, one approach you could take would be to create an &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html"&gt;&lt;STRONG&gt;AGSFeatureCollectionTable&lt;/STRONG&gt;&lt;/A&gt; from the result of a query against the shapefile using &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html#a6fd994fc6260f63042463fc927ba9d61"&gt;featureCollectionTableWithFeatureSet()&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;(an AGSFeatureQueryResult &lt;EM&gt;is&lt;/EM&gt; an AGSFeatureSet). Create an &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_layer.html"&gt;&lt;STRONG&gt;AGSFeatureCollectionLayer&lt;/STRONG&gt;&lt;/A&gt; using that. In the layers collection, you'll see a single AGSFeatureLayer that you can set your renderer on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;AGSFeatureCollectionTable you create would essentially be an in-memory version of the shapefile data in which you could then edit the "KTNR" values based off the CSV contents without modifying the shapefile itself. Or if you prefer to merge/import some other field from the CSV to key your renderer off, you could populate the AGSFeatureCollectionTable slightly more manually using &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_collection_table.html#aa9d8fcf24b0c164e8ddfbcb8cae47cca"&gt;featureCollectionTableWithGeoElements:fields()&lt;/A&gt;&lt;/STRONG&gt;&amp;nbsp;copying the fields from the Shapefile (or a subset if you don't need them all), and add an additional field that the renderer will be keyed on, populating that from the CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you give us some more information on the nature of the CSV and how it relates to the Shapefile?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 20:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/join-merge-csv-file-shapefile/m-p/103437#M1024</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2019-04-16T20:49:27Z</dc:date>
    </item>
  </channel>
</rss>

