Select to view content in your preferred language

How to discover just vertices/turning points of a polygon or polyline?

653
3
05-20-2010 06:00 AM
AvronPolakow
Occasional Contributor
Is there any available algorithm for calculating just the vertices in a polygon graphic, or of simplifying the polygon, in code in the XAML?

Also of finding the turning points of a polyline.
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
You can get the individual points by iterating the pointcollections in the Rings property.

foreach(PointCollection pnts in myPolygon.Rings) {
foreach(MapPoint p in pnts) { ... }
}
0 Kudos
AvronPolakow
Occasional Contributor
That's what I have in my app. but there many redundant points, eg in the US states with straight borders.
Is there any way to simplify these?
0 Kudos
dotMorten_esri
Esri Notable Contributor
You can use the Simplify method in the ArcGIS v10 geometry service: http://help.arcgis.com/en/webapi/silverlight/apiref/topic1572.html
0 Kudos