/// <summary>
        /// Writes the specified feature collection.
        /// </summary>
        /// <param name="featureCollection">The feature collection.</param>
        public virtual void Write(IList featureCollection)
        {
            // Test if the Header is initialized
            if (Header == null)
            {
                throw new ApplicationException("Header must be set first!");
            }

            // Test if all elements of the collections are features
            foreach (object obj in featureCollection)
            {
                if (obj.GetType() != typeof(Feature))
                {
                    throw new ArgumentException("All the elements in the given collection must be " + typeof(Feature).Name);
                }
            }

            try
            {
                // Write shp and shx
                Geometry[] geometries = new Geometry[featureCollection.Count];
                int        index      = 0;
                foreach (Feature feature in featureCollection)
                {
                    geometries[index++] = feature.Geometry;
                }
                shapeWriter.Write(shpFile, new GeometryCollection(geometries, geometryFactory));

                // Write dbf
                dbaseWriter.Write(Header);
                foreach (Feature feature in featureCollection)
                {
                    IAttributesTable attribs = feature.Attributes;
                    ArrayList        values  = new ArrayList();
                    for (int i = 0; i < Header.NumFields; i++)
                    {
                        values.Add(attribs[Header.Fields[i].Name]);
                    }
                    dbaseWriter.Write(values);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            finally
            {
                // Close dbf writer
                dbaseWriter.Close();
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="recordCount"></param>
        public static void WriteDummyDbf(string filename, int recordCount)
        {
            DbaseFileHeader dbfHeader = new DbaseFileHeader();

            dbfHeader.AddColumn("Description", 'C', 20, 0);

            DbaseFileWriter dbfWriter = new DbaseFileWriter(filename);

            dbfWriter.Write(dbfHeader);
            for (int i = 0; i < recordCount; i++)
            {
                ArrayList columnValues = new ArrayList();
                columnValues.Add((double)i);
                dbfWriter.Write(columnValues);
            }
            dbfWriter.Close();
        }