//----------------------------------------------------------------------------- /// <summary> /// Function to return polygons from a polygon file with empty lines as null. /// </summary> /// <param name="prmFile">Polygon file</param> /// <param name="prmSeparator">Separator</param> /// <param name="prmIsXYInverted">True if the sequence is X, Y and False otherwise</param> /// <returns>List of polygons</returns> static private List <TcPolygon> GetPolygons(String prmFile, Char prmSeparator, Double prmBuffer, Boolean prmIsXYInverted) { IEnumerable <TcPoint> allPoints = GetPointsFromPolygonFileWithNull(prmFile, prmSeparator, prmIsXYInverted); List <TcPolygon> polygons = new List <TcPolygon>(); List <TcPoint> points = new List <TcPoint>(); foreach (TcPoint point in allPoints) { if (point == null && points.Count > 0) { TcPolygon poly = new TcPolygon(points); poly.AddOffset(prmBuffer); polygons.Add(poly); points.Clear(); } else if (point != null) { points.Add(point); } } if (points.Count > 0) { polygons.Add(new TcPolygon(points)); } return(polygons); }
//----------------------------------------------------------------------------- public void ExportPolygon(IEnumerable <String> prmFiles, TcPolygon prmPolygon, String prmOutputFile) { // Function to update the list of tiles to be processed. UpdateCommonHeader(prmFiles); // Process a set of blocks to be processed for the given tiles. ProcessBlockSets(prmFiles, new TcPolygon(prmPolygon.Points, Buffer), prmOutputFile); ReportFinished(); }