コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ShapefileDataWriter"/> class.
        /// </summary>
        /// <param name="fileName">File path without any extension</param>
        /// <param name="geometryFactory"></param>
        public ShapefileDataWriter(string fileName, GeometryFactory geometryFactory)
        {
            this.geometryFactory = geometryFactory;

            // Files
            shpFile = fileName;
            dbfFile = fileName + ".dbf";

            // Writers
            shapeWriter = new ShapefileWriter(geometryFactory);
            dbaseWriter = new DbaseFileWriter(dbfFile);
        }
コード例 #2
0
        /// <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();
        }