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