POST
|
Hi Amber, Sorry for the misunderstanding. The script can be used to copy geometry and attribute values from one feature class to another provided it handles the any field mappings for attributes within the script. The 'featset' input variable gets its value from the feature that has been clicked on (regardless of which feature class it is part of - so long as geometry types match). The Featset then gives access to attributes and geometry so you can copy them to the output feature. Hope that helps, Gordon
... View more
12-14-2018
09:39 AM
|
1
|
1
|
1053
|
POST
|
Hi Amber, The script shared above in my earlier reply is the same as my original except with attribute names replaced and server names taken out. I can't share the original unfortunately. Is there a specific bit you're having trouble with? Gordon
... View more
12-11-2018
09:00 AM
|
0
|
8
|
1400
|
POST
|
Hi Ahna, Sure, here is a cut down version which shows what my script does in simple terms. It should work for features in the same feature class. It includes the edits made ('esri added') when the tool is published. import sys, os, arcpy
# Esri start of added variables
g_ESRI_variable_1 = os.path.join(arcpy.env.packageWorkspace,u'\\\\<server>\\arcgissystem\\arcgisinput\\<tool>.GPServer\\extracted\\v101\\<connection>.sde')
# Esri end of added variables
#input variables
featSet = arcpy.GetParameter(0) #feature selected within app to be copied
Attribute1 = sys.argv[2] #user entered attribute value if needed
OutputWS = g_ESRI_variable_1
OutputFeatures = os.path.join(OutputWS, "<OUtput Feature Class>")
sr = arcpy.SpatialReference(27700) #spatial ref for geometry
sc = arcpy.SearchCursor(featSet,"",sr,"","")
rowIn = sc.next() # this script assumes only a single feature is being copied
#write the feature to the output
rowsOut = arcpy.InsertCursor(OutputFeatures)
rowOut = rowsOut.newRow()
#Copy geometry
rowOut.setValue("SHAPE", rowIn.getValue("SHAPE"))
#Copy attributes
rowOut.setValue("ATTRIBUTE", rowIn.getValue("ATTRIBUTE"))
#User entered attributes for new feature if needed
rowOut.setValue("ATTRIBUTE1", Attribute1)
rowsOut.insertRow(rowOut)
del rowsOut
del sc
... View more
09-08-2017
06:50 AM
|
2
|
11
|
1400
|
POST
|
We have the same need and we have come up with a workaround using the GeoProcessing widget. Create a GP tool (based on a python script) which takes a user selected polygon feature as input and copies the feature to another feature class (in our case the feature class is in an enterprise GDB underpinning another WFS in the same webapp). Publish the GP tool and set up the GeoProcessing widget within the webapp. Within WAB (at v2.4 - not sure about earlier versions) when you click a polygon feature and then click the three dots at the bottom right of the pop-up you get a menu option to set it as the input to the GeoProcessing widget task. It's not pretty but it works for us internally. Not sure if it would be as easy in ArcGIS Online. You can handle the attributes copying over in the Python script or having the user enter them in the widget dialogue. I agree that a simple copy-paste of a feature/geometry (like you can do in Desktop) is highly desirable!
... View more
08-30-2017
10:21 AM
|
2
|
13
|
1400
|
Title | Kudos | Posted |
---|---|---|
1 | 12-14-2018 09:39 AM | |
2 | 08-30-2017 10:21 AM | |
2 | 09-08-2017 06:50 AM |
Online Status |
Offline
|
Date Last Visited |
02-29-2024
08:45 AM
|