Revision 952
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/downloader/WMSTileServer.java | ||
---|---|---|
95 | 95 |
TileCacheLibrary.DEFAULT_TILEWIDTH, |
96 | 96 |
TileCacheLibrary.DEFAULT_TILEHEIGHT, |
97 | 97 |
provider.getURIOfFirstProvider(), |
98 |
provider.getParameters().getLayerQuery(), |
|
98 | 99 |
TileCacheLibrary.DEFAULT_STRUCTURE, |
99 | 100 |
RasterLibrary.pathTileCache, |
100 | 101 |
getFileSuffix(), |
org.gvsig.raster.gdal/trunk/org.gvsig.raster.gdal/org.gvsig.raster.gdal.io/src/main/java/org/gvsig/raster/gdal/io/GdalProvider.java | ||
---|---|---|
44 | 44 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
45 | 45 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
46 | 46 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
47 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters; |
|
48 | 47 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
49 | 48 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
50 | 49 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
... | ... | |
233 | 232 |
public void init (AbstractRasterDataParameters params, |
234 | 233 |
DataStoreProviderServices storeServices) throws NotSupportedExtensionException { |
235 | 234 |
try { |
236 |
if(((RasterFileStoreParameters)params).getFile().exists()) { |
|
237 |
setParam(storeServices, params); |
|
238 |
validRmf(params.getURI()); |
|
239 |
file = new GdalNative(translateFileName(params.getURI())); |
|
240 |
setColorInterpretation(file.colorInterpr); |
|
241 |
setColorTable(file.palette); |
|
242 |
noData = file.getNoDataValue(); |
|
243 |
wktProjection = file.getProjectionRef(); |
|
244 |
//CrsWkt crs = new CrsWkt(wktProjection); |
|
245 |
//IProjection proj = CRSFactory.getCRS("EPSG:23030"); |
|
246 |
ownTransformation = file.getOwnTransformation(); |
|
247 |
externalTransformation = (AffineTransform)ownTransformation.clone(); |
|
248 |
load(); |
|
249 |
} else |
|
250 |
setParam(storeServices, params); |
|
235 |
setParam(storeServices, params); |
|
236 |
validRmf(params.getURI()); |
|
237 |
file = new GdalNative(translateFileName(params.getURI())); |
|
238 |
setColorInterpretation(file.colorInterpr); |
|
239 |
setColorTable(file.palette); |
|
240 |
noData = file.getNoDataValue(); |
|
241 |
wktProjection = file.getProjectionRef(); |
|
242 |
//CrsWkt crs = new CrsWkt(wktProjection); |
|
243 |
//IProjection proj = CRSFactory.getCRS("EPSG:23030"); |
|
244 |
ownTransformation = file.getOwnTransformation(); |
|
245 |
externalTransformation = (AffineTransform)ownTransformation.clone(); |
|
246 |
load(); |
|
247 |
|
|
251 | 248 |
if(file != null) |
252 | 249 |
bandCount = file.getRasterCount(); |
253 | 250 |
} catch (GdalException e) { |
org.gvsig.raster.wmts/trunk/org.gvsig.raster.wmts/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/downloader/WMTSCacheStruct.java | ||
---|---|---|
58 | 58 |
this.tileMatrixSet = tileMatrixSetLink.getTileMatrixSet(); |
59 | 59 |
this.tileMatrixSetLimits = tileMatrixSetLink.getTileMatrixLimits(); |
60 | 60 |
pixelSize = provider.getPixelSizeByLevel(); |
61 |
layerName = provider.getURIOfFirstProvider();
|
|
62 |
serverURL = ((WMTSDataParameters)provider.getDataParameters()).getURI();
|
|
61 |
serverURL = provider.getURIOfFirstProvider();
|
|
62 |
layerName = ((WMTSDataParameters)provider.getDataParameters()).getLayer().getTitle();
|
|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
/* |
org.gvsig.raster.wcs/trunk/org.gvsig.raster.wcs/org.gvsig.raster.wcs.io/src/main/java/org/gvsig/raster/wcs/io/downloader/WCSTileServer.java | ||
---|---|---|
96 | 96 |
TileCacheLibrary.DEFAULT_TILEWIDTH, |
97 | 97 |
TileCacheLibrary.DEFAULT_TILEHEIGHT, |
98 | 98 |
provider.getURIOfFirstProvider(), |
99 |
provider.getParameters().getCoverageName(), |
|
99 | 100 |
TileCacheLibrary.DEFAULT_STRUCTURE, |
100 | 101 |
RasterLibrary.pathTileCache, |
101 | 102 |
getFileSuffix(), |
org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/tile/TileCacheManager.java | ||
---|---|---|
82 | 82 |
* @param pixelSize Pixel size of the layer |
83 | 83 |
* @param tilePxWidth Width in pixels of a tile |
84 | 84 |
* @param tilePxHeight Height in pixels of a tile |
85 |
* @param uri server URL |
|
85 | 86 |
* @param layerName Layer name or identifier |
86 | 87 |
* @param strategy Strategy to store tiles in disk |
87 | 88 |
* @param baseDir path to this layer |
... | ... | |
95 | 96 |
double pixelSize, |
96 | 97 |
int tilePxWidth, |
97 | 98 |
int tilePxHeight, |
99 |
String uri, |
|
98 | 100 |
String layerName, |
99 | 101 |
String strategy, |
100 | 102 |
String baseDir, |
101 | 103 |
String fileSuffix, |
102 | 104 |
String epsg, |
103 | 105 |
long fileSize); |
106 |
|
|
107 |
/** |
|
108 |
* Builds a standard cache structure for local files |
|
109 |
* @param typeOfCoords Constant defined in CacheStruct interface |
|
110 |
* @param levels Number of levels |
|
111 |
* @param layerExtent Bounding box of the layer |
|
112 |
* @param pixelSize Pixel size of the layer |
|
113 |
* @param tilePxWidth Width in pixels of a tile |
|
114 |
* @param tilePxHeight Height in pixels of a tile |
|
115 |
* @param layerName Layer name or identifier |
|
116 |
* @param strategy Strategy to store tiles in disk |
|
117 |
* @param baseDir path to this layer |
|
118 |
* @param fileSuffix File suffix |
|
119 |
* @param epsg |
|
120 |
* @return |
|
121 |
*/ |
|
122 |
public CacheStruct createCacheStructure(int typeOfCoords, |
|
123 |
int levels, |
|
124 |
Rectangle2D layerExtent, |
|
125 |
double pixelSize, |
|
126 |
int tilePxWidth, |
|
127 |
int tilePxHeight, |
|
128 |
String layerName, |
|
129 |
String strategy, |
|
130 |
String baseDir, |
|
131 |
String fileSuffix, |
|
132 |
String epsg, |
|
133 |
long fileSize); |
|
104 | 134 |
} |
org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.impl/src/main/java/org/gvsig/raster/cache/tile/impl/DefaultTileCacheManager.java | ||
---|---|---|
69 | 69 |
return new TileImpl(level, col, row); |
70 | 70 |
} |
71 | 71 |
|
72 |
|
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* @see org.gvsig.raster.cache.tile.TileCacheManager#createTile(int, int, int, int, java.awt.geom.Point2D, java.awt.geom.Point2D) |
|
75 |
*/ |
|
73 | 76 |
public Tile createTile(int wPx, int hPx, int row, int col, Point2D ul, Point2D lr) { |
74 | 77 |
return new TileImpl(wPx, hPx, row, col, ul, lr); |
75 | 78 |
} |
76 | 79 |
|
77 | 80 |
/* |
78 | 81 |
* (non-Javadoc) |
79 |
* @see org.gvsig.raster.cache.tile.TileCacheManager#createCacheStructure(int, int, java.awt.geom.Rectangle2D, double, int, int, java.lang.String, java.lang.String, org.gvsig.raster.cache.tile.disk.ITileFileSystemStrategy, java.lang.String)
|
|
82 |
* @see org.gvsig.raster.cache.tile.TileCacheManager#createCacheStructure(int, int, java.awt.geom.Rectangle2D, double, int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long)
|
|
80 | 83 |
*/ |
81 | 84 |
public CacheStruct createCacheStructure(int typeOfCoords, |
82 | 85 |
int levels, |
... | ... | |
84 | 87 |
double pixelSize, |
85 | 88 |
int tilePxWidth, |
86 | 89 |
int tilePxHeight, |
90 |
String uri, |
|
87 | 91 |
String layerName, |
88 | 92 |
String strategy, |
89 | 93 |
String baseDir, |
... | ... | |
95 | 99 |
layerExtent, |
96 | 100 |
pixelSize, |
97 | 101 |
tilePxWidth, |
98 |
tilePxHeight, |
|
102 |
tilePxHeight, |
|
103 |
uri, |
|
99 | 104 |
layerName, |
100 | 105 |
createStrategy(strategy), |
101 | 106 |
baseDir, |
... | ... | |
104 | 109 |
size ); |
105 | 110 |
} |
106 | 111 |
|
112 |
/* |
|
113 |
* (non-Javadoc) |
|
114 |
* @see org.gvsig.raster.cache.tile.TileCacheManager#createCacheStructure(int, int, java.awt.geom.Rectangle2D, double, int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long) |
|
115 |
*/ |
|
116 |
public CacheStruct createCacheStructure(int typeOfCoords, |
|
117 |
int levels, |
|
118 |
Rectangle2D layerExtent, |
|
119 |
double pixelSize, |
|
120 |
int tilePxWidth, |
|
121 |
int tilePxHeight, |
|
122 |
String layerName, |
|
123 |
String strategy, |
|
124 |
String baseDir, |
|
125 |
String fileSuffix, |
|
126 |
String epsg, |
|
127 |
long size) { |
|
128 |
return new DefaultCacheStruct(typeOfCoords, |
|
129 |
levels, |
|
130 |
layerExtent, |
|
131 |
pixelSize, |
|
132 |
tilePxWidth, |
|
133 |
tilePxHeight, |
|
134 |
layerName, |
|
135 |
layerName, |
|
136 |
createStrategy(strategy), |
|
137 |
baseDir, |
|
138 |
fileSuffix, |
|
139 |
epsg, |
|
140 |
size ); |
|
141 |
} |
|
142 |
|
|
107 | 143 |
/** |
108 | 144 |
* Creates a strategy object |
109 | 145 |
* @param strategy |
org.gvsig.raster.cache/trunk/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.impl/src/main/java/org/gvsig/raster/cache/tile/impl/provider/DefaultCacheStruct.java | ||
---|---|---|
40 | 40 |
private TileMatrixSet tileMatrixSet = null; |
41 | 41 |
private ArrayList<TileMatrixLimits> limits = null; |
42 | 42 |
private String layerName = null; |
43 |
private String uri = null; |
|
43 | 44 |
private Rectangle2D worldExtent = null; |
44 | 45 |
private String fileSuffix = null; |
45 | 46 |
private String epsg = null; |
... | ... | |
53 | 54 |
double pixelSize, |
54 | 55 |
int tilePxWidth, |
55 | 56 |
int tilePxHeight, |
57 |
String uri, |
|
56 | 58 |
String layerName, |
57 | 59 |
ITileFileSystemStrategy strategy, |
58 | 60 |
String baseDir, |
59 | 61 |
String fileSuffix, |
60 | 62 |
String epsg, |
61 | 63 |
long size) { |
64 |
this.uri = uri; |
|
62 | 65 |
this.layerName = layerName; |
63 | 66 |
this.fileSuffix = fileSuffix; |
64 | 67 |
this.fileSize = size; |
... | ... | |
180 | 183 |
* @see org.gvsig.raster.cache.tile.provider.CacheStruct#getServerURL() |
181 | 184 |
*/ |
182 | 185 |
public String getServerURL() { |
183 |
return layerName;
|
|
186 |
return uri;
|
|
184 | 187 |
} |
185 | 188 |
|
186 | 189 |
/* |
Also available in: Unified diff