<?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 Accessing a field from a Map Server and populating UITableView in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1509732#M7804</link>
    <description>&lt;P&gt;I am developing an application on Xcode 15.4 &amp;amp; Swift 5.4 using ArcGIS SDK for iOS. I am trying to access the below URL;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.gisqatar.org.qa/server/rest/services/Vector/MunicipalityE/MapServer/0" target="_blank"&gt;https://services.gisqatar.org.qa/server/rest/services/Vector/MunicipalityE/MapServer/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Extracting the ENAME field and populating a UITableView. This service contains only 8 Records but it takes more than 20 seconds to populate the table. I think, I should take maximum 2-3 seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be very much appreciated if someone explain to me why it takes too much time or some thing wrong in my code. The Code is attached herewith for ready reference.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Afroz Alam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2024 05:45:21 GMT</pubDate>
    <dc:creator>AfrozAlam</dc:creator>
    <dc:date>2024-07-25T05:45:21Z</dc:date>
    <item>
      <title>Accessing a field from a Map Server and populating UITableView</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1509732#M7804</link>
      <description>&lt;P&gt;I am developing an application on Xcode 15.4 &amp;amp; Swift 5.4 using ArcGIS SDK for iOS. I am trying to access the below URL;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.gisqatar.org.qa/server/rest/services/Vector/MunicipalityE/MapServer/0" target="_blank"&gt;https://services.gisqatar.org.qa/server/rest/services/Vector/MunicipalityE/MapServer/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Extracting the ENAME field and populating a UITableView. This service contains only 8 Records but it takes more than 20 seconds to populate the table. I think, I should take maximum 2-3 seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be very much appreciated if someone explain to me why it takes too much time or some thing wrong in my code. The Code is attached herewith for ready reference.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Afroz Alam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 05:45:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1509732#M7804</guid>
      <dc:creator>AfrozAlam</dc:creator>
      <dc:date>2024-07-25T05:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a field from a Map Server and populating UITableView</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1510263#M7805</link>
      <description>&lt;P&gt;Hi Afroz,&lt;/P&gt;&lt;P&gt;After examining this feature service, I found that a large amount of time was consumed by loading the geometry of each feature. If you don't need the geometry in the &lt;EM&gt;UITableView&lt;/EM&gt;, consider the following&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;queryParams.returnGeometry = false&lt;/LI-CODE&gt;&lt;P&gt;By setting the query parameter's &lt;EM&gt;returnGeometry&lt;/EM&gt; to &lt;EM&gt;false&lt;/EM&gt;, it will not load the geometry for the feature, which saves big amount of time. Per my test, with this line added, the query takes about 1 second. While it normally takes 5 seconds to fully load.&lt;/P&gt;&lt;P&gt;The full code looks like below. Note that I added a clock to measure the time elapsed for the query.&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;private func queryMunicipality() {
    let begin = clock()
    print("clock begins")
    
    let queryParams = AGSQueryParameters()
    queryParams.whereClause = "1=1"
    queryParams.returnGeometry = false
    featureTable.populateFromService(
        with: queryParams,
        clearCache: true,
        outFields: ["*"]
    ) { [weak self] (queryResult: AGSFeatureQueryResult?, error: Error?) in
        guard let self else { return }
        
        // For measuring time
        let diff = Double(clock() - begin) / Double(CLOCKS_PER_SEC)
        print("Time elapsed", diff)
        
        if let error {
            print(error.localizedDescription)
        } else if let features = queryResult?.featureEnumerator().allObjects,
                  !features.isEmpty {
            for feature in features {
                let featureDict = [
                    "CODE": feature.attributes.value(forKey: "CODE") as! String,
                    "ENAME": feature.attributes.value(forKey: "ENAME") as! String,
                    "ANAME": feature.attributes.value(forKey: "ANAME") as! String
                ]
                print("Attr: \(featureDict)")
            }
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 19:51:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1510263#M7805</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2024-07-25T19:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a field from a Map Server and populating UITableView</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1511125#M7806</link>
      <description>&lt;P&gt;Hi Ting,&lt;/P&gt;&lt;P&gt;Thank you very much. The problem is solved.&lt;/P&gt;&lt;P&gt;So kind of you.&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 06:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/accessing-a-field-from-a-map-server-and-populating/m-p/1511125#M7806</guid>
      <dc:creator>AfrozAlam</dc:creator>
      <dc:date>2024-07-28T06:52:08Z</dc:date>
    </item>
  </channel>
</rss>

