<?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: Getting feature layer for AGSGraphic in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580107#M4978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris, thanks for response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But in delegate callback I get related features, from &lt;/SPAN&gt;&lt;STRONG&gt;another&lt;/STRONG&gt;&lt;SPAN&gt; layer or table, so I need an URL for that related layer/table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// layer.URL = /rest/services/signs/FeatureServer/0
self.queryTask = [[AGSQueryTask alloc] initWithURL:layer.URL];
self.queryTask.delegate = self;
 
self.query = [AGSRelationshipQuery relationshipQuery];
self.query.outFields = [NSArray arrayWithObject:@"*"];
self.query.objectIds = [NSArray arrayWithObject:[NSNumber numberWithInt:68]];
self.query.relationshipId = 0;
self.query.returnGeometry = YES;
 
[self.queryTask executeWithRelationshipQuery:self.query];

...

// delegate method
- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation*)op didExecuteWithRelatedFeatures:(NSDictionary *)relatedFeatures
{
&amp;nbsp; // queryTask.URL = /rest/services/signs/FeatureServer/0
&amp;nbsp; // but should be: /rest/services/signs/FeatureServer/1
&amp;nbsp; // since related features we got here belongs to table /1, not /0

&amp;nbsp; NSLog(@"url: %@", queryTask.URL);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:57:08 GMT</pubDate>
    <dc:creator>alexandergolubev</dc:creator>
    <dc:date>2021-12-12T00:57:08Z</dc:date>
    <item>
      <title>Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580105#M4976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an array of AGSGraphic I got via AGSRelationshipQuery and I'm wondering how can I find AGSFeatureLayer those AGSGraphics belongs to. I need this layer since I want to edit those graphics, download attachments for them, etc (using AGSFeatureLayer' methods such as updateFeatures, addFeatures and so on).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to do this? Please advice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2013 14:58:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580105#M4976</guid>
      <dc:creator>alexandergolubev</dc:creator>
      <dc:date>2013-04-07T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580106#M4977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are using an AGSQueryTask to get back a feature set, you will need to provide a URL for the query task to query, as well as set up the spatial relationship query. If you use the delegate method*queryTask:operation:didExecuteWithFeatureSetResult:, you will have access to the feature set that is returned as well as the queryTask that was run. One of the properties of the QueryTask you get back is URL, so you could use that URL to do any operations you want to do from there like updateFeatures. Below is a partial implementation of what i mean.&amp;nbsp; Even if you run two query tasks, you will still always be able to grab the correct URL.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-(void)QueryTask&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; AGSSpatialReference *spatialRef = [AGSSpatialReference spatialReferenceWithWKID:4326];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; AGSPoint *point = [[AGSPoint alloc] initWithX:longitude y:latitude spatialReference:spatialRef];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; self.queryTask=[AGSQueryTask queryTaskWithURL:[NSURL URLWithString:@"YOUR_URL"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; self.queryTask.delegate = self; //make sure you have your class set as a Query Task Delegate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; self.query = [AGSQuery query];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; self.query.geometry = point;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; self.query.spatialRelationship = AGSSpatialRelationshipWithin;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [self.queryTask executeWithQuery:self.query];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//results are returned&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation *)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)retrievedFeatureSet {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSURL *URL = queryTask.URL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSFeatureLayer *layerToModify = [[AGSFeatureLayer alloc] initWithURL: URL mode: AGSFeatureLayerModeOnDemand];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 17:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580106#M4977</guid>
      <dc:creator>ChristopherBarger</dc:creator>
      <dc:date>2013-04-08T17:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580107#M4978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris, thanks for response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But in delegate callback I get related features, from &lt;/SPAN&gt;&lt;STRONG&gt;another&lt;/STRONG&gt;&lt;SPAN&gt; layer or table, so I need an URL for that related layer/table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// layer.URL = /rest/services/signs/FeatureServer/0
self.queryTask = [[AGSQueryTask alloc] initWithURL:layer.URL];
self.queryTask.delegate = self;
 
self.query = [AGSRelationshipQuery relationshipQuery];
self.query.outFields = [NSArray arrayWithObject:@"*"];
self.query.objectIds = [NSArray arrayWithObject:[NSNumber numberWithInt:68]];
self.query.relationshipId = 0;
self.query.returnGeometry = YES;
 
[self.queryTask executeWithRelationshipQuery:self.query];

...

// delegate method
- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation*)op didExecuteWithRelatedFeatures:(NSDictionary *)relatedFeatures
{
&amp;nbsp; // queryTask.URL = /rest/services/signs/FeatureServer/0
&amp;nbsp; // but should be: /rest/services/signs/FeatureServer/1
&amp;nbsp; // since related features we got here belongs to table /1, not /0

&amp;nbsp; NSLog(@"url: %@", queryTask.URL);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580107#M4978</guid>
      <dc:creator>alexandergolubev</dc:creator>
      <dc:date>2021-12-12T00:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580108#M4979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you look at &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=7b27abc98c9d4d0f8be63d5df4c70c54"&gt;Related Record Editing Sample&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 23:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580108#M4979</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2013-04-08T23:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580109#M4980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nimesh, of course.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But in this sample URL of related layer is hardcoded. I'm wondering is it possible to programmatically get this URL somehow?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 00:51:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580109#M4980</guid>
      <dc:creator>alexandergolubev</dc:creator>
      <dc:date>2013-04-09T00:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580110#M4981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you executing relationship query from AGSFeatureLayer? If yes, the URL for the related graphics are going to be AGSFeatureLayer's URL. Just replace the layer id (i.e. /0) with related table/layer id. On the AGSFeatureLayer from which you are sending query has relationship property and you'll get&amp;nbsp; related table/layer id from there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 19:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580110#M4981</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2013-04-09T19:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580111#M4982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, this is most obvious and tricky solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering whether it's possible to have two related layer on two different servers (they will have different URLs), because this approach won't work in this case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I still guess what URL for related layer exists somewhere deep in API, but it pretty hard to find &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, thank you very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 23:12:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580111#M4982</guid>
      <dc:creator>alexandergolubev</dc:creator>
      <dc:date>2013-04-09T23:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting feature layer for AGSGraphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580112#M4983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I'm wondering whether it's possible to have two related layer on two different servers (they will have different URLs)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is NOT possible to have two related layers will have different URLs. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-feature-layer-for-agsgraphic/m-p/580112#M4983</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2013-04-10T14:51:34Z</dc:date>
    </item>
  </channel>
</rss>

