How create .cal file with KmlDocument ?

522
2
09-15-2020 03:08 AM
CavronJeremy
New Contributor III

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

0 Kudos
2 Replies
CavronJeremy
New Contributor III

May be don't use Kml format and use directly GraphicsOverlay for extract informations.

0 Kudos
CavronJeremy
New Contributor III

I find. I wasn't making any sense. To extract directly. You have to go to Graphics of SketchOverlay

0 Kudos