Areas and Lengths Task
What is the process to use a workflow to select polygons using a query and display their calculated area in an alert message?
I have set up the query task, but I am confused about the proper use of the Areas and Lengths task. The help materials explain that this tool can be used to calculate the area of features selected in a query task, but there seems to be no input for a feature set, just a graphic. Also the results variable that is output is an "AreaAndLengths" type, which I'm not sure how to extract a string to display in an alert message. Any suggestions?
-
I've been able to run the "Areas and Lengths" task in my workflow, however I do not know how to use the output to display that information in a message.
I first extract geometry by using the "Get Geometries" task, which I then iterate through using a "For Each" command. After, I use the geometry to run the "Buffer" task, and generate a "Graphics" variable. That "Graphics variable is then used to run the "Areas and Lengths" task, but I am not sure how to use the output to display in a message. Any suggestions?0 -
Hi Andrew! You can use the output of the query task directly in the "Areas And Lenghts" activity. The "Feature Set" that is the output of the query task contains a property call "features" which a list of Graphics (which is what you need). So, in the graphics property of the "Areas And Lenghts" activity you can do MyFeatureSet1.features . Regarding getting the values out of the returned variable, this vairable is of type "ESRI.ArcGIs.Client.Tasks.AreasAndLenghts". You can see the properties and methods of that on the ESRI API: http://help.arcgis.com/en/webapi/wpf/apiref/api_start.htm It basically has two properties: "Areas" and "Lengths". They are both a List of numbers: MyALVariable.Areas and MyALVariable.Lengths You can iterate through those using a for each and extract the values directly (it's a list of numbers). I would also recommend enabling "Intellisense" on the workflow designer (edit -> Enable Intellisense) this will help you a lot when trying to know the properties and methods available on a variable. Hope it helps, -Alejandro 0 -
Thanks! Once I started looking at the properties of these variables everything quickly fell into place. I appreciate the response.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare