public static Terradue.GeoJson.Gml.DirectPositionListType GeometryToGml(IPosition[] positions) { if (positions.Length > 0 && positions[0] is GeographicPosition) { Terradue.GeoJson.Gml.DirectPositionListType gmlPosList = new Terradue.GeoJson.Gml.DirectPositionListType(); gmlPosList.count = positions.Length.ToString(); gmlPosList.Text = string.Join(" ", positions.Cast<GeographicPosition>().Select<GeographicPosition, string>(p => string.Format("{0} {1}{2}", p.Latitude, p.Longitude, p.Altitude == null ? "" : " " + p.Altitude))); gmlPosList.srsDimension = ((GeographicPosition)positions[0]).Altitude == null ? "2" : "3"; return gmlPosList; } return null; }