Example #1
0
        private void Go()
        {
            ShapeReader sr = new ShapeReader();
            DbfReader   dr = new DbfReader();

            dr.SetPath(input_path_);

            for (int i = 0; i < shp_file_list_.Count; ++i)
            {
                EventControl.Instance().SendEvent(new ProgressLabelEventArgs(null, "LB_PROG", "Reading Shape\n" + file_list_[i] + ".shp"));

                /*
                 * List<Polygon> polygon_list = sr.ReadShapeFile(shp_file_list_[i], shx_file_list_[i]);
                 * List<Point> point_list = GetPoint(polygon_list);
                 */


                //List<Point> point_list = sr.ReadPointShapeFile(shp_file_list_[i], shx_file_list_[i]);

                List <Point> point_list = sr.ReadPointShapeFile(shp_file_list_[i], shx_file_list_[i]);
                //polygon_list.Clear();

                dr.SetFile(dbf_file_list_[i]);

                Dictionary <String, List <Point> > point_data = new Dictionary <string, List <Point> >();
                Dictionary <String, DataTable>     dbf_data   = new Dictionary <string, DataTable>();

                EventControl.Instance().SendEvent(new ProgressLabelEventArgs(null, "LB_PROG", "Read Dbf\n" + file_list_[i] + ".dbf"));
                DataTable     build_info = dr.GetData();
                List <String> addr       = GetPartialData(point_list, build_info, ref dbf_data, ref point_data);

                foreach (String file_name in addr)
                {
                    WriteDbf(dbf_data[file_name], file_name + ".dbf");
                    WriteShp(point_data[file_name], file_name);
                }

                //EventControl.Instance().SendEvent(new ProgressLabelEventArgs(null, "LB_PROG", "Read Dbf\n" + file_list_[i] + ".dbf"));
                //EventControl.Instance().SendEvent(new ProgressEventArgs(null, "PB_OPER", 0, 1));
                //DataTable build_info = dr.GetData();

                //DataTable extract_info = build_info.Clone();
                //List<Point> extract_point = new List<Point>();

                //ExtractInfo(ref extract_point, ref extract_info, point_list, build_info);
                //point_list.Clear();
                //build_info.Clear();

                //EventControl.Instance().SendEvent(new ProgressLabelEventArgs(null, "LB_PROG", "Write to DB"));

                //WriteDbf(extract_info, i);
                //WriteShp(extract_point, i);

                //WriteShp(point_list, i);

                //extract_info.Clear();
                //extract_point.Clear();

                EventControl.Instance().SendEvent(new ProgressLabelEventArgs(null, "LB_PROG", "Complete"));

                Finished(null, null);
            }
        }
 private void ShapeRead()
 {
     ShapeReader    dl = new ShapeReader();
     List <Polygon> p  = dl.ReadShapeFile("D:\\00_Work\\96_SUPPORT\\Data\\161013\\AL_43_D010_20161001");
 }