Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / provider / TiledRasterProvider.java @ 871

History | View | Annotate | Download (3 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.raster.impl.provider;
23

    
24
import java.awt.geom.Point2D;
25

    
26
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
27
import org.gvsig.raster.cache.tile.Tile;
28
import org.gvsig.raster.cache.tile.exception.TileGettingException;
29
import org.gvsig.raster.cache.tile.provider.CacheStruct;
30

    
31
/**
32
 * Interface that should be implemented by tiled providers 
33
 * @author Nacho Brodin (nachobrodin@gmail.com)
34
 *
35
 */
36
public interface TiledRasterProvider {
37
        /**
38
         * Calculates the extent of a zoom level using other extent as a reference. The new extent is 
39
         * calculated with the same coordinate at the center. 
40
         * @param level
41
         * @param extent
42
         * @param w
43
         * @param h
44
         * @return
45
         */
46
        public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h);
47
        
48
        /**
49
         * Calculates the extent of a zoom level using a center. 
50
         * @param viewCenter
51
         * @param level
52
         * @param w
53
         * @param h
54
         * @return
55
         */
56
        public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h);
57
        
58
        /**
59
         * Gets the number of zoom levels
60
         * @return
61
         */
62
        public int getZoomLevels();
63
        
64
        /**
65
         * Gets the nearest level to the selected pixel size
66
         * @param pixelSize
67
         * @return
68
         */
69
        public int getNearestLevel(double pixelSize);
70
        
71
        /**
72
         * Gets a tile
73
         * @param level
74
         *        Resolution level
75
         * @param tileCol
76
         *        Tile column in the resolution level
77
         * @param tileRow
78
         *        Tile row in the resolution level
79
         * @param bbox
80
         *        Bounding box of the tile
81
         * @return
82
         * @throws TileGettingException
83
         */
84
        public Tile getTile(int level, int tileCol, int tileRow, Extent ex, CacheStruct cacheStruct) throws TileGettingException;
85
        
86
        /**
87
         * Sets the tile cache data server. This is the server assigned by the client. 
88
         * It will force to build a second level cache if the CacheStruct is not the same
89
         * as the owner. 
90
         * @param tileServer
91
         */
92
        public void setTileServer(Class<?> tileServer);
93
        
94
        /**
95
         * Returns the tile size in pixels if this providers have tiles
96
         * @return
97
         */
98
        public int[] getTileSize(int level);
99
        
100
        /**
101
         * Gets the internal provider used to feed the TileProvider
102
         * @return
103
         */
104
        public RasterProvider getInternalProvider();
105
}