/// <summary>
        /// 获得压缩类型
        /// </summary>
        /// <returns></returns>
        private esriRasterCompressionType GetCompression(string str)
        {
            esriRasterCompressionType compressionType = esriRasterCompressionType.esriRasterCompressionLZ77;

            switch (str)
            {
            case "LZ77":
                compressionType = esriRasterCompressionType.esriRasterCompressionLZ77;
                break;

            case "JPEG":
                compressionType = esriRasterCompressionType.esriRasterCompressionJPEG;
                break;

            case "JPEG2000":
                compressionType = esriRasterCompressionType.esriRasterCompressionJPEG2000;
                break;

            case "PackBits":
                compressionType = esriRasterCompressionType.esriRasterCompressionPackBits;
                break;

            case "LZW":
                compressionType = esriRasterCompressionType.esriRasterCompressionLZW;
                break;
            }
            return(compressionType);
        }
Example #2
0
 public StorageDef(StorageDef prototype) : base(prototype)
 {
     this._compressionQuality  = prototype.CompressionQuality;
     this._compressionType     = prototype.CompressionType;
     this._pyramidLevel        = prototype.PyramidLevel;
     this._pyramidResampleType = prototype.PyramidResampleType;
     this._tiled      = prototype.Tiled;
     this._tileHeight = prototype.TileHeight;
     this._tileWidth  = prototype.TileWidth;
     this._origin     = (Point)prototype.Origin.Clone();
     this._cellSizeX  = prototype.CellSizeX;
     this._cellSizeY  = prototype.CellSizeY;
 }
Example #3
0
 public StorageDef(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this._compressionQuality  = info.GetInt32("compressionQuality");
     this._compressionType     = (esriRasterCompressionType)Enum.Parse(typeof(esriRasterCompressionType), info.GetString("compressionType"), true);
     this._pyramidLevel        = info.GetInt32("pyramidLevel");
     this._pyramidResampleType = (rstResamplingTypes)Enum.Parse(typeof(rstResamplingTypes), info.GetString("pyramidResampleType"), true);
     this._tiled      = info.GetBoolean("tiled");
     this._tileHeight = info.GetInt32("tileHeight");
     this._tileWidth  = info.GetInt32("tileWidth");
     this._origin     = (Point)info.GetValue("origin", typeof(Point));
     this._cellSizeX  = info.GetDouble("cellSizeX");
     this._cellSizeY  = info.GetDouble("cellSizeY");
 }
Example #4
0
        public StorageDef(IXPathNavigable path) : base(path)
        {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <CompressionQuality></CompressionQuality>
            XPathNavigator navigatorCompressionQuality = navigator.SelectSingleNode("CompressionQuality");

            if (navigatorCompressionQuality != null)
            {
                this._compressionQuality = navigatorCompressionQuality.ValueAsInt;
            }

            // <CompressionType></CompressionType>
            XPathNavigator navigatorCompressionType = navigator.SelectSingleNode("CompressionType");

            if (navigatorCompressionType != null)
            {
                this._compressionType = (esriRasterCompressionType)Enum.Parse(typeof(esriRasterCompressionType), navigatorCompressionType.Value, true);
            }

            // <PyramidLevel></PyramidLevel>
            XPathNavigator navigatorPyramidLevel = navigator.SelectSingleNode("PyramidLevel");

            if (navigatorPyramidLevel != null)
            {
                this._pyramidLevel = navigatorPyramidLevel.ValueAsInt;
            }

            // <PyramidResampleType></PyramidResampleType>
            XPathNavigator navigatorPyramidResampleType = navigator.SelectSingleNode("PyramidResampleType");

            if (navigatorPyramidResampleType != null)
            {
                this._pyramidResampleType = (rstResamplingTypes)Enum.Parse(typeof(rstResamplingTypes), navigatorPyramidResampleType.Value, true);
            }

            // <Tiled></Tiled>
            XPathNavigator navigatorTiled = navigator.SelectSingleNode("Tiled");

            if (navigatorTiled != null)
            {
                this._tiled = navigatorTiled.ValueAsBoolean;
            }

            // <TileHeight></TileHeight>
            XPathNavigator navigatorTileHeight = navigator.SelectSingleNode("TileHeight");

            if (navigatorTileHeight != null)
            {
                this._tileHeight = navigatorTileHeight.ValueAsInt;
            }

            // <TileWidth></TileWidth>
            XPathNavigator navigatorTileWidth = navigator.SelectSingleNode("TileWidth");

            if (navigatorTileWidth != null)
            {
                this._tileWidth = navigatorTileWidth.ValueAsInt;
            }

            // <Origin></Origin>
            XPathNavigator navigatorOrigin = navigator.SelectSingleNode("Origin");

            if (navigatorOrigin != null)
            {
                this._origin = new Point(navigatorOrigin);
            }
            else
            {
                this._origin   = new Point();
                this._origin.X = -1d;
                this._origin.Y = -1d;
            }

            // <CellSizeX></CellSizeX>
            XPathNavigator navigatorCellSizeX = navigator.SelectSingleNode("CellSizeX");

            if (navigatorCellSizeX != null)
            {
                this._cellSizeX = navigatorCellSizeX.ValueAsDouble;
            }
            else
            {
                this._cellSizeX = -1d;
            }

            // <CellSizeY></CellSizeY>
            XPathNavigator navigatorCellSizeY = navigator.SelectSingleNode("CellSizeY");

            if (navigatorCellSizeY != null)
            {
                this._cellSizeY = navigatorCellSizeY.ValueAsDouble;
            }
            else
            {
                this._cellSizeY = -1d;
            }
        }
        public StorageDef(IXPathNavigable path): base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <CompressionQuality></CompressionQuality>
            XPathNavigator navigatorCompressionQuality = navigator.SelectSingleNode("CompressionQuality");
            if (navigatorCompressionQuality != null) {
                this._compressionQuality = navigatorCompressionQuality.ValueAsInt;
            }

            // <CompressionType></CompressionType>
            XPathNavigator navigatorCompressionType = navigator.SelectSingleNode("CompressionType");
            if (navigatorCompressionType != null) {
                this._compressionType = (esriRasterCompressionType)Enum.Parse(typeof(esriRasterCompressionType), navigatorCompressionType.Value, true);
            }

            // <PyramidLevel></PyramidLevel>
            XPathNavigator navigatorPyramidLevel = navigator.SelectSingleNode("PyramidLevel");
            if (navigatorPyramidLevel != null) {
                this._pyramidLevel = navigatorPyramidLevel.ValueAsInt;
            }

            // <PyramidResampleType></PyramidResampleType>
            XPathNavigator navigatorPyramidResampleType = navigator.SelectSingleNode("PyramidResampleType");
            if (navigatorPyramidResampleType != null) {
                this._pyramidResampleType = (rstResamplingTypes)Enum.Parse(typeof(rstResamplingTypes), navigatorPyramidResampleType.Value, true);
            }

            // <Tiled></Tiled>
            XPathNavigator navigatorTiled = navigator.SelectSingleNode("Tiled");
            if (navigatorTiled != null) {
                this._tiled = navigatorTiled.ValueAsBoolean;
            }

            // <TileHeight></TileHeight>
            XPathNavigator navigatorTileHeight = navigator.SelectSingleNode("TileHeight");
            if (navigatorTileHeight != null) {
                this._tileHeight = navigatorTileHeight.ValueAsInt;
            }

            // <TileWidth></TileWidth>
            XPathNavigator navigatorTileWidth = navigator.SelectSingleNode("TileWidth");
            if (navigatorTileWidth != null) {
                this._tileWidth = navigatorTileWidth.ValueAsInt;
            }

            // <Origin></Origin>
            XPathNavigator navigatorOrigin = navigator.SelectSingleNode("Origin");
            if (navigatorOrigin != null) {
                this._origin = new Point(navigatorOrigin);
            }
            else {
                this._origin = new Point();
                this._origin.X = -1d;
                this._origin.Y = -1d;
            }

            // <CellSizeX></CellSizeX>
            XPathNavigator navigatorCellSizeX = navigator.SelectSingleNode("CellSizeX");
            if (navigatorCellSizeX != null) {
                this._cellSizeX = navigatorCellSizeX.ValueAsDouble;
            }
            else {
                this._cellSizeX = -1d;
            }

            // <CellSizeY></CellSizeY>
            XPathNavigator navigatorCellSizeY = navigator.SelectSingleNode("CellSizeY");
            if (navigatorCellSizeY != null) {
                this._cellSizeY = navigatorCellSizeY.ValueAsDouble;
            }
            else {
                this._cellSizeY = -1d;
            }
        }
 public StorageDef(StorageDef prototype) : base(prototype) {
     this._compressionQuality = prototype.CompressionQuality;
     this._compressionType = prototype.CompressionType;
     this._pyramidLevel = prototype.PyramidLevel;
     this._pyramidResampleType = prototype.PyramidResampleType;
     this._tiled = prototype.Tiled;
     this._tileHeight = prototype.TileHeight;
     this._tileWidth = prototype.TileWidth;
     this._origin = (Point)prototype.Origin.Clone();
     this._cellSizeX = prototype.CellSizeX;
     this._cellSizeY = prototype.CellSizeY;
 }
 public StorageDef(SerializationInfo info, StreamingContext context) : base(info, context) {
     this._compressionQuality = info.GetInt32("compressionQuality");
     this._compressionType = (esriRasterCompressionType)Enum.Parse(typeof(esriRasterCompressionType), info.GetString("compressionType"), true);
     this._pyramidLevel = info.GetInt32("pyramidLevel");
     this._pyramidResampleType = (rstResamplingTypes)Enum.Parse(typeof(rstResamplingTypes), info.GetString("pyramidResampleType"), true);
     this._tiled = info.GetBoolean("tiled");
     this._tileHeight = info.GetInt32("tileHeight");
     this._tileWidth = info.GetInt32("tileWidth");
     this._origin = (Point)info.GetValue("origin", typeof(Point));
     this._cellSizeX = info.GetDouble("cellSizeX");
     this._cellSizeY = info.GetDouble("cellSizeY");
 }