<?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: ArcRuntime QueryFeaturesAsync does not return M value in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142372#M1623</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;To get the M values you&amp;nbsp;can&amp;nbsp;load the feature e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; polylinesQueryResult&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;First&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;await&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feature &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ArcGISFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;LoadAsync&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or alternatively load all the features in one operation e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; polylinesTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;LoadOrRefreshFeaturesAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polylinesQueryResult&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:50:34 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2021-12-11T07:50:34Z</dc:date>
    <item>
      <title>ArcRuntime QueryFeaturesAsync does not return M value</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142371#M1622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using ArcRuntime 100.9.0 .NET sdk, and I'm querying a ServiceFeatureTable that contains polylines. The query works, but when I inspect the geometry of the feature, the M values are all NaN.&amp;nbsp; I know the feature does have M values by inspecting the same feature in ArcPro. Also, if I just use a browser to the go to the uri and query (i.e. http/{myserviceURI}/query) , I can set ReturnM to true, and see the M values in the geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;//Get layer and add to map...&lt;BR /&gt; Uri serviceUri = new Uri(/**uri string**/);&lt;BR /&gt; CenterlineLayer = new FeatureLayer(serviceUri);&lt;BR /&gt; _map.OperationalLayers.Add(CenterlineLayer);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//Query service&amp;nbsp;
QueryParameters queryParams = new QueryParameters();
 queryParams.WhereClause = "CENTERLINE_HISTORY_ID = 5";
 queryParams.ReturnGeometry = true;

FeatureQueryResult queryResult = await CenterlineLayer.FeatureTable.QueryFeaturesAsync(queryParams);

SelectedCenterline = queryResult.First();

//See screenshot to see NaN as the M Value&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a browser I can go to&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;uri_string&lt;A class="jivelink2" href="http://10.39.2.200:6080/arcgis/rest/services/InTrack/Integrity_HPC_PODS_QAQCSQL12A/MapServer/11/query?where=CENTERLINE_HISTORY_ID+%3D+5&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;returnGeometry=true&amp;amp;returnTrueCurves=false&amp;amp;outSR=3857&amp;amp;returnM=true&amp;amp;f=pjson" title="http://10.39.2.200:6080/arcgis/rest/services/InTrack/Integrity_HPC_PODS_QAQCSQL12A/MapServer/11/query?where=CENTERLINE_HISTORY_ID+%3D+5&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;returnGeometry=true&amp;amp;returnTrueCurves=false&amp;amp;outSR=3857&amp;amp;returnM=true&amp;amp;f=pjson" rel="nofollow noopener noreferrer" target="_blank"&gt;/query?where=CENTERLINE_HISTORY_ID+%3D+5&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;returnGeometry=true&amp;amp;returnTrueCurves=false&amp;amp;outSR=3857&amp;amp;&lt;STRONG&gt;returnM=true&lt;/STRONG&gt;&amp;amp;f=pjson&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I get the M values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{ ... "features": [ { "attributes": { "COMPANY_NAME": "HEC" }, "geometry": { "hasM": true, "paths": [ [ [ -10194353.727657143, 3462589.2523800787, 0 ], [ -10194351.748618515, 3462584.1271569589, 15.600000000005821 ], [ -10193529.228768408, 3460914.2605744163, 5303.8999999999942 ], [ -10191907.687540743, 3458520.5200898903, 13524.100000000006 ], [ -10191835.948896401, 3458416.2688311678, 13883.940000000002 ], .....}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something I need to set on the QueryParameters? I explicitly set ReturnGeometry to true, although it looks like it defaults to true.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142371#M1622</guid>
      <dc:creator>KoryKarr</dc:creator>
      <dc:date>2021-12-12T16:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcRuntime QueryFeaturesAsync does not return M value</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142372#M1623</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;To get the M values you&amp;nbsp;can&amp;nbsp;load the feature e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; polylinesQueryResult&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;First&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;await&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feature &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ArcGISFeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;LoadAsync&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or alternatively load all the features in one operation e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; polylinesTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;LoadOrRefreshFeaturesAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polylinesQueryResult&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142372#M1623</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2021-12-11T07:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcRuntime QueryFeaturesAsync does not return M value</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142373#M1624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! That fixed the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 15:42:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142373#M1624</guid>
      <dc:creator>KoryKarr</dc:creator>
      <dc:date>2020-09-03T15:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcRuntime QueryFeaturesAsync does not return M value</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142374#M1625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also in the query itself specify to load it all:&lt;/P&gt;&lt;PRE style="background-color: #ffffff; border: 0px;"&gt;FeatureQueryResult queryResult = await ((ServiceFeatureTable)CenterlineLayer.FeatureTable).QueryFeaturesAsync(queryParams,&lt;SPAN&gt; QueryFeatureFields.LoadAll&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;One thing to note is that we only load the very minimum required to render the features. That might mean we drop Z and M values, as well as generalize geometry, and exclude attributes not needed for the renderer or labels. This improves query performance dramatically - however if you know you'll be needing all that info up-front, you might as well load it all up-front with the above code.&lt;/P&gt;&lt;P&gt;However if you query to display a set of features, and then want to "click" on one feature and get its details, it's more efficient to just query the bare minimum first, and then&amp;nbsp;use the feature's LoadAsync() prior to displaying the details for that one feature.&lt;/P&gt;&lt;P&gt;A little more generic way to do this for any feature is using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(feature is ILoadable loadable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;await loadable.LoadAsync();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2020 16:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/arcruntime-queryfeaturesasync-does-not-return-m/m-p/142374#M1625</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2020-09-03T16:31:51Z</dc:date>
    </item>
  </channel>
</rss>

