public void LineWrite(VectorFeature feat, double[] fractionalpt, double distance) { // Get the row and col of the cell we're looking for int[] rowcol = OpExtent.Pt2RowCol(fractionalpt); int fid = (int)feat.Feat.GetFID(); List <string> csvRows = new List <string>(); double finalDist = Math.Round(distance, _spacingDecimals); // Now we write a line to the file List <string> csvcols = new List <string>(); foreach (ECols item in header) { switch (item) { case (ECols.FID): csvcols.Add(fid.ToString(CultureInfo.InvariantCulture)); break; case (ECols.X): csvcols.Add((fractionalpt[0]).ToString(CultureInfo.InvariantCulture)); break; case (ECols.Y): csvcols.Add((fractionalpt[1]).ToString(CultureInfo.InvariantCulture)); break; case (ECols.DISTANCE): if (!String.IsNullOrEmpty(sFieldName)) { csvcols.Add(feat.GetFieldAsDouble(sFieldName).ToString(CultureInfo.InvariantCulture)); } break; case (ECols.STATION): csvcols.Add((finalDist).ToString(CultureInfo.InvariantCulture)); break; } } for (int did = 0; did < _inputRasters.Count; did++) { if (rowcol[1] > 0 && rowcol[1] < _inputRasters[did].Extent.Cols && rowcol[0] > 0 && rowcol[0] < _inputRasters[did].Extent.Rows) { T[] _buffer = new T[1]; _inputRasters[did].Read(rowcol[1], rowcol[0], 1, 1, _buffer); if (_buffer[0].Equals(inNodataVals[did])) { csvcols.Add(""); } else { csvcols.Add(DynamicMath.invariantString(_buffer[0])); } } else { csvcols.Add(""); } } csvRows.Add(String.Join(",", csvcols)); WriteLinesToCSV(csvRows); }
/// <summary> /// Let's test that changing the op extent works /// </summary> /// <param name="buff"></param> public void BuffOpExtent(int buff) { SetOpExtent(OpExtent.Buffer(buff)); testChunkExtent(); }