示例#1
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;
 }
示例#2
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");
 }
        /// <summary>
        /// 获得重采样类型
        /// </summary>
        /// <returns></returns>
        private rstResamplingTypes GetResampleTpe(string str)
        {
            rstResamplingTypes resampleType = rstResamplingTypes.RSP_NearestNeighbor;

            switch (str)
            {
            case "邻近法":
                resampleType = rstResamplingTypes.RSP_NearestNeighbor;
                break;

            case "双线性内插法":
                resampleType = rstResamplingTypes.RSP_BilinearInterpolation;
                break;

            case "立方卷积法":
                resampleType = rstResamplingTypes.RSP_CubicConvolution;
                break;
            }
            return(resampleType);
        }
示例#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;
            }
        }
示例#5
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;
            }
        }
示例#6
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;
 }
示例#7
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");
 }