AnsweredAssumed Answered

How create .cal file with KmlDocument ?

Question asked by jerembzh56 on Sep 15, 2020
Latest reply on Sep 15, 2020 by jerembzh56

Hi,

How can I convert a KmlDocument created with SketchEditor to a .cal file?

I try to close on the document but I don't have all the informations.

 

 

foreach (Object objChildNodes in mKmlDocument.ChildNodes)
{
   if (objChildNodes is KmlPlacemark)
   {
      KmlPlacemark pl = (KmlPlacemark)objChildNodes;
      Console.WriteLine("type"); // I have type : Polygon, Polyline (only)
      Console.WriteLine(pl.GraphicType.ToString());

 

 

   foreach (Object obj in pl.Geometries)
   {
      if(obj is KmlGeometry)
      {
          KmlGeometry kGeo = (KmlGeometry)obj;
          Console.WriteLine("-- Geometrie");
          Console.WriteLine(kGeo.Geometry.SpatialReference.ToJson());
          Console.WriteLine(((KmlGeometry)obj).Geometry.ToJson());

          Console.WriteLine("Type");
          Console.WriteLine(kGeo.Type.ToString());
      }
   }

}

I don't have Style in KmlDocument, the same in KmlPlaceMark. Yet I do have line thickness and color on the SketchEditor.

Another thing.
I drew a rectangle. If I display the geometry in the console. It shows me the polygon or polyline type, but never rectangle, circle, etc...

 

 

thanks

Outcomes