Select to view content in your preferred language

Polyline midpoint

4334
2
02-05-2013 11:57 AM
Chula_VistaGIS
Occasional Contributor
Using the rest api, I need to return a polyline feature and find the midpoint of the line.  It does not appear the api currently has any methods to return centroid or midpoints. 

Does anyone have any thoughts on this ?

Thanks,
Bob
0 Kudos
2 Replies
nicogis
MVP Alum
if it isn't available via rest or api js you can: create soe (in ao use QueryPoint  for example) or gp or do it client side (see for example http://stackoverflow.com/questions/8542835/polyline-label-positioning-algorithm )
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You can also calculate the mid point at client side, see this LinearReferencing sample using the Silverlight/WPF API (midpoint is a particular case that you can get by: var midPoint = line.LinearPosition(line.Length()/2); )
0 Kudos