<?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 Displaying query results in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680474#M6043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;I have been trying (quite unsuccessfully) to turn the results of a feature layer query (polygons) into graphics to be added to a graphics layer. I have checked several times that the returned FeatureSet contains the correct amount of features per the WHERE clause of the query. Yet every time I iterate through the FeatureSet, create graphics, and add said graphics to the GraphicsLayer, nothing appears.&amp;nbsp; Here is what I have so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Layer I am querying&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14097710823242435" jivemacro_uid="_14097710823242435" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;NSURL&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;* fenceUrl = [&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;NSURL&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;URLWithString&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;: fenceAddress&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;self&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;.&lt;/SPAN&gt;fenceLayer&lt;SPAN class="s1"&gt; = [&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;AGSFeatureLayer&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;featureServiceLayerWithURL&lt;SPAN class="s1"&gt;: fenceUrl &lt;/SPAN&gt;mode&lt;SPAN class="s1"&gt;:&lt;/SPAN&gt;AGSFeatureLayerModeSelection&lt;SPAN class="s1"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14097711846302840 jive_text_macro" jivemacro_uid="_14097711846302840" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s1"&gt;AGSQuery&lt;/SPAN&gt; *pQuery = [&lt;SPAN class="s1"&gt;AGSQuery&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;query&lt;/SPAN&gt;];&lt;/P&gt;
&lt;P class="p3"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;where&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;@"USEREMAIL LIKE &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'madeUpEmail@gmail.com"&gt;'madeUpEmail@gmail.com&lt;/A&gt;&lt;SPAN&gt;'"&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p4"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;/SPAN&gt;outFields&lt;SPAN class="s3"&gt; = [&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;NSArray&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; &lt;/SPAN&gt;arrayWithObjects&lt;SPAN class="s3"&gt;:&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;@"*"&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s5"&gt;nil&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;SPAN class="s2"&gt;returnGeometry&lt;/SPAN&gt; = &lt;SPAN class="s5"&gt;YES&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P class="p4"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;/SPAN&gt;&lt;SPAN class="s5"&gt;self&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;.&lt;/SPAN&gt;fenceLayer&lt;SPAN class="s3"&gt; &lt;/SPAN&gt;selectFeaturesWithQuery&lt;SPAN class="s3"&gt;:pQuery &lt;/SPAN&gt;selectionMethod&lt;SPAN class="s3"&gt;:&lt;/SPAN&gt;AGSFeatureLayerSelectionMethodAdd&lt;SPAN class="s3"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the result of NSLog-ing the graphics I am trying to add to the layer&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14097714533549057 jive_text_macro" jivemacro_uid="_14097714533549057" modifiedtitle="true"&gt;
&lt;P&gt;&lt;STRONG&gt;geometry: AGSPolygon: [envelope: AGSEnvelope: xmin = -96.650200, ymin = 29.600216, xmax = -96.029897, ymax = 30.117631, spatial reference: [AGSSpatialReference: wkid = 4326, wkt = null]], symbol: &amp;lt;AGSSimpleFillSymbol: 0xde7f030&amp;gt;, attributes: {&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OBJECTID = 801;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USEREMAIL =&lt;/STRONG&gt;&lt;SPAN&gt; "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:madeUpEmail@gmail.com"&gt;madeUpEmail@gmail.com&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USERID = "1";&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; channelID = "&amp;lt;null&amp;gt;";&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;}, visible: 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only thought is this could be a incorrect SpatialReference problem. I have already defined the spatial reference for the graphics to both webMercatorSpatialReference (same as the base map) and wgs84SpatialReference (same as the FeatureLayer) to no success. I tried to add the polygon Nimesh made here &lt;A _jive_internal="true" href="https://community.esri.com/thread/28467"&gt;https://community.esri.com/thread/28467&lt;/A&gt; but even that failed to show up on my map. Any thoughts or ideas would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Aaron.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Sep 2014 19:21:36 GMT</pubDate>
    <dc:creator>AaronHarmon</dc:creator>
    <dc:date>2014-09-03T19:21:36Z</dc:date>
    <item>
      <title>Displaying query results</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680474#M6043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;I have been trying (quite unsuccessfully) to turn the results of a feature layer query (polygons) into graphics to be added to a graphics layer. I have checked several times that the returned FeatureSet contains the correct amount of features per the WHERE clause of the query. Yet every time I iterate through the FeatureSet, create graphics, and add said graphics to the GraphicsLayer, nothing appears.&amp;nbsp; Here is what I have so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Layer I am querying&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14097710823242435" jivemacro_uid="_14097710823242435" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;NSURL&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;* fenceUrl = [&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;NSURL&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;URLWithString&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;: fenceAddress&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;self&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;.&lt;/SPAN&gt;fenceLayer&lt;SPAN class="s1"&gt; = [&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;AGSFeatureLayer&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;featureServiceLayerWithURL&lt;SPAN class="s1"&gt;: fenceUrl &lt;/SPAN&gt;mode&lt;SPAN class="s1"&gt;:&lt;/SPAN&gt;AGSFeatureLayerModeSelection&lt;SPAN class="s1"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The query&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14097711846302840 jive_text_macro" jivemacro_uid="_14097711846302840" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="s1"&gt;AGSQuery&lt;/SPAN&gt; *pQuery = [&lt;SPAN class="s1"&gt;AGSQuery&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;query&lt;/SPAN&gt;];&lt;/P&gt;
&lt;P class="p3"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;where&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;@"USEREMAIL LIKE &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:'madeUpEmail@gmail.com"&gt;'madeUpEmail@gmail.com&lt;/A&gt;&lt;SPAN&gt;'"&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p4"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;/SPAN&gt;outFields&lt;SPAN class="s3"&gt; = [&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;NSArray&lt;/SPAN&gt;&lt;SPAN class="s3"&gt; &lt;/SPAN&gt;arrayWithObjects&lt;SPAN class="s3"&gt;:&lt;/SPAN&gt;&lt;SPAN class="s4"&gt;@"*"&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;, &lt;/SPAN&gt;&lt;SPAN class="s5"&gt;nil&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pQuery.&lt;SPAN class="s2"&gt;returnGeometry&lt;/SPAN&gt; = &lt;SPAN class="s5"&gt;YES&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P class="p4"&gt;&lt;SPAN class="s3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;/SPAN&gt;&lt;SPAN class="s5"&gt;self&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;.&lt;/SPAN&gt;fenceLayer&lt;SPAN class="s3"&gt; &lt;/SPAN&gt;selectFeaturesWithQuery&lt;SPAN class="s3"&gt;:pQuery &lt;/SPAN&gt;selectionMethod&lt;SPAN class="s3"&gt;:&lt;/SPAN&gt;AGSFeatureLayerSelectionMethodAdd&lt;SPAN class="s3"&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the result of NSLog-ing the graphics I am trying to add to the layer&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14097714533549057 jive_text_macro" jivemacro_uid="_14097714533549057" modifiedtitle="true"&gt;
&lt;P&gt;&lt;STRONG&gt;geometry: AGSPolygon: [envelope: AGSEnvelope: xmin = -96.650200, ymin = 29.600216, xmax = -96.029897, ymax = 30.117631, spatial reference: [AGSSpatialReference: wkid = 4326, wkt = null]], symbol: &amp;lt;AGSSimpleFillSymbol: 0xde7f030&amp;gt;, attributes: {&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OBJECTID = 801;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USEREMAIL =&lt;/STRONG&gt;&lt;SPAN&gt; "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:madeUpEmail@gmail.com"&gt;madeUpEmail@gmail.com&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USERID = "1";&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; channelID = "&amp;lt;null&amp;gt;";&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;}, visible: 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only thought is this could be a incorrect SpatialReference problem. I have already defined the spatial reference for the graphics to both webMercatorSpatialReference (same as the base map) and wgs84SpatialReference (same as the FeatureLayer) to no success. I tried to add the polygon Nimesh made here &lt;A _jive_internal="true" href="https://community.esri.com/thread/28467"&gt;https://community.esri.com/thread/28467&lt;/A&gt; but even that failed to show up on my map. Any thoughts or ideas would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Aaron.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 19:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680474#M6043</guid>
      <dc:creator>AaronHarmon</dc:creator>
      <dc:date>2014-09-03T19:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying query results</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680475#M6044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/48631"&gt;Aaron Harmon&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try setting the 'outSpatialReference' to the mapView's spatialReference, once the mapView has loaded? It might be the case that the two spatial references are different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Gagan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680475#M6044</guid>
      <dc:creator>GagandeepSingh</dc:creator>
      <dc:date>2014-09-04T16:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying query results</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680476#M6045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out my issue. I was initializing my AGSGraphicLayer with [AGSGraphicLayer graphicslayer] instead of [initWithSpatialReference].&amp;nbsp; Once I had that I was about to see my polygons as a single red pixel off the coast of Africa.&amp;nbsp; Then I created the graphic using [AGSGraphic graphicWithGeometry:symbol:attributes:] while using [AGSGeometryGeographicToWebMercator().&amp;nbsp; This combination finally created the graphics right where I needed. &lt;/P&gt;&lt;P&gt;Thanks anyway Gagan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 18:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/displaying-query-results/m-p/680476#M6045</guid>
      <dc:creator>AaronHarmon</dc:creator>
      <dc:date>2014-09-08T18:05:02Z</dc:date>
    </item>
  </channel>
</rss>

