Exemple #1
0
        private bool Init()
        {
            if (!System.IO.Directory.Exists(_folder))
            {
                _errors.Add(string.Format("路径:\"{0}\"不存在,请核对目录路径", _folder));
                return(false);
            }
            _files = FileManager.GetSpecialFiles(_folder, "*.txt");
            if (_files.Count == 0)
            {
                _errors.Add(string.Format("路径:\"{0}\"下不存在txt文件", _folder));
                return(false);
            }
            _files = _files.OrderBy(e => e).ToList();

            _featureClass = FeatureClassManager.CreateFeatrueClass(_saveFilePath, SpatialReferenceManager.Get40SpatialReference(), ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon);
            if (_featureClass == null)
            {
                _errors.Add("创建要素类失败!");
                return(false);
            }
            _featureClass.AddFields(new List <Models.TangField> {
                new Models.TangField {
                    Name = "FILENAME", Alias = "文件名称", Type = esriFieldType.esriFieldTypeString
                }
            });
            _featureCursor = _featureClass.Insert(true);
            return(true);
        }
 private bool Init()
 {
     if (!Directory.Exists(_folder))
     {
         _message += string.Format("目录:\"{0}\"不存在,请核对目录!", _folder);
         return(false);
     }
     _txtFiles = FileManager.GetSpecialFiles(_folder, "*.txt");
     if (string.IsNullOrEmpty(_saveFilePath) || System.IO.File.Exists(_saveFilePath))
     {
         _message += string.Format("保存路径:\"{0}\"不正确或者已存在文件,请核对保存路径!", _saveFilePath);
         return(false);
     }
     _featureClass = FeatureClassManager.CreateFeatrueClass(_saveFilePath, SpatialReferenceManager.Get40SpatialReference(), ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon);
     if (_featureClass == null)
     {
         _message += string.Format("创建要素类失败!");
         return(false);
     }
     _featureClass.AddFields(new List <TangField> {
         new TangField {
             Name = "XMLX", Alias = "项目类型", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "BZ", Alias = "备注", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "NF", Alias = "年份", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "FILENAME", Alias = "文件名字", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKBH", Alias = "地块编号", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKMC", Alias = "地块名称", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "JLTXSX", Alias = "JLTXSX", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "TFH", Alias = "TFH", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKYT", Alias = "地块用途", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DLBM", Alias = "地类编码", Type = esriFieldType.esriFieldTypeString
         }
     });
     _featureCursor = FeatureClass.Insert(true);
     return(true);
 }
 private bool Init()
 {
     if (!System.IO.File.Exists(_txtFilePath))
     {
         _errors.Add(string.Format("路径:\"{0}\"文件不存在,请核对文件!", _txtFilePath));
         return(false);
     }
     if (System.IO.File.Exists(_saveFilePath))
     {
         System.IO.File.Delete(_saveFilePath);
     }
     _featureClass = FeatureClassManager.CreateFeatrueClass(_saveFilePath, SpatialReferenceManager.Get40SpatialReference(), ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon);
     if (_featureClass == null)
     {
         _errors.Add("创建要素类失败!");
         return(false);
     }
     _featureClass.AddFields(new List <Models.TangField> {
         new TangField {
             Name = "XMLX", Alias = "项目类型", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "BZ", Alias = "备注", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "NF", Alias = "年份", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "FILENAME", Alias = "文件名字", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKBH", Alias = "地块编号", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKMC", Alias = "地块名称", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "JLTXSX", Alias = "JLTXSX", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "TFH", Alias = "TFH", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DKYT", Alias = "地块用途", Type = esriFieldType.esriFieldTypeString
         },
         new TangField {
             Name = "DLBM", Alias = "地类编码", Type = esriFieldType.esriFieldTypeString
         }
     });
     _featureCursor = _featureClass.Insert(true);
     return(true);
 }
Exemple #4
0
        private bool Init()
        {
            if (!System.IO.File.Exists(_txtFilePath))
            {
                _errors.Add(string.Format("路径:\"{0}\"文件不存在,请核对!", _txtFilePath));
                return(false);
            }

            if (System.IO.File.Exists(_saveFilePath))
            {
                System.IO.File.Delete(_saveFilePath);
            }
            _featureClass = FeatureClassManager.CreateFeatrueClass(_saveFilePath, SpatialReferenceManager.Get40SpatialReference(), ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon);
            if (_featureClass == null)
            {
                _errors.Add("创建要素类失败");
                return(false);
            }
            _featureCursor = _featureClass.Insert(true);
            return(true);
        }