Exemple #1
0
        public DataSourceOtherMap(string path, bool isOnline)
        {
            IS_ONLINE        = isOnline;
            ConvertingStatus = new ConvertStatus();
            TilingScheme ts;

            try
            {
                ReadTilingScheme(out ts);
            }
            catch (Exception e)
            {
                throw new Exception("Reading tiling shceme failed!\r\n" + e.Message + "\r\n" + e.StackTrace);
            }
            TilingScheme = ts;
            string _mapName = "OtherMap";

            _baseUrl = SchemaProvider.Inst.GetDownloadUrl(_mapName, null, null);
            if (!IS_ONLINE)
            {
                _sqlConn = new SQLiteConnection("Data Source=" + path);
                _sqlConn.Open();
            }
            this.Type = DataSourceTypePredefined.OtherMap.ToString();
        }
Exemple #2
0
 public DataSourceArcGISCache(string path)
 {
     if (!Directory.Exists(path + "\\_alllayers"))
     {
         throw new Exception("_alllayers directory does not exist!");
     }
     Initialize(path);
     ConvertingStatus = new ConvertStatus();
 }
Exemple #3
0
 public DataSourceAdjustCoord(string inputFile, string outputFile)
 {
     ConvertingStatus = new ConvertStatus();
     _sourceFile      = inputFile;
     _outputFile      = outputFile;
     _sourceConn      = new SQLiteConnection("Data Source=" + inputFile);
     _sourceConn.Open();
     ConvertingStatus = new ConvertStatus();
 }
Exemple #4
0
        public DataSourceAdjustCoord(string path)
        {
            ConvertingStatus = new ConvertStatus();
            _sourceFile      = path;
            int    lastPointIndex = path.LastIndexOf(".");
            string pre            = path.Substring(0, lastPointIndex);
            string post           = path.Substring(lastPointIndex, path.Length - lastPointIndex);

            _outputFile = pre + "_CC" + post;
            _sourceConn = new SQLiteConnection("Data Source=" + path);
            _sourceConn.Open();
            ConvertingStatus = new ConvertStatus();
        }
 /// <summary>
 /// when isForConvert==true, gettile() method will return null instead of returning an error image byte[]
 /// </summary>
 /// <param name="name"></param>
 public DataSourceCustomOnlineMaps(string name)
 {
     _mapName = name;
     Initialize("N/A");
     if (ConfigManager.App_AllowFileCacheOfOnlineMaps)
     {
         //init local cache file if does not exist.
         string localCacheFileName = ConfigManager.App_FileCachePath + "\\" + _mapName.Trim().ToLower() + ".cache";
         ValidateLocalCacheFile(localCacheFileName);
         TileLoaded += new EventHandler <TileLoadEventArgs>(InternalOnTileLoaded);
     }
     ConvertingStatus = new ConvertStatus();
 }
Exemple #6
0
        public DataSourceArcGISCacheV2(string path)
        {
            if (!Directory.Exists(path + "\\_alllayers"))
            {
                throw new Exception("_alllayers directory does not exist!");
            }
            var level0files = Directory.GetFiles(path + "\\_alllayers\\L00");
            var fileCount   = level0files.Where(file => file.Contains(".bundlx")).Count();

            if (fileCount > 0)
            {
                throw new Exception("此ArcGIS缓存为低版本,请选择另外的类型!");
            }

            Initialize(path);
            ConvertingStatus = new ConvertStatus();
        }