POST
|
There is indeed an issue with editing tables that are not feature layers at the current release of the Qt Runtime SDK. So for anyone interested, our solution was to add (fake point) geometry to the flat table so we could expose it as a feature layer in the REST service. Within the Qt code, I use the table and make it a (fake) feature layer that never gets added to the map. //initialize the fake feature layer from the table and initialize the layer someTable.url = someRESTEndpointUrl; someTableFakeFeaturelayer.featureTable = userTable; someTableFakeFeaturelayer.initialize(); When the feature layer’s status changes to LayerStatusInitialized, I run a query to get the data I want to update: if (someTable.featureTableStatus === Enums.FeatureTableStatusInitialized) { //run a query to download the data we want from the service userQuery.where = aQueryString; someTable.queryServiceFeatures(userQuery); } And when the table’s QueryServiceFeaturesStatusChanged === QueryFeaturesStatusCompleted, I update the feature records that are returned and then finally apply the edits to the table: var iterator_edits = queryServiceFeaturesResult.iterator; var thisRecord; while (iterator_edits.hasNext()) { //update some information thisRecord = iterator_edits.next(); thisRecord.setAttributeValue(m_NameOfAttribute, newValue); //apply the edits to the feature (i.e., this data record) updateFeature(thisRecord.uniqueId, thisRecord); } //apply the edits to the table someTable.applyFeatureEdits(); And everything updates as expected. Thanks for the insight on this Lucas!
... View more
04-22-2015
12:33 PM
|
0
|
0
|
28
|
POST
|
I have a feature service that is hosted on ArcGIS.com, and the service contains a feature layer and a plain table. I want to update an attribute in the table from my Qt application, but I cannot. I do catch the signal onApplyFeatureEditsStatusChanged() and the status is indeed Enums.ApplyEditsStatusErrored, but I don't understand how to handle the actual error object: applyFeatureEditsErrors. That is, applyFeatureEditsErrors.error is undefined. The things that I CAN do: - query the table, and loop through the results logging all the attribute values, - update attributes in the table using the REST interface in a browser. To check my code, I used the feature layer endpoint instead, created a feature layer from it, and added it to the map: GeodatabaseFeatureServiceTable { id : myTableFromURL url :someFeatureServiceRESTEndpointURL onApplyFeatureEditsStatusChanged : {...} } featureLayer .featureTable = myTableFromURL ; appMap .addLayer( featureLayer ); Then I waited for the FeatureLayer to initialize and verified that my table did too: if ( myTableFromURL .featureTableStatus === Enums .FeatureTableStatusInitialized) { updatesEnabled = true; } I can run a query to get features from the table/layer, and when the query is completed, loop through the records, updating data as I go: thisRecord.setAttributeValue("SOME_ATTRIBUTE","SOME_NEW_VALUE"); myTableFromURL.updateFeature(thisRecord.uniqueId, thisRecord); And finally, once all the edits have been made to the features, tell the table to apply the changes: myTableFromURL .applyFeatureEdits(); The edits are visible in the feature layer on arcgis.com. Same process with the flat table (minus making and adding a feature layer to the map) does not work. Is there a similar method to initialize a flat table (non-geo-enabled) as what happens when a feature layer is added to a map? Thanks in advance, Chris
... View more
04-15-2015
12:15 PM
|
0
|
2
|
3277
|
POST
|
I am using the Qt Runtime SDK (10.2.5) to make an app for OS X, Android and iOS. I have also installed Esri's build of the Qt SDK for iOS (Qt540-iOS-esri.zip), and made sure the post installer is pointing to the correct qmake file. When I try to query a secured service from my iPhone (after the map is ready), I get the dreaded "SSL handshake failed" error. The process works fine in OS X and Android, but not in iOS. I was able to access this same service on all three platforms during the Qt 10.3 beta program. Any ideas on how to get this working again? Snippet of code is below. Thanks, Chris code snippet: Button { text:"Get Users" visible: isEverythingReady onClicked: { console.log("getting data from table"); myTable.getTheUsers(); } } GeodatabaseFeatureServiceTable { id: myTable onQueryServiceFeaturesStatusChanged: { if (queryServiceFeaturesStatus === Enums.QueryFeaturesStatusCompleted) { try { console.log("QUERY COMPLETE!!!"); var iterator = queryServiceFeaturesResult.iterator; var featureInTable; while (iterator.hasNext()) { row = iterator.next(); console.log("field1", featureInTable.attributeValue(nameoffield1)); console.log("field2", featureInTable.attributeValue(nameoffield2)); } } catch(err) { console.log("oops", err.message, err.lineNumber); } } else if (queryServiceFeaturesStatus === Enums.QueryFeaturesStatusErrored) { console.log("!!!! ERROR onQueryServiceFeaturesStatusChanged", queryServiceFeaturesError); } } function getTheUsers() { console.log("setting up table properties"); var urlString = somelayerinafeatureservice; myTable.url = urlString; myTable.credentials.userName = someserfromsignin; myTable.credentials.password = somepwdfromsignin; myQuery.where = "1=1"; myTable.queryServiceFeatures(myQuery); } } Query { id: myQuery returnGeometry: false }
... View more
03-27-2015
02:16 PM
|
0
|
1
|
4061
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|