|
POST
|
For some reason it looks like I have to....If I run it from the Script via IDLE or from the service itself it works fine. It fails when sent from AppStudio for some reason....I change to Float in python and it now works from App Studio...sometimes you just dont ask...it works and I am moving on.....hahahaha
... View more
10-03-2019
09:05 AM
|
0
|
0
|
3873
|
|
POST
|
I think I got it...I had to Float the String value in Python ...this seemed to work...I now need to do some testing. varXCoord = float(arcpy.GetParameterAsText(4)) varYCoord = float(arcpy.GetParameterAsText(5))
... View more
10-03-2019
08:27 AM
|
1
|
3
|
3873
|
|
POST
|
I have an application that I am testing out. But first a little back information My Steps: I created a simple Python script that creates a new point in a FeatureClass. (see below) I then add this script to a toolbox I then set the parameters for the Classification, X and Y in the properties (Classifcation=string, XY are set to double) I can run this with hard coded values via IDLE and it works fine as seen below Next: Seeing that the script works in IDLE I publish a GP Service from the process I just ran to my ArcGIS Server. I can run the GP Service from our ArcGIS Server and it runs fine. Finally: I then reference this from AppStudio and attempt to run it with hard coded values as seen below 1. I can get it to run and create a new point THIS WORKS 2. BUT the XY coordinates I feed it don't appear where they should. If I use the EXACT same ones that I use in the script below they don't show up in the same place as the points added . The data in SDE is WGS 84 decimal degrees. MY ISSUE: If I hard code the XY in the script and run from IDLE it works fine If I add the exact same Coordinates from the GP Service that I published in ArcGIS Service it works fine If I hard code the exact same Coordinates as seen below in AppStudio it puts the points at roughly (-78, 39) I dont see where and how to coordinates I am submitting in the job are being converted from (-77.43153, 37.527056) to (-78, 39) Funny thing is if I export the data and calculate XY for the points the ones done through AppStudio are truncated and have no Sig Figs, while the points added in the Service and Script via IDLE have sig figs. Very confused. Seems the sig figs are being dropped but then again the XY corrds are goin from 77 to 78 and 37 to 39? I know this is a lot to digest but figure someone might have seen this before? import arcpy
from arcpy import env
import os
#varXCoord = arcpy.GetParameterAsText(4)
#varYCoord = arcpy.GetParameterAsText(5)
#varClassification = arcpy.GetParameterAsText(6)
varClassification = "New Classification"
varYCoord = "37.527056"
varXCoord = "-77.43153"
fc = 'xE.DBO.xxx'
workspace = arcpy.env.workspace = r'C:\Users\x\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\[email protected]'
## Start an edit session. Must provide the workspace.
edit = arcpy.da.Editor(workspace)
edit.startEditing(False, False)
## Start an edit operation
edit.startOperation()
row_values = [( varXCoord ,varYCoord, varClassification)]
print(row_values)
cursor = arcpy.da.InsertCursor(fc,['SHAPE@X', 'SHAPE@Y', 'Classification'])
for row in row_values:
cursor.insertRow(row)
del cursor
## Stop the edit operation.
edit.stopOperation()
## Stop the edit session and save the changes
edit.stopEditing(True) GeoprocessingTask {
id: insertCursorTask
url: "https://xxx.xx.xxxx.xx/arcgis/rest/services/xxx/InsertCursor/GPServer/InsertCursor/submitJob"
function insertFunction() {
var varClassification = "New Classification";
var xlocation = -77.43153;
var ylocation = 37.527056;
var gpParametersInsert = ArcGISRuntimeEnvironment.createObject("GeoprocessingParameters",
{executionType: Enums.GeoprocessingExecutionTypeSynchronousExecute});
var inputsI = {};
inputsI["classification"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: varClassification});
inputsI["SHAPE@X"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: xlocation });
inputsI["SHAPE@Y"] = ArcGISRuntimeEnvironment.createObject("GeoprocessingString", {value: ylocation });
//var inputresults = inputs;
gpParametersInsert.inputs = inputsI;
// Create the job that handles the communication between the application and the geoprocessing task
insertCursorJob = insertCursorTask.createJob(gpParametersInsert);
console.log("gp job: " + JSON.stringify(insertCursorJob));
insertCursorJob.start();
}
... View more
10-03-2019
08:04 AM
|
0
|
33
|
9198
|
|
POST
|
Anyone have any ideas on this? Can I change an already loaded TPK with another one.
... View more
10-03-2019
06:58 AM
|
0
|
0
|
1245
|
|
POST
|
can I change a loaded TPK file? Is it possible? I know I can change a MMPK file or mobile map....can I do this with a TPK file?????
... View more
09-30-2019
08:00 PM
|
0
|
0
|
1245
|
|
POST
|
I finally found this....just need to find a way to pass the center point to this code and think I can work from there.... THANK YOU for all your help Keith....it is very appreciated!!!!!!! Cheers Format coordinates | ArcGIS for Developers
... View more
09-26-2019
04:56 AM
|
0
|
0
|
793
|
|
POST
|
I can convert the Web Aux Sphere to Lat Long like this
Anyone know how I can convert to UTM Zone 17N NAD83??????
var centercoord = CoordinateFormatter.toLatitudeLongitude(mapView.currentViewpointCenter.center, Enums.LatitudeLongitudeFormatDecimalDegrees, 6)
... View more
09-25-2019
11:36 AM
|
0
|
1
|
793
|
|
POST
|
On my button I can do this...But need to figure out how to convert to UTM Zone 17N NAD83 Even if I reference a spatial reference in the map....it still spits out Web Aux Sphere spatialReference: SpatialReference { wkid:26917 }
var centercoord7 = mapView.currentViewpointCenter.center.x
console.log("centercoord7 : " + centercoord7);
var centercoord8 = mapView.currentViewpointCenter.center.y
console.log("centercoord8 : " + centercoord8); I tried this but not putting it into UTM Zone 17N Nad83 var centercoord2 = CoordinateFormatter.toUtm(mapView.currentViewpointCenter.center, Enums.UtmConversionModeNorthSouthIndicators, 10);
... View more
09-25-2019
11:07 AM
|
0
|
2
|
793
|
|
POST
|
OK I am returning accurate XY locations with the above.....Although I am returning them in Web Aux Sphere.... I tried to change the Spatial reference of the map but I am grabbing the center from the MapView and I cannot set the spatial reference in the MapView....ahahahah uuuuuggggggggg I guess I just need to convert from Web Aux Sphere to UTM then on the fly somehow....I thought the setting of the spatial reference in the map would do that but I guess not Any thoughts? MapView{
id: mapView
onVisibleAreaChanged: {
var center = visibleArea.extent.center;
var test4 = visibleArea.extent.center.x;
console.log(test4);
var test5 = visibleArea.extent.center.y;
console.log(test5);
}
Map{
id: map
spatialReference: SpatialReference { wkid:26917 }
// SNIP
... View more
09-25-2019
10:29 AM
|
0
|
3
|
3515
|
|
POST
|
Think I might have gotten it with : var test5 = visibleArea.extent.center.x;
var test6 = visibleArea.extent.center.y; Testing
... View more
09-25-2019
09:57 AM
|
0
|
4
|
3515
|
|
POST
|
All I get on this is : console.log(center); qml: QmlPoint(0x208cec665c0) And If I try and return JSON I get an error and it blows up I need to get the X and Y Value somehow onVisibleAreaChanged: {
let center = visibleArea.extent.center;
// Display center point
console.log(JSON.stringify(center));
}
... View more
09-25-2019
09:44 AM
|
0
|
0
|
3515
|
|
POST
|
Just started this QML stuff....all of that right over my head....any help or examples you can give would be most appreciated....if not I will keep looking thanks for your thoughts... I have to leave things dynamic so the map expands to various phones, tables etc... We are talking about getting the XY location on the map itself right.... -76.564654, 37.545345
... View more
09-25-2019
08:27 AM
|
0
|
7
|
3515
|
|
POST
|
I put the below in OnClick of a button: let center = MapView.mapToGlobal(Qt.point(MapView.width / 2, MapView.height / 2));
let mapCenter = MapView.screenToLocation(center.x, center.y);
console.log("mapCenter: " + mapCenter); I get this error: .qml:3420: TypeError: Property 'mapToGlobal' of object [object Object] is not a function Do I need to import something at the top of the QML
... View more
09-25-2019
07:55 AM
|
0
|
9
|
3515
|
|
POST
|
If I set my spatial reference to: Map{
id: map
spatialReference: SpatialReference { wkid:2150 } All I want to do is click a button and have it display the center of map coordinates in UTM Zone 17N Nad83 Cant figure out how to do that
... View more
09-25-2019
06:36 AM
|
0
|
11
|
3515
|
| 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
|