Exemplo n.º 1
0
 public ShadowConvertContext(IDataConvertAppService dataConvertAppService, string mainId, string outputCoordName)
     : base(dataConvertAppService, mainId)
 {
     this._outputCoordName = outputCoordName;
 }
Exemplo n.º 2
0
        public static ConvertResult CoordinateConvert(IEnumerable <ConvertFileList> files, IList <string> errorInfo, IDataConvertAppService dataConvertAppService)
        {
            List <ConvertFileList> CCFileList = new List <ConvertFileList>();

            foreach (var f in files)
            {
                if (f.ConvertResult == 0)
                {
                    errorInfo.Add("格式转换失败: " + f.ConvertMsg + "  文件:" + f.LogicFileName);
                    return(null);
                }

                FileInfo fi = new FileInfo(f.PhysicsFilePath);

                ConvertFileList cf = new ConvertFileList();
                cf.ID              = Guid.NewGuid().ToString();
                cf.LogicFileName   = fi.Name;
                cf.PhysicsFilePath = f.ConvertFilePath + ".shp";
                cf.ConvertResult   = 0;
                cf.ConvertFilePath = fi.DirectoryName;
                cf.ConvertMsg      = "";
                cf.SrcCoordName    = "";
                cf.FileType        = (int)DataFileType.CoordinateConvert;

                CCFileList.Add(cf);
            }
            return(dataConvertAppService.DataConvert(CCFileList, "", "Xian 1980", false));
        }
Exemplo n.º 3
0
        public static ConvertResult ProjectionConvert(IEnumerable <ConvertFileList> files, IList <string> errorInfo, IDataConvertAppService dataConvertAppService, string OutputCoordName = "")
        {
            List <ConvertFileList> PFileList = new List <ConvertFileList>();

            foreach (var f in files)
            {
                FileInfo fi = new FileInfo(f.ConvertFilePath);

                ConvertFileList cf = new ConvertFileList();
                cf.ID              = Guid.NewGuid().ToString();
                cf.LogicFileName   = fi.Name;
                cf.PhysicsFilePath = f.ConvertFilePath;
                cf.ConvertResult   = 0;
                cf.ConvertFilePath = fi.DirectoryName;
                cf.ConvertMsg      = "";
                cf.FileType        = (int)DataFileType.Projection;

                PFileList.Add(cf);
            }
            return(dataConvertAppService.DataConvert(PFileList, "", OutputCoordName, false));
        }
Exemplo n.º 4
0
        public static ConvertResult FormatConvert(IEnumerable <ConvertFileList> files, IList <string> errorInfo, IDataConvertAppService dataConvertAppService)
        {
            //TODO:这里后面可能要考虑shp文件。如果是的话直接返回一个结果
            List <ConvertFileList> FCFileList = new List <ConvertFileList>();

            foreach (var s in files)
            {
                FileInfo fi = new FileInfo(s.PhysicsFilePath);
                if (fi.Extension.ToUpper() == ".WP" || fi.Extension.ToUpper() == ".WL" || fi.Extension.ToUpper() == ".WT")
                {
                    ConvertFileList cf = new ConvertFileList();
                    cf.ID              = Guid.NewGuid().ToString();
                    cf.LogicFileName   = fi.Name;
                    cf.PhysicsFilePath = s.PhysicsFilePath;
                    cf.ConvertResult   = 0;
                    cf.ConvertFilePath = "";
                    cf.ConvertMsg      = "";
                    cf.SrcCoordName    = "";
                    cf.FileType        = (int)DataFileType.FormatConvert;

                    FCFileList.Add(cf);
                }
            }
            if (FCFileList.Count <= 0)
            {
                if (!files.Any(p => p.PhysicsFilePath.ToLower().Contains(".shp")))
                {
                    errorInfo.Add("格式转换:未找到图层文件");
                    return(null);
                }

                return(new ConvertResult
                {
                    fileList = files.Where(p => !p.PhysicsFilePath.ToLower().Contains(".zip") && !p.PhysicsFilePath.ToLower().Contains(".rar")).ToList()
                });
            }
            return(dataConvertAppService.DataConvert(FCFileList, "", "", false));
        }
Exemplo n.º 5
0
 public BaseConvertContext(IDataConvertAppService dataConvertAppService, string mainId)
 {
     this._dataConvertAppService = dataConvertAppService;
     this._mainId = mainId;
 }
Exemplo n.º 6
0
 public CoordinateConvertContext(IDataConvertAppService dataConvertAppService, string mainId, string coordPoint)
     : base(dataConvertAppService, mainId)
 {
     this._coordPoint = coordPoint ?? "";
 }
Exemplo n.º 7
0
 public FormatConvertContext(IDataConvertAppService dataConvertAppService, string mainId, string outputFormat)
     : base(dataConvertAppService, mainId)
 {
     this._outputFormat = outputFormat;
 }
Exemplo n.º 8
0
 public UploadLayerContext(IDataConvertAppService dataConvertAppService)
 {
     this._dataConvertAppService = dataConvertAppService;
 }