Curve Example - C#

The following shows a C# example that returns a Curve object.


public static Curve buildCurve()
{
    Curve curve = new Curve();
    curve.srsName = "EPSG:4326";
    //set the lineString.
    LineString[] lineString = new LineString[1];
    lineString[0] = new LineString();
    lineString[0].srsName = "EPSG:4326";

    Pos[] Pos = new Pos[3];
    Pos[0] = new Pos();
    Pos[0].X = -45.33;
    Pos[0].Y = 75.66;

    //add the viaPoint
    Pos[1] = new Pos();
    Pos[1].X = -46.33;
    Pos[1].Y = 77.66;

    //add the end Point.
    Pos[2] = new Pos();
    Pos[2].X = -49.33;
    Pos[2].Y = 78.66;
    lineString[0].Pos = Pos;
    curve.LineString = lineString;

    return curve;
}