Esempio n. 1
0
        /// <summary>
        /// 获取Tile的范围四至
        /// </summary>
        /// <returns></returns>
        public LngLatBbox GetBbox()
        {
            var cellSize = new CellSize();
            var cell     = cellSize.GetCellSizeInDegree(Level);
            var L        = new LngLatSegments(this.Corner.Lng.Code >> (32 - Level) << (32 - Level), true);
            var B        = new LngLatSegments(this.Corner.Lat.Code >> (32 - Level) << (32 - Level), false);
            var bbox     = new LngLatBbox();

            if (L.G == 1)
            {
                bbox.East = L.Degree;
                bbox.West = bbox.East - cell;
            }
            else
            {
                bbox.West = L.Degree;
                bbox.East = bbox.West + cell;
            }
            if (B.G == 1)
            {
                bbox.North = B.Degree;
                bbox.South = bbox.North - cell;
            }
            else
            {
                bbox.South = B.Degree;
                bbox.North = bbox.South + cell;
            }
            return(bbox);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取Tile的范围四至
        /// </summary>
        /// <returns></returns>
        public LngLatBbox GetBbox()
        {
            var cellSize = new CellSize();
            var cell     = cellSize.GetCellSizeInDegree(Level);

            var trtile = new Tile(this.Level, this.X + 1, this.Y + 1);
            var bbox   = new LngLatBbox
            {
                West  = Math.Min(this.CornerLng, trtile.CornerLng),
                South = Math.Min(this.CornerLat, trtile.CornerLat),
                East  = Math.Max(this.CornerLng, trtile.CornerLng),
                North = Math.Max(this.CornerLat, trtile.CornerLat),
            };

            return(bbox);
        }