<?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: Wrong attributes when executing query on shapefile in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/wrong-attributes-when-executing-query-on-shapefile/m-p/457376#M5626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not been able to reproduce this using v10.2.7. Please can you provide&amp;nbsp;a code example (and ideally the shapefile) that repeatably shows this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not able to share the code/data here, please email &lt;A href="mailto:mbranscomb@esri.com"&gt;mbranscomb@esri.com&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Nov 2017 21:06:52 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2017-11-20T21:06:52Z</dc:date>
    <item>
      <title>Wrong attributes when executing query on shapefile</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wrong-attributes-when-executing-query-on-shapefile/m-p/457375#M5625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear esri community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have the following problem searching for a feature at a certain map position:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We load a shapefile with &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;ShapefileTable.OpenAsync&lt;/SPAN&gt; and save its content in a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FeatureTable&lt;/SPAN&gt; variable. The shapefile contains a large number of features with &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Geometry&lt;/SPAN&gt; which do not overlap.&lt;BR /&gt;Later, in a method in a different class, we use &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;QueryAsync&lt;/SPAN&gt; with a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;SpatialQueryFilter&lt;/SPAN&gt; to find the feature at a certain &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;MapPoint&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;FeatureTable shapefile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ShapefileTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;OpenAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;@"C:\Polygon.shp"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Result&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="punctuation token"&gt;.&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; Feature &lt;SPAN class="token function"&gt;GetFeatureAt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;FeatureTable featureTable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapPoint point&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialQueryFilter spatialQueryFilter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SpatialQueryFilter&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; point&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialRelationship &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SpatialRelationship&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Within
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;QueryAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;spatialQueryFilter&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Result&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&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="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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine the first time after the shapefile was opened, but never again after that. We get the same seemingly random result with wrong feature attributes for any MapPoint each time we execute the query, but the geometry we get is always correct. As a workaround, reopening the file before each query works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The exact same code where the same FeatureTable is loaded via an online FeatureService equally works without problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use ArcGis .net runtime 10.2.5 and tried 10.2.7 as well. We tried running the code under Windows 7, 8 and 10 with the same results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea why this error occurs or whether this might be an error in the Esri framework?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hauke Stieler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:21:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wrong-attributes-when-executing-query-on-shapefile/m-p/457375#M5625</guid>
      <dc:creator>HaukeStieler</dc:creator>
      <dc:date>2021-12-11T20:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong attributes when executing query on shapefile</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wrong-attributes-when-executing-query-on-shapefile/m-p/457376#M5626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not been able to reproduce this using v10.2.7. Please can you provide&amp;nbsp;a code example (and ideally the shapefile) that repeatably shows this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not able to share the code/data here, please email &lt;A href="mailto:mbranscomb@esri.com"&gt;mbranscomb@esri.com&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 21:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wrong-attributes-when-executing-query-on-shapefile/m-p/457376#M5626</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2017-11-20T21:06:52Z</dc:date>
    </item>
  </channel>
</rss>

