<?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: Best way to query a layer in a local runtime .geodatabase file? in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285029#M1429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Dec 2015 16:23:42 GMT</pubDate>
    <dc:creator>IanBroad</dc:creator>
    <dc:date>2015-12-14T16:23:42Z</dc:date>
    <item>
      <title>Best way to query a layer in a local runtime .geodatabase file?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285027#M1427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;I need to develop a mobile app that accesses a local runtime .geodatabase file. I cannot use a service layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;I'm just getting familiar with the Qt SDK (QML), and I like what I see.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;For the app, my data consists of 1 large polyline layer split into many (20,000) individual sections. What I need the app to do is fairly basic:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Query a polyline layer for a value range (ex: query ± %5 of value), then buffer the results, symbolize the buffered results with 3 class breaks (red closest to value, then orange, and yellow for within the 5%), zoom to the buffered areas.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;My question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;What's the best way to query and buffer the layer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;Right now I'm using:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;Query {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: query&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfields: ["*"]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;}&lt;/SPAN&gt;

&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;function runQuery() {&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = "myField = 'test'";&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myFeatureLayer.selectFeatureByQuery(query);&lt;/SPAN&gt;

&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 20px; font-family: calibri, verdana, arial, sans-serif;"&gt;And on the FeatureLayer I have:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FeatureLayer {
&amp;nbsp; id: myFeatureLayer
&amp;nbsp; featureTable: GeodatabaseFeatureTable {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: myFeatureTable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geodatabase: gdb.valid ? gdb : null
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureServiceLayerId: 0
&amp;nbsp; }
&amp;nbsp; onSelectedFeaturesChanged:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoomToSelected()
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:47:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285027#M1427</guid>
      <dc:creator>IanBroad</dc:creator>
      <dc:date>2021-12-11T13:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to query a layer in a local runtime .geodatabase file?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285028#M1428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I would do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Run a queryFeatures against the GeodatabaseFeatureTable - &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/class_feature_table.html#ac06d850feab2b047f3a8e772e585fe90" title="https://developers.arcgis.com/qt/qml/api-reference/class_feature_table.html#ac06d850feab2b047f3a8e772e585fe90"&gt;ArcGIS Runtime SDK for Qt QML API: FeatureTable Class Reference&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) The queryFeatures result will return an FeatureResult, which has an iterator of features (FeatureQueryIterator - &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/class_feature_query_iterator.html" title="https://developers.arcgis.com/qt/qml/api-reference/class_feature_query_iterator.html"&gt;ArcGIS Runtime SDK for Qt QML API: FeatureQueryIterator Class Reference)).&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; Use a while loop to loop through the iterator while the iterator hasNext. This will give you access to the resulting feature. The feature has geometry - &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/class_feature.html#a34508a68ebc76ed596a31483cb0dc76d" title="https://developers.arcgis.com/qt/qml/api-reference/class_feature.html#a34508a68ebc76ed596a31483cb0dc76d"&gt;ArcGIS Runtime SDK for Qt QML API: Feature Class Reference&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Once you have the geometry, you can directly call buffer() on the geometry, which will give you the output polygon geometry &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/class_geometry.html#abcda9679e21b3d5b910e852aa6878646" title="https://developers.arcgis.com/qt/qml/api-reference/class_geometry.html#abcda9679e21b3d5b910e852aa6878646"&gt;ArcGIS Runtime SDK for Qt QML API: Geometry Class Reference&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) Create a Graphic and&amp;nbsp; add it to a GraphicsLayer. Use the buffer geometry for the graphic's geometry, and use a Renderer or a SimpleFillSymbol for the Graphics symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Luke &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 15:53:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285028#M1428</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2015-12-14T15:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Best way to query a layer in a local runtime .geodatabase file?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285029#M1429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 16:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/best-way-to-query-a-layer-in-a-local-runtime/m-p/285029#M1429</guid>
      <dc:creator>IanBroad</dc:creator>
      <dc:date>2015-12-14T16:23:42Z</dc:date>
    </item>
  </channel>
</rss>

