This project has moved and is read-only. For the latest updates, please go here.

How add more than a pair of coordinates to a kml file

Jul 8, 2013 at 9:17 PM
Edited Jul 8, 2013 at 9:20 PM
So far, all the examples I saw contains only a pair of coordinates per point
i.e
     <Point>
      <altitudeMode>relativeToGround</altitudeMode>
      <coordinates>
        -74.11081,40.72714,50
      </coordinates>
    </Point>
Does anyone knows how can I generate the following example using sharpkml?
     <Point>
      <altitudeMode>relativeToGround</altitudeMode>
      <coordinates>
        -74.11081,40.72714,50 -74.11081,40.72714,50 -74.11075,40.72725,50
      </coordinates>
    </Point>
Thank you
Jul 8, 2013 at 9:48 PM
A point can only have a single tuple for the coordinate, so you will need to pick a different shape.

If you want multiple points then unfortunately you will need to create multiple point objects (though you can use the Clone extension method in the SharpKml.Engine namespace to make things slightly easier).

If you want a path/polyline then you could use a LineString or for a filled shape a Polygon.

Sam
Jul 8, 2013 at 10:38 PM
Sam,
Thank you I think I'll go with the LineString since it allows a CoordinatesCollection. Any suggestions?

Thank you