<?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: Add feature with attributes and geometry to mobile geodatabase in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224261#M1124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks for the update. It's good to hear it's working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Sep 2017 15:19:04 GMT</pubDate>
    <dc:creator>JamesBallard1</dc:creator>
    <dc:date>2017-09-01T15:19:04Z</dc:date>
    <item>
      <title>Add feature with attributes and geometry to mobile geodatabase</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224258#M1121</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;I have an editable mobile geodatabase (simulation.geodatabase, generated from a feature service) which has a table "Result" with a field "Value" (float64/double) and a Geometry (a polyline).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to add some features to this table, but I only succeed in adding empty features (with null for Value and SHAPE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the relevant code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;...
Esri::ArcGISRuntime::Geodatabase* geodatabase = new Esri::ArcGISRuntime::Geodatabase(QString::fromStdString(_simulationGeodatabasePath));
geodatabase-&amp;gt;load();

Esri::ArcGISRuntime::LoadStatus ls = geodatabase-&amp;gt;loadStatus();

while (ls != Esri::ArcGISRuntime::LoadStatus::Loaded)
{
&amp;nbsp;&amp;nbsp; &amp;nbsp;boost::interprocess::winapi::sleep(100);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ls = geodatabase-&amp;gt;loadStatus();
}
&amp;nbsp;_simTable = EsriContext::getInstance()-&amp;gt;getSimulationGeodatabase()-&amp;gt;geodatabaseFeatureTable("Result");
if (_simTable)
{
&amp;nbsp;&amp;nbsp; &amp;nbsp;_simTable-&amp;gt;load();
&amp;nbsp;&amp;nbsp; &amp;nbsp;while (_simTable-&amp;gt;loadStatus() != Esri::ArcGISRuntime::LoadStatus::Loaded)
&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;boost::interprocess::winapi::sleep(100);
&amp;nbsp;&amp;nbsp; &amp;nbsp;}
&amp;nbsp;&amp;nbsp; &amp;nbsp;QList&amp;lt;Esri::ArcGISRuntime::Feature*&amp;gt; simResults;

&amp;nbsp;&amp;nbsp; &amp;nbsp;std::vector&amp;lt;std::shared_ptr&amp;lt;Esri::ArcGISRuntime::PolylineBuilder&amp;gt; &amp;gt;::iterator it = _polylineBuilders.begin();
&amp;nbsp;&amp;nbsp; &amp;nbsp;int i = 1;
&amp;nbsp;&amp;nbsp; &amp;nbsp;for (it; it != _polylineBuilders.end(); ++it, ++i)
&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;std::string index = boost::lexical_cast&amp;lt;std::string&amp;gt;(i);

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;QMap&amp;lt;QString, QVariant&amp;gt; featureAttributes;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;featureAttributes.insert("Value", 1.0);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Esri::ArcGISRuntime::Feature* feature = _simTable-&amp;gt;createFeature(featureAttributes, (*it)-&amp;gt;toGeometry(), geodatabase);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;simResults.append(feature);
&amp;nbsp;&amp;nbsp; &amp;nbsp;}


&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_simTable-&amp;gt;canAdd())
&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Esri::ArcGISRuntime::TaskWatcher&amp;amp; taskWatcher = _simTable-&amp;gt;addFeatures(simResults);

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (!(taskWatcher.isDone()))
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;boost::interprocess::winapi::sleep(100);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}
&amp;nbsp;&amp;nbsp; &amp;nbsp;}
}
...&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The wkid of the polylines from the polylinebuilders is the same as the one of the .geodatabase.&lt;/P&gt;&lt;P&gt;When I just create an empty feature (_simTable-&amp;gt;createFeature(_geodatabase);) and add them, they are added to the geodatabase (I check it with "db browser for sqlite"). When I try to assign an attribute and geometry like in the code above, nothing is added. Anybody has any idea what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224258#M1121</guid>
      <dc:creator>JanWillemsen</dc:creator>
      <dc:date>2021-12-12T16:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature with attributes and geometry to mobile geodatabase</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224259#M1122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; This is difficult to diagnose without the geodatabase. Here are some things to try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you verify this is returning a valid, non-null feature? It's possible there's a schema mismatch or maybe there's a missing required field.&lt;/P&gt;&lt;PRE style="background-color: #ffffff; border: 0px;"&gt;Esri::ArcGISRuntime::Feature* feature = _simTable-&amp;gt;createFeature(featureAttributes, (*it)-&amp;gt;toGeometry(), geodatabase);&lt;/PRE&gt;&lt;P&gt;You could also connect to the errorOccurred signal to see if any errors are being reported on the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (_simTable)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; connect(_simTable, &amp;amp;FeatureTable::errorOccurred, this, [](Error e)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; qDebug() &amp;lt;&amp;lt; "Error:" &amp;lt;&amp;lt; e.message() &amp;lt;&amp;lt; e.additionalMessage();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; });&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2017 18:41:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224259#M1122</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2017-08-31T18:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature with attributes and geometry to mobile geodatabase</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224260#M1123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the suggestion. It didn't give me any error though (valid pointer and the code didn't arrive in the slot either).&lt;/P&gt;&lt;P&gt;We found out that the spatial reference of the exported .geodatabase was still wrong, now it seems to work.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2017 10:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224260#M1123</guid>
      <dc:creator>JanWillemsen</dc:creator>
      <dc:date>2017-09-01T10:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature with attributes and geometry to mobile geodatabase</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224261#M1124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks for the update. It's good to hear it's working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2017 15:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/add-feature-with-attributes-and-geometry-to-mobile/m-p/224261#M1124</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2017-09-01T15:19:04Z</dc:date>
    </item>
  </channel>
</rss>

