gvsig-raster / org.gvsig.raster.wms / trunk / org.gvsig.raster.wms / org.gvsig.raster.wms.io / src / main / java / org / gvsig / raster / wms / io / WMSProvider.java @ 453
History | View | Annotate | Download (33.9 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.wms.io; |
23 |
|
24 |
import java.awt.geom.AffineTransform; |
25 |
import java.awt.geom.NoninvertibleTransformException; |
26 |
import java.awt.geom.Point2D; |
27 |
import java.awt.geom.Rectangle2D; |
28 |
import java.io.File; |
29 |
import java.io.IOException; |
30 |
import java.net.URL; |
31 |
import java.util.Hashtable; |
32 |
import java.util.Vector; |
33 |
|
34 |
import org.gvsig.compat.net.ICancellable; |
35 |
import org.gvsig.fmap.dal.DALLocator; |
36 |
import org.gvsig.fmap.dal.DataStore; |
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
38 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
39 |
import org.gvsig.fmap.dal.coverage.dataset.io.gdal.GdalProvider; |
40 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
41 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
42 |
import org.gvsig.fmap.dal.coverage.exception.BandAccessException; |
43 |
import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException; |
44 |
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException; |
45 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
46 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
47 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
48 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
49 |
import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException; |
50 |
import org.gvsig.fmap.dal.coverage.explorer.WMSServerExplorer; |
51 |
import org.gvsig.fmap.dal.coverage.store.parameter.WMSDataParameters; |
52 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
53 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
54 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
55 |
import org.gvsig.metadata.MetadataLocator; |
56 |
import org.gvsig.raster.cache.tile.TileCacheLocator; |
57 |
import org.gvsig.raster.cache.tile.TileCacheManager; |
58 |
import org.gvsig.raster.cache.tile.exception.TileGettingException; |
59 |
import org.gvsig.raster.cache.tile.provider.TileListener; |
60 |
import org.gvsig.raster.cache.tile.provider.TileServer; |
61 |
import org.gvsig.raster.impl.DefaultRasterManager; |
62 |
import org.gvsig.raster.impl.datastruct.BandListImpl; |
63 |
import org.gvsig.raster.impl.datastruct.DatasetBandImpl; |
64 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
65 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
66 |
import org.gvsig.raster.impl.provider.RasterProvider; |
67 |
import org.gvsig.raster.impl.provider.RemoteRasterProvider; |
68 |
import org.gvsig.raster.impl.store.AbstractRasterDataStore; |
69 |
import org.gvsig.raster.impl.store.DefaultStoreFactory; |
70 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation; |
71 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency; |
72 |
import org.gvsig.remoteclient.utils.Utilities; |
73 |
import org.gvsig.remoteclient.wms.WMSStatus; |
74 |
import org.gvsig.tools.ToolsLocator; |
75 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
76 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
77 |
/**
|
78 |
* Clase que representa al driver de acceso a datos de wms.
|
79 |
*
|
80 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
81 |
*/
|
82 |
public class WMSProvider extends DefaultRasterProvider implements RemoteRasterProvider { |
83 |
public static String NAME = "Wms Store"; |
84 |
public static String DESCRIPTION = "Wms Raster file"; |
85 |
public static final String METADATA_DEFINITION_NAME = "WmsStore"; |
86 |
private static final int FIXED_SIZE = 800; |
87 |
|
88 |
private Extent viewRequest = null; |
89 |
private static Hashtable<URL, WMSConnector> |
90 |
drivers = new Hashtable<URL, WMSConnector> (); |
91 |
private boolean open = false; |
92 |
private DataStoreTransparency fileTransparency = null; |
93 |
private final int minTilePrintWidth = 12; |
94 |
private final int minTilePrintHeight = 12; |
95 |
//The out size depends on the last request
|
96 |
private int lastWidthRequest = 0; |
97 |
private int lastHeightRequest = 0; |
98 |
private Rectangle2D lastExtent = null; |
99 |
//Only for fixed size. Complete extent and FIXED_SIZE in long side
|
100 |
private File fileLayerPixelSize = null; |
101 |
private File lastRequest = null; |
102 |
|
103 |
public static void register() { |
104 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
105 |
ExtensionPoint point = extensionPoints.get("RasterReader");
|
106 |
point.append("wms", "", WMSProvider.class); |
107 |
|
108 |
DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager(); |
109 |
if (dataman != null && !dataman.getStoreProviders().contains(NAME)) { |
110 |
dataman.registerStoreProvider(NAME, |
111 |
WMSProvider.class, WMSDataParametersImpl.class); |
112 |
} |
113 |
|
114 |
if (!dataman.getExplorerProviders().contains(WMSServerExplorerImpl.NAME)) {
|
115 |
dataman.registerExplorerProvider(WMSServerExplorer.NAME, WMSServerExplorerImpl.class, DefaultWMSServerExplorerParameters.class); |
116 |
} |
117 |
dataman.registerStoreFactory(NAME, DefaultStoreFactory.class); |
118 |
} |
119 |
|
120 |
public WMSProvider() throws NotSupportedExtensionException { |
121 |
super();
|
122 |
} |
123 |
|
124 |
/**
|
125 |
* Constructor. Abre el dataset.
|
126 |
* @param proj Proyecci?n
|
127 |
* @param fName Nombre del fichero
|
128 |
* @throws NotSupportedExtensionException
|
129 |
*/
|
130 |
public WMSProvider(String params) throws NotSupportedExtensionException { |
131 |
super(params);
|
132 |
if(params instanceof String) { |
133 |
WMSDataParametersImpl p = new WMSDataParametersImpl();
|
134 |
p.setHost((String)params);
|
135 |
super.init(p, null, ToolsLocator.getDynObjectManager() |
136 |
.createDynObject( |
137 |
MetadataLocator.getMetadataManager().getDefinition( |
138 |
DataStore.METADATA_DEFINITION_NAME))); |
139 |
init(p, null);
|
140 |
} |
141 |
} |
142 |
|
143 |
public WMSProvider(WMSDataParametersImpl params,
|
144 |
AbstractRasterDataStore storeServices) throws NotSupportedExtensionException {
|
145 |
super(params, storeServices, ToolsLocator.getDynObjectManager()
|
146 |
.createDynObject( |
147 |
MetadataLocator.getMetadataManager().getDefinition( |
148 |
DataStore.METADATA_DEFINITION_NAME))); |
149 |
init(params, storeServices); |
150 |
} |
151 |
|
152 |
/**
|
153 |
* Gets the connector from the URL
|
154 |
* @return
|
155 |
* @throws RemoteServiceException
|
156 |
*/
|
157 |
private WMSConnector getConnector() throws RemoteServiceException { |
158 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
159 |
URL url = null; |
160 |
try {
|
161 |
url = new URL(p.getHost()); |
162 |
} catch (Exception e) { |
163 |
throw new RemoteServiceException("Malformed URL",e); |
164 |
} |
165 |
try {
|
166 |
return WMSProvider.getConnectorFromURL(url);
|
167 |
} catch (IOException e) { |
168 |
throw new RemoteServiceException("Error getting the connector",e); |
169 |
} |
170 |
} |
171 |
|
172 |
/**
|
173 |
* Crea las referencias al fichero y carga
|
174 |
* las estructuras con la informaci?n y los metadatos.
|
175 |
* @param proj Proyecci?n
|
176 |
* @param param Parametros de carga
|
177 |
* @throws NotSupportedExtensionException
|
178 |
*/
|
179 |
public void init (DataStoreParameters params, |
180 |
DataStoreProviderServices storeServices) throws NotSupportedExtensionException {
|
181 |
setParam(params); |
182 |
setDataType(new int[]{Buffer.TYPE_BYTE, Buffer.TYPE_BYTE, Buffer.TYPE_BYTE}); |
183 |
bandCount = 3;
|
184 |
mustTileRequest = false;
|
185 |
} |
186 |
|
187 |
public static final WMSConnector getConnectorFromURL(URL url) throws IOException { |
188 |
WMSConnector drv = (WMSConnector) drivers.get(url); |
189 |
if (drv == null) { |
190 |
drv = new WMSConnector(url);
|
191 |
drivers.put(url, drv); |
192 |
} |
193 |
return drv;
|
194 |
} |
195 |
|
196 |
/**
|
197 |
* Obtiene el objeto que contiene que contiene la interpretaci?n de
|
198 |
* color por banda
|
199 |
* @return
|
200 |
*/
|
201 |
public DataStoreColorInterpretation getColorInterpretation() {
|
202 |
if(colorInterpretation == null) { |
203 |
colorInterpretation = new DataStoreColorInterpretation();
|
204 |
colorInterpretation.initColorInterpretation(getBandCount()); |
205 |
colorInterpretation.setColorInterpValue(0, DataStoreColorInterpretation.RED_BAND);
|
206 |
colorInterpretation.setColorInterpValue(1, DataStoreColorInterpretation.GREEN_BAND);
|
207 |
colorInterpretation.setColorInterpValue(2, DataStoreColorInterpretation.BLUE_BAND);
|
208 |
} |
209 |
return colorInterpretation;
|
210 |
} |
211 |
|
212 |
/*
|
213 |
* (non-Javadoc)
|
214 |
* @see org.gvsig.fmap.dal.coverage.dataset.RasterDataSet#getAffineTransform()
|
215 |
*/
|
216 |
public AffineTransform getAffineTransform() { |
217 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
218 |
Extent e = getExtent(); |
219 |
if(p.isSizeFixed()) {
|
220 |
double psX = e.width() / (p.getWidth() - 1); |
221 |
double psY = -(e.height() / (p.getHeight() - 1)); |
222 |
ownTransformation = new AffineTransform( |
223 |
psX , |
224 |
0,
|
225 |
0,
|
226 |
psY, |
227 |
e.getULX() - (psX / 2),
|
228 |
e.getULY() - (psY / 2));
|
229 |
} else {
|
230 |
double psX = e.width() / (lastWidthRequest <= 0 ? p.getWidth() : lastWidthRequest); |
231 |
double psY = -(e.height() / (lastHeightRequest <= 0 ? p.getHeight() : lastHeightRequest)); |
232 |
ownTransformation = new AffineTransform( |
233 |
psX, |
234 |
0,
|
235 |
0,
|
236 |
psY, |
237 |
e.getULX() - (psX / 2),
|
238 |
e.getULY() - (psY / 2));
|
239 |
/*ownTransformation = new AffineTransform(
|
240 |
p.getExtent().getWidth() / (lastWidthRequest <= 0 ? p.getWidth() : lastWidthRequest) ,
|
241 |
0,
|
242 |
0,
|
243 |
-(p.getExtent().getHeight() / (lastHeightRequest <= 0 ? p.getHeight() : lastHeightRequest)),
|
244 |
p.getExtent().getMinX(),
|
245 |
p.getExtent().getMinY());*/
|
246 |
} |
247 |
externalTransformation = (AffineTransform) ownTransformation.clone();
|
248 |
return ownTransformation;
|
249 |
} |
250 |
|
251 |
/**
|
252 |
* Calcula el extent en coordenadas del mundo real
|
253 |
* @return Extent
|
254 |
*/
|
255 |
public Extent getExtent() {
|
256 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
257 |
Vector<?> layerNames = Utilities.createVector(p.getLayerQuery(), ","); |
258 |
|
259 |
String[] ln = new String[layerNames.size()]; |
260 |
for (int i = 0; i < ln.length; i++) { |
261 |
ln[i] = (String)layerNames.get(i);
|
262 |
} |
263 |
Rectangle2D r = null; |
264 |
try {
|
265 |
r = getConnector().getLayersExtent(ln, p.getSRSCode()); |
266 |
} catch (RemoteServiceException e) {
|
267 |
} |
268 |
return new ExtentImpl(r.getMinX(), r.getMaxY(), r.getMaxX(), r.getMinY()); |
269 |
} |
270 |
|
271 |
|
272 |
/*
|
273 |
* (non-Javadoc)
|
274 |
* @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLayerExtent(java.lang.String, java.lang.String)
|
275 |
*/
|
276 |
public Rectangle2D getLayerExtent(String layerName, String srs) throws RemoteServiceException { |
277 |
return getConnector().getLayersExtent(new String[]{layerName}, srs); |
278 |
} |
279 |
|
280 |
/*
|
281 |
* (non-Javadoc)
|
282 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#load()
|
283 |
*/
|
284 |
public RasterProvider load() {
|
285 |
return this; |
286 |
} |
287 |
|
288 |
/*
|
289 |
* (non-Javadoc)
|
290 |
* @see org.gvsig.raster.impl.provider.RasterProvider#isOpen()
|
291 |
*/
|
292 |
public boolean isOpen() { |
293 |
return open;
|
294 |
} |
295 |
|
296 |
/*
|
297 |
* (non-Javadoc)
|
298 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#close()
|
299 |
*/
|
300 |
public void close() { |
301 |
open = false;
|
302 |
} |
303 |
|
304 |
/*
|
305 |
* (non-Javadoc)
|
306 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getTransparency()
|
307 |
*/
|
308 |
public Transparency getTransparency() { |
309 |
if(fileTransparency == null) |
310 |
fileTransparency = new DataStoreTransparency();
|
311 |
return fileTransparency;
|
312 |
} |
313 |
|
314 |
/*
|
315 |
* (non-Javadoc)
|
316 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#translateFileName(java.lang.String)
|
317 |
*/
|
318 |
public String translateFileName(String fileName) { |
319 |
return fileName;
|
320 |
} |
321 |
|
322 |
/*
|
323 |
* (non-Javadoc)
|
324 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setView(org.gvsig.fmap.dal.coverage.datastruct.Extent)
|
325 |
*/
|
326 |
public void setView(Extent e) { |
327 |
viewRequest = e; |
328 |
} |
329 |
|
330 |
/*
|
331 |
* (non-Javadoc)
|
332 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getView()
|
333 |
*/
|
334 |
public Extent getView() {
|
335 |
return viewRequest;
|
336 |
} |
337 |
|
338 |
/*
|
339 |
* (non-Javadoc)
|
340 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWidth()
|
341 |
*/
|
342 |
public double getWidth() { |
343 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
344 |
if(p.isSizeFixed()) {
|
345 |
return p.getWidth();
|
346 |
} |
347 |
if (lastWidthRequest <= 0) |
348 |
return p.getWidth();
|
349 |
if (lastWidthRequest < minTilePrintWidth)
|
350 |
return minTilePrintWidth;
|
351 |
return lastWidthRequest;
|
352 |
} |
353 |
|
354 |
/*
|
355 |
* (non-Javadoc)
|
356 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getHeight()
|
357 |
*/
|
358 |
public double getHeight() { |
359 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
360 |
if(p.isSizeFixed()) {
|
361 |
return p.getHeight();
|
362 |
} |
363 |
if (lastHeightRequest <= 0) |
364 |
return p.getHeight();
|
365 |
if (lastHeightRequest < minTilePrintHeight)
|
366 |
return minTilePrintHeight;
|
367 |
return lastHeightRequest;
|
368 |
} |
369 |
|
370 |
/*
|
371 |
* (non-Javadoc)
|
372 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#readCompleteLine(int, int)
|
373 |
*/
|
374 |
public Object readCompleteLine(int line, int band) |
375 |
throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
|
376 |
return null; |
377 |
} |
378 |
|
379 |
/**
|
380 |
* When the remote layer has fixed size this method downloads the file and return its reference.
|
381 |
* File layer has in the long side FIXED_SIZE pixels and the bounding box is complete. This file could be
|
382 |
* useful to build an histogram or calculate statistics. This represents a sample of data.
|
383 |
* @return
|
384 |
* @throws RasterDriverException
|
385 |
*/
|
386 |
public File getFileLayer() throws RasterDriverException { |
387 |
if(fileLayerPixelSize != null) |
388 |
return fileLayerPixelSize;
|
389 |
|
390 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
391 |
Extent e = getExtent(); |
392 |
Rectangle2D bBox = new Rectangle2D.Double(e.getULX(), e.getLRY(), e.width(), e.height()); |
393 |
WMSStatus wmsStatus = loadWMSStatus(bBox); |
394 |
|
395 |
if(!p.isSizeFixed()) {
|
396 |
int w = 0; |
397 |
int h = 0; |
398 |
if(e.width() > e.height()) {
|
399 |
w = FIXED_SIZE; |
400 |
h = (int)((e.height() * FIXED_SIZE) / e.width());
|
401 |
} else {
|
402 |
h = FIXED_SIZE; |
403 |
w = (int)((e.width() * FIXED_SIZE) / e.height());
|
404 |
} |
405 |
wmsStatus.setWidth(w); |
406 |
wmsStatus.setHeight(h); |
407 |
fileLayerPixelSize = downloadFile(wmsStatus, e.getULX(), e.getULY(), e.getLRX(), e.getLRY(), w, h); |
408 |
} else {
|
409 |
fileLayerPixelSize = downloadFile(wmsStatus, e.getULX(), e.getULY(), e.getLRX(), e.getLRY(), |
410 |
p.getFixedSize().width, p.getFixedSize().height); |
411 |
} |
412 |
return fileLayerPixelSize;
|
413 |
} |
414 |
|
415 |
/**
|
416 |
* Reads a complete block of data and returns an tridimensional array of the right type. This function is useful
|
417 |
* to read a file very fast without setting a view. In a WMS service when the size is fixed then it will read the
|
418 |
* entire image but when the source hasn't pixel size it will read a sample of data. This set of data will have
|
419 |
* the size defined in FIXED_SIZE.
|
420 |
*
|
421 |
* @param pos Posici?n donde se empieza a leer
|
422 |
* @param blockHeight Altura m?xima del bloque leido
|
423 |
* @return Object que es un array tridimendional del tipo de datos del raster. (Bandas X Filas X Columnas)
|
424 |
* @throws InvalidSetViewException
|
425 |
* @throws FileNotOpenException
|
426 |
* @throws RasterDriverException
|
427 |
*/
|
428 |
public Object readBlock(int pos, int blockHeight) |
429 |
throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
|
430 |
File lastFile = getFileLayer();
|
431 |
BandList bandList = new BandListImpl();
|
432 |
for (int i = 0; i < 3; i++) { |
433 |
try {
|
434 |
bandList.addBand(new DatasetBandImpl(lastFile.getPath(), pos, Buffer.TYPE_BYTE, 3), pos); |
435 |
} catch (BandNotFoundInListException e1) {
|
436 |
} |
437 |
} |
438 |
bandList.setDrawableBands(new int[]{0, 1, 2}); |
439 |
|
440 |
try {
|
441 |
GdalProvider driver = new GdalProvider(lastFile.getPath());
|
442 |
return driver.readBlock(pos, blockHeight);
|
443 |
} catch (NotSupportedExtensionException exc) {
|
444 |
throw new RasterDriverException("Error building GdalDriver", exc); |
445 |
} |
446 |
} |
447 |
|
448 |
/*
|
449 |
* (non-Javadoc)
|
450 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getData(int, int, int)
|
451 |
*/
|
452 |
public Object getData(int x, int y, int band) |
453 |
throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
|
454 |
return null; |
455 |
} |
456 |
|
457 |
/**
|
458 |
* Gets the georeferencing file name form a raster file
|
459 |
* @param file
|
460 |
* a raster file
|
461 |
* @return
|
462 |
* a georeferencing file
|
463 |
*/
|
464 |
private String getWorldFile(String file){ |
465 |
String worldFile = file;
|
466 |
int index = file.lastIndexOf("."); |
467 |
if (index > 0){ |
468 |
worldFile = file.substring(0, index) + getExtensionWorldFile();
|
469 |
} |
470 |
return worldFile;
|
471 |
} |
472 |
|
473 |
/**
|
474 |
* Obtiene la extensi?n del fichero de georreferenciaci?n
|
475 |
* @return String con la extensi?n del fichero de georreferenciaci?n dependiendo
|
476 |
* del valor del formato obtenido del servidor. Por defecto asignaremos un .wld
|
477 |
*/
|
478 |
private String getExtensionWorldFile() { |
479 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
480 |
String extWorldFile = ".wld"; |
481 |
if(p.getFormat().equals("image/tif") || p.getFormat().equals("image/tiff")) { |
482 |
extWorldFile = ".tfw";
|
483 |
} |
484 |
return extWorldFile;
|
485 |
} |
486 |
|
487 |
private WMSStatus loadWMSStatus(Rectangle2D bBox) { |
488 |
lastExtent = bBox; |
489 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
490 |
WMSStatus wmsStatus = new WMSStatus();
|
491 |
wmsStatus.setLayerNames(Utilities.createVector(p.getLayerQuery(), ",")); |
492 |
wmsStatus.setSrs(p.getSRSCode()); |
493 |
wmsStatus.setFormat(p.getFormat()); |
494 |
wmsStatus.setStyles(p.getStyles()); |
495 |
wmsStatus.setDimensions(p.getDimensions()); |
496 |
wmsStatus.setTransparency(p.isWmsTransparent()); |
497 |
wmsStatus.setOnlineResource((String) p.getOnlineResource().get("GetMap")); |
498 |
if(p.isSizeFixed()) {
|
499 |
wmsStatus.setExtent(getExtent().toRectangle2D()); |
500 |
} else
|
501 |
wmsStatus.setExtent(bBox); |
502 |
wmsStatus.setHeight(p.getHeight()); |
503 |
wmsStatus.setWidth(p.getWidth()); |
504 |
return wmsStatus;
|
505 |
} |
506 |
|
507 |
/**
|
508 |
* This function downloads the file and creates the georeferencing file
|
509 |
* @param wmsStatus
|
510 |
* @param ulx
|
511 |
* @param uly
|
512 |
* @param lrx
|
513 |
* @param lry
|
514 |
* @param w
|
515 |
* @param h
|
516 |
* @return
|
517 |
* @throws RasterDriverException
|
518 |
*/
|
519 |
private File downloadFile(WMSStatus wmsStatus, double ulx, double uly, double lrx, double lry, int w, int h) throws RasterDriverException { |
520 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
521 |
try {
|
522 |
lastRequest = getConnector().getMap(wmsStatus, ((WMSDataParametersImpl)parameters).getCancellable()); |
523 |
} catch (RemoteServiceException e) {
|
524 |
throw new RasterDriverException(e.getMessage(), e); |
525 |
} |
526 |
|
527 |
if(lastRequest == null) |
528 |
return null; |
529 |
|
530 |
String nameWorldFile = getWorldFile(lastRequest.getPath());
|
531 |
try {
|
532 |
if(p.isSizeFixed()) {
|
533 |
Extent e = getExtent(); |
534 |
fileUtil.createWorldFile(nameWorldFile, e, p.getWidth(), p.getHeight()); |
535 |
} else {
|
536 |
fileUtil.createWorldFile(nameWorldFile, new ExtentImpl(ulx, uly, lrx, lry), w, h);
|
537 |
} |
538 |
} catch (IOException e) { |
539 |
throw new RasterDriverException("Error creating world file", e); |
540 |
} |
541 |
|
542 |
return lastRequest;
|
543 |
} |
544 |
|
545 |
/**
|
546 |
* Assigns the list of bands RGB and read a window of data
|
547 |
* @param rasterBuf
|
548 |
* @param bandList
|
549 |
* @param lastFile
|
550 |
* @param ulx
|
551 |
* @param uly
|
552 |
* @param lrx
|
553 |
* @param lry
|
554 |
* @return
|
555 |
* @throws RasterDriverException
|
556 |
* @throws ProcessInterruptedException
|
557 |
*/
|
558 |
public Buffer getBuffer(Buffer rasterBuf, BandList bandList, File lastFile, |
559 |
double ulx, double uly, double lrx, double lry) throws RasterDriverException, ProcessInterruptedException { |
560 |
try {
|
561 |
//El nombre de fichero que ha puesto en el bandList es el del servidor y no el del fichero en disco
|
562 |
String serverName = bandList.getBand(0).getFileName(); |
563 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
564 |
bandList.getBand(i).setFileName(lastFile.getPath()); |
565 |
} |
566 |
|
567 |
GdalProvider driver = new GdalProvider(lastFile.getPath());
|
568 |
Buffer buf = driver.getWindow(new ExtentImpl(ulx, uly, lrx, lry), bandList, rasterBuf); |
569 |
|
570 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
571 |
bandList.getBand(i).setFileName(serverName); |
572 |
} |
573 |
|
574 |
return buf;
|
575 |
} catch (NotSupportedExtensionException e) {
|
576 |
throw new RasterDriverException("Error building GdalDriver", e); |
577 |
} |
578 |
} |
579 |
|
580 |
/*
|
581 |
* (non-Javadoc)
|
582 |
* @see org.gvsig.raster.impl.provider.RasterProvider#isTiled()
|
583 |
*/
|
584 |
public boolean isTiled() { |
585 |
return mustTileRequest;
|
586 |
} |
587 |
|
588 |
/*
|
589 |
* (non-Javadoc)
|
590 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.raster.cache.tile.provider.TileListener)
|
591 |
*/
|
592 |
public void getWindow(Extent ex, int bufWidth, int bufHeight, |
593 |
BandList bandList, TileListener listener) throws ProcessInterruptedException, RasterDriverException {
|
594 |
if(mustTileRequest) {
|
595 |
|
596 |
} else {
|
597 |
Buffer raster = DefaultRasterManager.getInstance().createBuffer(getDataType()[0], bufWidth, bufHeight, 3, true); |
598 |
getWindow(ex, bufWidth, bufHeight, bandList, raster, true);
|
599 |
raster.setDataExtent(ex.toRectangle2D()); |
600 |
|
601 |
TileCacheManager m = TileCacheLocator.getManager(); |
602 |
org.gvsig.raster.cache.tile.Tile t = m.createTile(-1, 0, 0); |
603 |
t.setData(new Object[]{raster}); |
604 |
t.setUl(new Point2D.Double(ex.getULX(), ex.getULY())); |
605 |
t.setLr(new Point2D.Double(ex.getLRX(), ex.getLRY())); |
606 |
t.setDownloaderParams("AffineTransform", getAffineTransform());
|
607 |
t.setDownloaderParams("Tiling", new Boolean(false)); |
608 |
try {
|
609 |
listener.tileReady(t); |
610 |
} catch (TileGettingException e) {
|
611 |
throw new RasterDriverException("Error throwing a tile", e); |
612 |
} |
613 |
|
614 |
//listener.nextBuffer(raster, null, new ExtentImpl(minX, minY, maxX, maxY), getAffineTransform(), null, false);
|
615 |
listener.endReading(); |
616 |
} |
617 |
} |
618 |
|
619 |
/*
|
620 |
* (non-Javadoc)
|
621 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
|
622 |
*/
|
623 |
public Buffer getWindow(Extent ex, BandList bandList, Buffer rasterBuf) |
624 |
throws ProcessInterruptedException, RasterDriverException {
|
625 |
Rectangle2D bBox = ex.toRectangle2D();
|
626 |
lastWidthRequest = rasterBuf.getWidth(); |
627 |
lastHeightRequest = rasterBuf.getHeight(); |
628 |
WMSStatus wmsStatus = loadWMSStatus(bBox); |
629 |
|
630 |
lastRequest = downloadFile(wmsStatus, ex.getULX(), ex.getULY(), ex.getLRX(), ex.getLRY(), rasterBuf.getWidth(), rasterBuf.getHeight()); |
631 |
|
632 |
if (lastRequest == null) { |
633 |
return rasterBuf;
|
634 |
} |
635 |
|
636 |
try {
|
637 |
//El nombre de fichero que ha puesto en el bandList es el del servidor y no el del fichero en disco
|
638 |
String serverName = bandList.getBand(0).getFileName(); |
639 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
640 |
bandList.getBand(i).setFileName(lastRequest.getPath()); |
641 |
} |
642 |
|
643 |
GdalProvider driver = new GdalProvider(lastRequest.getPath());
|
644 |
Buffer buf = driver.getWindow(ex, bandList, rasterBuf);
|
645 |
|
646 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
647 |
bandList.getBand(i).setFileName(serverName); |
648 |
} |
649 |
driver.close(); |
650 |
return buf;
|
651 |
} catch (NotSupportedExtensionException e) {
|
652 |
throw new RasterDriverException("Error building GdalDriver", e); |
653 |
} |
654 |
} |
655 |
|
656 |
/*
|
657 |
* (non-Javadoc)
|
658 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(double, double, double, double, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
|
659 |
*/
|
660 |
public Buffer getWindow(double ulx, double uly, double w, double h, |
661 |
BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException { |
662 |
Rectangle2D bBox = new Rectangle2D.Double(ulx, uly, w, h); |
663 |
lastWidthRequest = rasterBuf.getWidth(); |
664 |
lastHeightRequest = rasterBuf.getHeight(); |
665 |
WMSStatus wmsStatus = loadWMSStatus(bBox); |
666 |
|
667 |
lastRequest = downloadFile(wmsStatus, ulx, uly, ulx + w, uly - h, rasterBuf.getWidth(), rasterBuf.getHeight()); |
668 |
|
669 |
if (lastRequest == null) { |
670 |
return rasterBuf;
|
671 |
} |
672 |
|
673 |
try {
|
674 |
//El nombre de fichero que ha puesto en el bandList es el del servidor y no el del fichero en disco
|
675 |
String serverName = bandList.getBand(0).getFileName(); |
676 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
677 |
bandList.getBand(i).setFileName(lastRequest.getPath()); |
678 |
} |
679 |
|
680 |
GdalProvider driver = new GdalProvider(lastRequest.getPath());
|
681 |
Buffer buf = driver.getWindow(ulx, uly, w, h, bandList, rasterBuf, adjustToExtent);
|
682 |
|
683 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
684 |
bandList.getBand(i).setFileName(serverName); |
685 |
} |
686 |
|
687 |
return buf;
|
688 |
} catch (NotSupportedExtensionException e) {
|
689 |
throw new RasterDriverException("Error building GdalDriver", e); |
690 |
} |
691 |
} |
692 |
|
693 |
/*
|
694 |
* (non-Javadoc)
|
695 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer, boolean)
|
696 |
*/
|
697 |
public Buffer getWindow(Extent extent, |
698 |
int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf, boolean adjustToExtent) throws ProcessInterruptedException, RasterDriverException { |
699 |
Rectangle2D bBox = extent.toRectangle2D();//new Rectangle2D.Double(ulx, lry, Math.abs(lrx - ulx), Math.abs(lry - uly)); |
700 |
lastWidthRequest = rasterBuf.getWidth(); |
701 |
lastHeightRequest = rasterBuf.getHeight(); |
702 |
WMSStatus wmsStatus = loadWMSStatus(bBox); |
703 |
lastRequest = downloadFile(wmsStatus, extent.getULX(), extent.getULY(), extent.getLRX(), extent.getLRY(), rasterBuf.getWidth(), rasterBuf.getHeight()); |
704 |
|
705 |
if (lastRequest == null) { |
706 |
return rasterBuf;
|
707 |
} |
708 |
|
709 |
try {
|
710 |
//El nombre de fichero que ha puesto en el bandList es el del servidor y no el del fichero en disco
|
711 |
String serverName = bandList.getBand(0).getFileName(); |
712 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
713 |
bandList.getBand(i).setFileName(lastRequest.getPath()); |
714 |
} |
715 |
|
716 |
GdalProvider driver = new GdalProvider(lastRequest.getPath());
|
717 |
Buffer buf = driver.getWindow(extent, bufWidth, bufHeight, bandList, rasterBuf, adjustToExtent);
|
718 |
|
719 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
720 |
bandList.getBand(i).setFileName(serverName); |
721 |
} |
722 |
|
723 |
return buf;
|
724 |
} catch (NotSupportedExtensionException e) {
|
725 |
throw new RasterDriverException("Error building GdalDriver", e); |
726 |
} |
727 |
} |
728 |
|
729 |
/*
|
730 |
* (non-Javadoc)
|
731 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
|
732 |
*/
|
733 |
public Buffer getWindow(int x, int y, |
734 |
BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException { |
735 |
int w = rasterBuf.getWidth();
|
736 |
int h = rasterBuf.getHeight();
|
737 |
Point2D p1 = rasterToWorld(new Point2D.Double(x, y)); |
738 |
Point2D p2 = rasterToWorld(new Point2D.Double(x + w, y + h)); |
739 |
lastWidthRequest = rasterBuf.getWidth(); |
740 |
lastHeightRequest = rasterBuf.getHeight(); |
741 |
Rectangle2D bBox = new Rectangle2D.Double(p1.getX(), p1.getY(), Math.abs(p1.getX() - p1.getX()), Math.abs(p1.getY() - p2.getY())); |
742 |
WMSStatus wmsStatus = loadWMSStatus(bBox); |
743 |
|
744 |
lastRequest = downloadFile(wmsStatus, p1.getX(), p1.getY(), p2.getX(), p2.getY(), rasterBuf.getWidth(), rasterBuf.getHeight()); |
745 |
|
746 |
if (lastRequest == null) { |
747 |
return rasterBuf;
|
748 |
} |
749 |
|
750 |
GdalProvider driver = null;
|
751 |
try {
|
752 |
//El nombre de fichero que ha puesto en el bandList es el del servidor y no el del fichero en disco
|
753 |
String serverName = bandList.getBand(0).getFileName(); |
754 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
755 |
bandList.getBand(i).setFileName(lastRequest.getPath()); |
756 |
} |
757 |
|
758 |
driver = new GdalProvider(lastRequest.getPath());
|
759 |
Buffer buf = driver.getWindow(0, 0, w, h, rasterBuf.getWidth(), rasterBuf.getHeight(), bandList, rasterBuf); |
760 |
|
761 |
for (int i = 0; i < bandList.getBandCount(); i++) { |
762 |
bandList.getBand(i).setFileName(serverName); |
763 |
} |
764 |
|
765 |
return buf;
|
766 |
} catch (NotSupportedExtensionException e) {
|
767 |
throw new RasterDriverException("Error building GdalDriver", e); |
768 |
} |
769 |
} |
770 |
|
771 |
/*
|
772 |
* (non-Javadoc)
|
773 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getWindowRaster(int, int, int, int, int, int, org.gvsig.fmap.dal.coverage.datastruct.BandList, org.gvsig.fmap.dal.coverage.dataset.Buffer)
|
774 |
*/
|
775 |
public Buffer getWindow(int x, int y, int w, int h, int bufWidth, int bufHeight, BandList bandList, Buffer rasterBuf) throws ProcessInterruptedException, RasterDriverException { |
776 |
lastWidthRequest = rasterBuf.getWidth(); |
777 |
lastHeightRequest = rasterBuf.getHeight(); |
778 |
return null; |
779 |
} |
780 |
|
781 |
/*
|
782 |
* (non-Javadoc)
|
783 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getBlockSize()
|
784 |
*/
|
785 |
public int getBlockSize() { |
786 |
return 0; |
787 |
} |
788 |
|
789 |
/*
|
790 |
* (non-Javadoc)
|
791 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#setAffineTransform(java.awt.geom.AffineTransform)
|
792 |
*/
|
793 |
public void setAffineTransform(AffineTransform t){ |
794 |
|
795 |
} |
796 |
|
797 |
/*
|
798 |
* (non-Javadoc)
|
799 |
* @see org.gvsig.raster.impl.provider.RasterProvider#getOverviewCount(int)
|
800 |
*/
|
801 |
public int getOverviewCount(int band) throws BandAccessException, RasterDriverException { |
802 |
return 0; |
803 |
} |
804 |
|
805 |
/*
|
806 |
* (non-Javadoc)
|
807 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewWidth(int, int)
|
808 |
*/
|
809 |
public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException { |
810 |
return 0; |
811 |
} |
812 |
|
813 |
/*
|
814 |
* (non-Javadoc)
|
815 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#getOverviewHeight(int, int)
|
816 |
*/
|
817 |
public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException { |
818 |
return 0; |
819 |
} |
820 |
|
821 |
/*
|
822 |
* (non-Javadoc)
|
823 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#overviewsSupport()
|
824 |
*/
|
825 |
public boolean overviewsSupport() { |
826 |
return false; |
827 |
} |
828 |
|
829 |
/*
|
830 |
* (non-Javadoc)
|
831 |
* @see org.gvsig.raster.impl.provider.DefaultRasterProvider#isReproyectable()
|
832 |
*/
|
833 |
public boolean isReproyectable() { |
834 |
return false; |
835 |
} |
836 |
|
837 |
/*
|
838 |
* (non-Javadoc)
|
839 |
* @see org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider#getName()
|
840 |
*/
|
841 |
public String getName() { |
842 |
return NAME;
|
843 |
} |
844 |
|
845 |
/**
|
846 |
* Convierte un punto desde coordenadas pixel a coordenadas del mundo.
|
847 |
* @param pt Punto a transformar
|
848 |
* @return punto transformado en coordenadas del mundo
|
849 |
*/
|
850 |
public Point2D rasterToWorld(Point2D pt) { |
851 |
Point2D p = new Point2D.Double(); |
852 |
getAffineTransform().transform(pt, p); |
853 |
return p;
|
854 |
} |
855 |
|
856 |
/**
|
857 |
* Convierte un punto desde del mundo a coordenadas pixel.
|
858 |
* @param pt Punto a transformar
|
859 |
* @return punto transformado en coordenadas pixel
|
860 |
*/
|
861 |
public Point2D worldToRaster(Point2D pt) { |
862 |
Point2D p = new Point2D.Double(); |
863 |
try {
|
864 |
getAffineTransform().inverseTransform(pt, p); |
865 |
} catch (NoninvertibleTransformException e) { |
866 |
return pt;
|
867 |
} |
868 |
return p;
|
869 |
} |
870 |
|
871 |
/*
|
872 |
* (non-Javadoc)
|
873 |
* @see org.gvsig.raster.impl.provider.RasterProvider#setStatus(org.gvsig.raster.impl.provider.RasterProvider)
|
874 |
*/
|
875 |
public void setStatus(RasterProvider provider) { |
876 |
if(provider instanceof WMSProvider) { |
877 |
} |
878 |
} |
879 |
|
880 |
/*
|
881 |
* (non-Javadoc)
|
882 |
* @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getLastRequest()
|
883 |
*/
|
884 |
public File getLastRequest() { |
885 |
return lastRequest;
|
886 |
} |
887 |
|
888 |
/*
|
889 |
* (non-Javadoc)
|
890 |
* @see org.gvsig.raster.impl.provider.RemoteRasterProvider#getBufferLastRequest()
|
891 |
*/
|
892 |
public Buffer getBufferLastRequest() throws ProcessInterruptedException, RasterDriverException { |
893 |
try {
|
894 |
GdalProvider driver = new GdalProvider(lastRequest.getPath());
|
895 |
|
896 |
BandList bandList = new BandListImpl();
|
897 |
for (int i = 0; i < driver.getBandCount(); i++) { |
898 |
try {
|
899 |
bandList.addBand(new DatasetBandImpl(lastRequest.getPath(), i, Buffer.TYPE_BYTE, 3), i); |
900 |
} catch (BandNotFoundInListException e1) {
|
901 |
} |
902 |
} |
903 |
bandList.setDrawableBands(new int[]{0, 1, 2}); |
904 |
Buffer newBuffer = DefaultRasterManager.getInstance().createBuffer(driver.getDataType()[0], (int)driver.getWidth(), (int)driver.getHeight(), driver.getBandCount(), true); |
905 |
Buffer buf = driver.getWindow(driver.getExtent(),
|
906 |
(int)driver.getWidth(),
|
907 |
(int)driver.getHeight(),
|
908 |
bandList, |
909 |
newBuffer, |
910 |
true);
|
911 |
driver.close(); |
912 |
return buf;
|
913 |
} catch (NotSupportedExtensionException e) {
|
914 |
throw new RasterDriverException("Error building GdalDriver", e); |
915 |
} |
916 |
} |
917 |
|
918 |
/**
|
919 |
* ASigna el par?metro de inicializaci?n del driver.
|
920 |
*/
|
921 |
@Override
|
922 |
public void setParam(DataStoreParameters param) { |
923 |
if(param instanceof WMSDataParameters) |
924 |
this.name = ((WMSDataParameters)param).getHost();
|
925 |
this.param = param;
|
926 |
} |
927 |
|
928 |
/**
|
929 |
* @param wmsStatus
|
930 |
* @param i
|
931 |
* @param j
|
932 |
* @param max_value
|
933 |
* @return
|
934 |
* @throws RemoteServiceException
|
935 |
*/
|
936 |
public String getFeatureInfo(int i, int j, int max_value, ICancellable cancellable) throws RemoteServiceException { |
937 |
WMSStatus wmsStatus = loadWMSStatus(lastExtent); |
938 |
return getConnector().getFeatureInfo(wmsStatus, i, j, max_value, cancellable);
|
939 |
} |
940 |
|
941 |
/*
|
942 |
* (non-Javadoc)
|
943 |
* @see org.gvsig.raster.impl.provider.RasterProvider#getInfoByPoint(double, double)
|
944 |
*/
|
945 |
public String getInfoByPoint(double x, double y, ICancellable cancellable) throws RemoteServiceException { |
946 |
return getFeatureInfo((int) x, (int) y, Integer.MAX_VALUE, cancellable); |
947 |
} |
948 |
|
949 |
/**
|
950 |
* Gets the suffix of the downloaded image
|
951 |
* @return
|
952 |
*/
|
953 |
public String getFileSuffix() { |
954 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
955 |
String format = p.getFormat();
|
956 |
if (format == null){ |
957 |
return "xml"; |
958 |
} |
959 |
if (format.indexOf("png") >= 0){ |
960 |
return "png"; |
961 |
} |
962 |
if (format.indexOf("xml") >= 0){ |
963 |
return "xml"; |
964 |
} |
965 |
if (format.indexOf("gif") >= 0){ |
966 |
return "gif"; |
967 |
} |
968 |
if (format.indexOf("tif") >= 0){ |
969 |
return "tif"; |
970 |
} |
971 |
if (format.indexOf("bmp") >= 0){ |
972 |
return "bmp"; |
973 |
} |
974 |
if (format.indexOf("jpg") >= 0 |
975 |
|| format.indexOf("jpeg") >= 0){ |
976 |
return "jpg"; |
977 |
} |
978 |
return "xml"; |
979 |
} |
980 |
|
981 |
/*
|
982 |
* (non-Javadoc)
|
983 |
* @see org.gvsig.raster.impl.provider.RasterProvider#getTileServer()
|
984 |
*/
|
985 |
public TileServer getTileServer() {
|
986 |
return null; |
987 |
} |
988 |
|
989 |
/*
|
990 |
* (non-Javadoc)
|
991 |
* @see org.gvsig.raster.impl.provider.RasterProvider#isRasterEnclosed()
|
992 |
*/
|
993 |
public boolean isRasterEnclosed() { |
994 |
WMSDataParametersImpl p = (WMSDataParametersImpl)parameters; |
995 |
if(p.isSizeFixed()) {
|
996 |
return false; |
997 |
} |
998 |
return true; |
999 |
} |
1000 |
|
1001 |
/*
|
1002 |
* (non-Javadoc)
|
1003 |
* @see org.gvsig.raster.impl.provider.RasterProvider#getRMFFile()
|
1004 |
*/
|
1005 |
public String getRMFFile() { |
1006 |
if(lastRequest != null) |
1007 |
return fileUtil.getNameWithoutExtension(lastRequest.getAbsolutePath()) + ".rmf"; |
1008 |
return null; |
1009 |
} |
1010 |
} |