/// <summary> /// Gets an array of <see cref="System.Double"/> ordinate values /// </summary> /// <param name="ordinate">The ordinate index</param> /// <returns>An array of ordinate values</returns> public override double[] GetOrdinates(Ordinate ordinate) { if (IsEmpty) { return(new double[0]); } var ordinateFlag = OrdinatesUtility.ToOrdinatesFlag(ordinate); if ((_shell.CoordinateSequence.Ordinates & ordinateFlag) != ordinateFlag) { return(CreateArray(NumPoints, Coordinate.NullOrdinate)); } var result = new double[NumPoints]; var ordinates = _shell.GetOrdinates(ordinate); Array.Copy(ordinates, 0, result, 0, ordinates.Length); var offset = ordinates.Length; foreach (var linearRing in _holes) { ordinates = linearRing.GetOrdinates(ordinate); Array.Copy(ordinates, 0, result, offset, ordinates.Length); offset += ordinates.Length; } return(result); }
public override double[] GetOrdinates(Ordinate ordinate) { if (IsEmpty) { return(new double[0]); } var ordinateFlag = OrdinatesUtility.ToOrdinatesFlag(ordinate); if ((_points.Ordinates & ordinateFlag) != ordinateFlag) { return(CreateArray(_points.Count, Coordinate.NullOrdinate)); } return(CreateArray(_points, ordinate)); }
public override double[] GetOrdinates(Ordinate ordinate) { if (IsEmpty) { return(new double[0]); } var ordinateFlag = OrdinatesUtility.ToOrdinatesFlag(ordinate); if ((_coordinates.Ordinates & ordinateFlag) != ordinateFlag) { return new[] { Coordinate.NullOrdinate } } ; return(new [] { _coordinates.GetOrdinate(0, ordinate) }); }
private static bool HasOrdinate(ICoordinateSequence seq, Ordinate ordinate) { return((seq.Ordinates & OrdinatesUtility.ToOrdinatesFlag(new[] { ordinate })) != Ordinates.None); }