Export Polyline to KMl

Discussion created by jbalaguera on Nov 25, 2013
I am trying to export a polyline to KML and I haven't found a way of doing it. I would like to know if it is not possible to do it directly, how to convert a polyline to a layer so I can use ESRI.ArcGIS.ConversionTools.LayerToKML. I created the polyline with the following code

  public void Contour(object data, int color, int bReDraw)
                IPointCollection polylineCol = new Polyline();
                float[] arr = (float[])data;
                IPoint pt;
                for (int i = 0; i < arr.Length - 1; i++)
                    pt = new ESRI.ArcGIS.Geometry.Point();
                    pt.Y = arr[i++];
                    pt.X = arr[i];
                    polylineCol.AddPoints(1, ref pt);