|
POST
|
I created a Toolbox I created a New Script I then set parameters for each of the fields I want to update I then modified the python file as such: When I run the tool I can add values in the attribute fields from the popup window and it updates fine... I just don't know how to pass the parameters from inside AppStudio to the GP Service..... import arcpy
from arcpy import env
import os
# Geting user input for project name, status, type, submital date and planner name
varObjectID = arcpy.GetParameterAsText(5)
varItem = arcpy.GetParameterAsText(0)
varPublicPrivate = arcpy.GetParameterAsText(1)
varCaseNum = arcpy.GetParameterAsText(2)
varComments = arcpy.GetParameterAsText(3)
varClassification = arcpy.GetParameterAsText(4)
varLast_created_user = arcpy.GetParameterAsText(6)
varLast_edit_date = arcpy.GetParameterAsText(7)
#Set variable to hold SQL statement to query out project to update
whereClause = "[OBJECTID] = '{0}'".format(varObjectID)
fc = 'Data.DBO.Incidents'
workspace = arcpy.env.workspace = r'C:\Users\xxx\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\[email protected]'
# Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
# Edit session is started without an undo/redo stack for versioned data
# (for second argument, use False for unversioned data)
edit.startEditing(False, False)
# Start an edit operation
edit.startOperation()
# UPDATE a row in the Feacture Class
Ucursor = arcpy.da.UpdateCursor(fc,["OBJECTID","Item","PublicPrivate","CaseNum","Comments","Classification","last_edited_user", "last_edited_date"],whereClause)
for row in Ucursor:
irow = (varObjectID, varItem, varPublicPrivate, varCaseNum, varComments, varClassification, varLast_created_user, varLast_edit_date)
Ucursor.updateRow(irow)
arcpy.RefreshActiveView()
# Stop the edit operation.
edit.stopOperation()
# Stop the edit session and save the changes
edit.stopEditing(True)
... View more
09-17-2019
01:27 PM
|
0
|
1
|
1092
|
|
POST
|
Please Help I am trying to run a GP task from a test Appstudio app. This is what I have right now and want to see if I am on the right path....as this varies from the JavaScript API 1. ALL I am trying to do is Pass a few variables on a button click to the GP service. 2. Once at the GPS Service I want to write those to Variables. I just want to make sure I can transfer this data and grab it on the back end. Right now I am referencing an ESRI same service I will replace this with mine. // snip
property GeoprocessingJob viewshedJob: null
// snip
// ON BUTTON CLICK I WILL LAUNCH THIS
// viewshedTask.calculateViewshed(mouse.mapPoint);
GeoprocessingTask {
id: viewshedTask
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed"
function calculateViewshed(location) {
var viewshedParameters = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters", {
executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute
});
var ObjectID = "65421" // will get these values from textboxes
var Comments = "something" // will get these values from textboxes
var params = {"OBHECTID":ObjectID,"comments":Comments };
viewshedParameters = params;
// Create the job that handles the communication between the application and the geoprocessing task
viewshedJob = viewshedTask.createJob(viewshedParameters);
// Create signal handler for the job
viewshedJob.jobStatusChanged.connect(viewshedJobHandler);
// start the job
viewshedJob.start();
}
} import arcpy
import os
# Geting user input for project name, status, type, submital date and planner name
varObjectID = arcpy.GetParameterAsText(0)
varComments = arcpy.GetParameterAsText(1)
# do something with the returned values
... View more
09-17-2019
07:32 AM
|
0
|
3
|
1172
|
|
POST
|
Did you ever get this working...need to do this and looking for any help I can...
... View more
09-17-2019
06:32 AM
|
0
|
0
|
968
|
|
POST
|
Can you run a GP tool from AppStudio and would there be needed licensing.
... View more
09-17-2019
05:35 AM
|
0
|
1
|
768
|
|
POST
|
Thank you for the information....much appreciated...cheers.
... View more
09-12-2019
12:18 PM
|
1
|
0
|
1453
|
|
POST
|
I assume you simply create the Feature Class, and Tables. Add global IDs etc Set up the relationship classes to the tables Create a webmap Access in Collector and the options to edit each table should be there?
... View more
09-12-2019
10:33 AM
|
0
|
1
|
1453
|
|
POST
|
I know that you can edit a location and add data to a related table. Question can I do this with multiple related tables. Say I have a parcel dataset I have a relationship classes for: 1. Parcel Info Updates Data 2. Habitat study Data 3. Land Development Data Can I click a Parcel and have the option to add data into each of the three Related tables above? Or can you only add data to one related table?
... View more
09-12-2019
08:22 AM
|
0
|
4
|
1496
|
|
POST
|
I have been trying this to change the URL or PATH and cant get working... Can I change the tpk file in an app with drop down or a button. I know I can do this with mmpk files... Creating a new object for TileCache This is what I get in the console when trying to SET the TileCache OBECJT and then trying to set the NewMAP : Esri.ArcGISRuntime.Core: class QmlImageProvider *__cdecl QmlImageSource::imageProvider(class QObject *) No context for: QmlTileCacheThumbnail qml: {"objectName":"mapTileCache","objectType":"TileCache","error":null,"objects":{},"loadError":null,"loadStatus":3,"path":"file:///Android/data/com.dgif.background.data/QuickReport/backgrounddatatpk.tpk","thumbnailUrl":"image://arcgisruntimeimageprovider/046a7700-d612-4c29-a59c-011fe175a4bf/thumbnail","tileInfo":null,"antialiasing":false,"cacheStorageFormat":-1,"fullExtent":null} ArcGIS.AppFramework.Player: Object: QObject(0x0) Text: "file:///C:/Users/tjv36463/ArcGIS/AppStudio/Apps/03d396a4adaf4087837688ceb176474b/QuickReport/pages/NavigateOffline.qml:2949: Error: Cannot assign QObject* to QUrl" file:///C:/Users/tjv36463/ArcGIS/AppStudio/Apps/03d396a4adaf4087837688ceb176474b/QuickReport/pages/NavigateOffline.qml:2949: Error: Cannot assign QObject* to QUrl // modifiedPath equals "file:///Android/data/com.dgif.background.data/QuickReport/backgrounddatatpk.tpk";
var webmapUrl = modifiedPath
var newMap = ArcGISRuntimeEnvironment.createObject("TileCache", {path: webmapUrl,objectName: "mapTileCache"});
// Set the map to the MapView
console.log(JSON.stringify(newMap));
mapTileCache.path = newMap
... View more
09-12-2019
07:17 AM
|
0
|
2
|
1249
|
|
POST
|
Can you change the TPK that was initially loaded in your app // SNIP
Item {
id: mmpkManager
property string itemName2: "backgrounddatatpk.tpk"
property string filePath: [fileFolder2.path, itemName2].join("/")
property string itemName3: "backgrounddatatpk.tpk"
property url fileUrl3: [fileFolder3.url, itemName3].join("/")
// THIS IS FOR THE PATHING TO THE TOPOS ASKED FOR IN THE LoadService.qml
FileFolder {
id: fileFolder2
//USE THIS WHEN USING PLAYER ON THE DESKTOP
//property string exLocation:AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data/QuickReport")
path: exLocation
Component.onCompleted: {
console.log("exLocation: " + exLocation)
}
}
FileFolder {
id: fileFolder3
//USE THIS WHEN USING PLAYER ON THE DESKTOP
property string exLocation:AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data/QuickReport")
url: exLocation3
Component.onCompleted: {
console.log("exLocation 3 : " + exLocation3)
}
}
} //SNIP
property string dataPath: app.mmpkManager.filePath
property string dataURL3: app.mmpkManager.fileUrl3
MapView{
id: mapView
Map{
id: map
Basemap {
ArcGISTiledLayer {
url: dataPath
}
}
// SNIP
Button {
id: offlineSwitchButton
visible: true
text: "change basemap"
var location = JSON.stringify({url: dataURL3});
onClicked: {
var mapping = ArcGISRuntimeEnvironment.createObject("Basemap", location);
mapView.map = mapping;
}
}
... View more
09-09-2019
09:22 AM
|
0
|
4
|
1399
|
|
POST
|
How can you load a TPK from a button or drop box.... I initially load a TPK file into my app as seen above in this post. But I want a button to change that to a different tpk on the device....How do I do this... I tried this and nothing...errors.... // SNIP INSIDE BUTTON CLICK
var layer = ArcGISRuntimeEnvironment.createObject("ArcGISTiledLayer");
layer.url = AppFramework.userHomeFolder.filePath("ArcGIS/AppStudio/Data/QuickReport/backgrounddatatpk.tpk");
mapView.map = layer;
// SNIP END OF BUTTON ON CLICK EVENT
... View more
09-06-2019
07:23 AM
|
0
|
0
|
1547
|
|
POST
|
Wondering if anyone has any examples of turning on and off Feature layers in an appstudio app Is there something like visible = false? Can I turn them on and off FeatureLayer {
ServiceFeatureTable {
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9"
}
} Something like this
... View more
08-20-2019
05:34 AM
|
0
|
1
|
924
|
|
POST
|
I changed my code to this and everything works fine.... Thanks Harsh from ESRI It was in reference to this example: https://github.com/Esri/arcgis-runtime-samples-qt/tree/master/ArcGISRuntimeSDKQt_QMLSamples/Maps/ChangeBasemap that used a combobox and its index to find the correct map to load....As I was using a button I had to create that index and decided to do so with an If then statement and an index number I created to loop through the maps. Anyone know a better way to do this? import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Esri.ArcGISRuntime 100.5
import QtQuick.Layouts 1.1
Item {
signal previous(string message)
property string basemapId: ""
property int basemapindex: 1
MapView {
id:mapView
Layout.fillHeight: true
Layout.alignment: Qt.AlignTop
width: parent.width
height: parent.height
property real initialMapRotation: 0
Map {
id: map
initialViewpoint: viewPoint
// Set the initial basemap to Topographic
BasemapTopographic {}
} // END OF MAP
} // END OF MAPVIEW
ListModel {
id: cbItems
ListElement { text: "Topographic"; map: "BasemapTopographic" }
ListElement { text: "Streets (Vector)"; map: "BasemapStreetsVector" }
ListElement { text: "Streets - Night (Vector)"; map: "BasemapStreetsNightVector" }
ListElement { text: "Imagery with Labels (Vector)"; map: "BasemapImageryWithLabelsVector" }
ListElement { text: "Navigation (Vector)"; map: "BasemapNavigationVector" }
//ListElement { text: "Streets"; map: "BasemapStreets" }
//ListElement { text: "Imagery (Raster)"; map: "BasemapImagery" }
//ListElement { text: "Imagery with Labels (Raster)"; map: "BasemapImageryWithLabels" }
//ListElement { text: "Dark Gray Canvas (Vector)"; map: "BasemapDarkGrayCanvasVector" }
//ListElement { text: "Light Gray Canvas (Raster)"; map: "BasemapLightGrayCanvas" }
//ListElement { text: "Light Gray Canvas (Vector)"; map: "BasemapLightGrayCanvasVector" }
//ListElement { text: "OpenStreetMap (Raster)"; map: "BasemapOpenStreetMap" }
//ListElement { text: "Oceans"; map: "BasemapOceans" }
}
Row {
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: 5 * scaleFactor
bottomMargin: 50 * scaleFactor
}
spacing: 5
Button {
id: buttontext
text: "Topo"
onClicked: {
if (basemapindex == 1) {
changeBasemap(cbItems.get(1).map);
basemapindex = 2
buttontext.text = "Streets"
} else if (basemapindex == 2){
changeBasemap(cbItems.get(2).map);
basemapindex = 3
buttontext.text = "Street Night"
} else if (basemapindex == 3){
changeBasemap(cbItems.get(3).map);
basemapindex = 4
buttontext.text = "Imagery Labels"
} else if (basemapindex == 4){
changeBasemap(cbItems.get(4).map);
basemapindex = 0
buttontext.text = "Navigation"
} else if (basemapindex == 0){
basemapindex = 1
changeBasemap(cbItems.get(0).map);
buttontext.text = "Topo"
}
function changeBasemap(type) {
map.basemap = ArcGISRuntimeEnvironment.createObject(type);
}
} // End of OnClicked
} // End of Button
} // End of Row
ViewpointCenter {
id: viewPoint
center: Point {
//x: -13630484
//y: 4545415
x: -8622115
y: 4513608
spatialReference: SpatialReference {
wkid: 102100
}
}
targetScale: 3000000
}
}
... View more
08-19-2019
05:39 AM
|
0
|
2
|
2456
|
|
POST
|
My only problem now is that when I switch between them it zooms me way out ....I want to keep the user at the spot they were last zoomed to.....I guess I need to capture the current extent and put that in....not sure how to do that. Thoughts?
... View more
08-16-2019
10:30 AM
|
0
|
0
|
2456
|
|
POST
|
I found a way and did it like this....if anyone knows a smoother way please chime in... import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Esri.ArcGISRuntime 100.5
import QtQuick.Layouts 1.1
Item {
signal previous(string message)
property string basemapId: ""
property int basemapindex: 1
MapView {
id:mapView
Layout.fillHeight: true
Layout.alignment: Qt.AlignTop
width: parent.width
height: parent.height
property real initialMapRotation: 0
Map {
id: map
initialViewpoint: viewPoint
} // END OF MAP
} // END OF MAPVIEW
Component.onCompleted: {
loadWebMap(cbItems2.get(0).item)
}
// Javascript Functions
// Function to load webmap
function loadWebMap(webmapitemid){
var organizationPortalUrl = "http://arcgis.com/sharing/rest/content/items/";
var webmapUrl = organizationPortalUrl + webmapitemid;
var newMap = ArcGISRuntimeEnvironment.createObject("Map", {initUrl: webmapUrl, autoFetchLegendInfos:true});
mapView.map = newMap;
}
ListModel {
id: cbItems2
ListElement { name: "Imagery hybrid w Labels"; item: "86265e5a4bbb4187a59719cf134e0018" }
ListElement { name: "Topo"; item: "d5e02a0c1f2b4ec399823fdd3c2fdebd" }
ListElement { name: "Topographic"; item: "931d892ac7a843d7ba29d085e0433465" }
ListElement { name: "Streets"; item: "8bf7167d20924cbf8e25e7b11c7c502c" }
ListElement { name: "Streets Nights"; item: "7e2b9be8a9c94e45b7f87857d8d168d6" }
}
Row {
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: 5 * scaleFactor
bottomMargin: 50 * scaleFactor
}
spacing: 5
Button {
id: buttontext
text: "Imagery"
onClicked: {
if (basemapindex == 1) {
loadWebMap(cbItems2.get(1).item)
basemapindex = 2
buttontext.text = "Topo"
} else if (basemapindex == 2){
loadWebMap(cbItems2.get(2).item)
basemapindex = 3
buttontext.text = "Topographic"
} else if (basemapindex == 3){
loadWebMap(cbItems2.get(3).item)
basemapindex = 4
buttontext.text = "Streets"
} else if (basemapindex == 4){
loadWebMap(cbItems2.get(4).item)
basemapindex = 0
buttontext.text = "Streets Night"
} else if (basemapindex == 0){
basemapindex = 1
loadWebMap(cbItems2.get(0).item)
buttontext.text = "Imagery"
}
}
}
}
ViewpointCenter {
id: viewPoint
center: Point {
//x: -13630484
//y: 4545415
x: -8622115
y: 4513608
spatialReference: SpatialReference {
wkid: 102100
}
}
targetScale: 3000000
}
}
... View more
08-16-2019
10:29 AM
|
0
|
4
|
2456
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|