how to capture and list individual verteces from Display capture geometry
I need to capture the individual coordinates from a user entered poine line or polygon from the "display capture geometry" workflow function. I would like to display the list of coordinates in an alert or a listbox. does anyone have a workflow example or can tell me the basic steps to do this?
-
Basically...
1. You have a Geometry as the output of the DisplayCaptureGeometry task. You'll need to find out what type of Geometry this is and proceed accordingly. Use a 'Switch<T>' construction, and choose 'String' for the type.
2. As the Expression use geometry.GetType.ToString. Now you will have three cases: ESRI.ArcGIS.Client.Geometry.Polygon, ESRI.ArcGIS.Client.Geometry.Polyline, and ESRI.ArcGIS.Client.Geometry.MapPont. Each one needs to be handled differently as the X,Y point locations are stored in different places.
3. The polygon has an attribute 'Rings' which consists of a collection of PointCollections. Each PointCollection then consists of MapPoints, which have X Y values as attributes. The reason for this structure is so you can have multipart polygons. You'll need to iterate through the collection of collections, and then through each collection to gather all the point values.
4. Polylines are essentially the same, except the attribute which contains the collection of PointCollections is called 'Paths'
5. MapPoints are much easier. You have the X Y values stored in mapPoint.X and mapPoint.Y
See here for some more detailed information on the structure of the ESRI Geometry classses:
Hope this helps.
0 -
Ok, here's a working example. Just remove the .txt from the end and you should be good to go.
(https://support.geocortex.com/Data/Sites/1/workflows/geometrypoints.xaml.txt) /Data/Sites/1/workflows/geometrypoints.xaml.txt
0 -
Jonathan--
Many THANKS!!!! That's exactly what I needed to do.
What other sample workflows do you have you could post somewhere?
Jeff
0 -
+1 on that!!!
0 -
Hey Jonathan Bystedt,
I am pretty much new to this workflow stuff. I was looking for an working example of how Display capture geometry works.
/Data/Sites/1/workflows/geometrypoints.xaml.txt
The link above provided is not working anymore. Could you please provide me a working link. I would like to use it thanks.
0
Please sign in to leave a comment.
Comments
5 comments