Revision 6340
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheFileSystemServerProvider.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.raster.tilecache.provider; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.io.IOException; |
|
27 |
|
|
28 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
29 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
30 |
import org.gvsig.fmap.dal.NewDataStoreParameters; |
|
31 |
import org.gvsig.fmap.dal.exception.CreateException; |
|
32 |
import org.gvsig.fmap.dal.exception.DataException; |
|
33 |
import org.gvsig.fmap.dal.exception.FileNotFoundException; |
|
34 |
import org.gvsig.fmap.dal.exception.RemoveException; |
|
35 |
import org.gvsig.fmap.dal.resource.spi.ResourceConsumer; |
|
36 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
|
37 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider; |
|
38 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider; |
|
39 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices; |
|
40 |
|
|
41 |
/** |
|
42 |
* Filesystem Provider for JIMI. Initially, accepts png files |
|
43 |
* @author dmartinezizquierdo |
|
44 |
* |
|
45 |
*/ |
|
46 |
public class TileCacheFileSystemServerProvider extends AbstractFilesystemServerExplorerProvider |
|
47 |
implements FilesystemServerExplorerProvider, ResourceConsumer{ |
|
48 |
|
|
49 |
protected FilesystemServerExplorerProviderServices serverExplorer; |
|
50 |
|
|
51 |
public int getMode() { |
|
52 |
return DataServerExplorer.MODE_RASTER; |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public boolean canCreate() { |
|
57 |
return false; |
|
58 |
} |
|
59 |
|
|
60 |
@Override |
|
61 |
public boolean canCreate(NewDataStoreParameters arg0) { |
|
62 |
return false; |
|
63 |
} |
|
64 |
|
|
65 |
@Override |
|
66 |
public void create(NewDataStoreParameters arg0, boolean arg1) |
|
67 |
throws CreateException { |
|
68 |
throw new UnsupportedOperationException(); |
|
69 |
|
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public NewDataStoreParameters getCreateParameters() throws DataException { |
|
74 |
throw new UnsupportedOperationException(); |
|
75 |
} |
|
76 |
|
|
77 |
@Override |
|
78 |
public void initialize(FilesystemServerExplorerProviderServices serverExplorer) { |
|
79 |
this.serverExplorer = serverExplorer; |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public void remove(DataStoreParameters parameters) throws RemoveException { |
|
84 |
//FIXME |
|
85 |
// TileCacheStoreProviderParameters params = (TileCacheStoreProviderParameters) parameters; |
|
86 |
// File file = params.getFile(); |
|
87 |
// if (!file.exists()) { |
|
88 |
// throw new RemoveException(this.getDataStoreProviderName(), |
|
89 |
// new FileNotFoundException(params.getFile())); |
|
90 |
// } |
|
91 |
// if (!file.delete()) { |
|
92 |
// throw new RemoveException(this.getDataStoreProviderName(), |
|
93 |
// new IOException("Error deleting file: "+file.getName())); |
|
94 |
// } |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 |
@Override |
|
99 |
public String getDataStoreProviderName() { |
|
100 |
return TileCacheStoreProvider.NAME; |
|
101 |
} |
|
102 |
|
|
103 |
@Override |
|
104 |
public String getDescription() { |
|
105 |
return TileCacheStoreProvider.DESCRIPTION; |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
109 |
public boolean accept(File pathname) { |
|
110 |
//TODO Creo que deber?a de preguntar al provider que a su vez preguntar?a a la librer?a |
|
111 |
return (pathname.getName().toLowerCase().endsWith(".png")); |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public boolean closeResourceRequested(ResourceProvider resource) { |
|
116 |
return !(this.equals(resource)); |
|
117 |
} |
|
118 |
|
|
119 |
@Override |
|
120 |
public void resourceChanged(ResourceProvider resource) { |
|
121 |
//Do nothing |
|
122 |
} |
|
123 |
|
|
124 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheStoreProvider.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.raster.tilecache.provider; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.util.ArrayList; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.apache.commons.io.FilenameUtils; |
|
30 |
import org.cresques.cts.IProjection; |
|
31 |
import org.gvsig.fmap.dal.DALLocator; |
|
32 |
import org.gvsig.fmap.dal.DataManager; |
|
33 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
34 |
import org.gvsig.fmap.dal.DataStore; |
|
35 |
import org.gvsig.fmap.dal.DataStoreNotification; |
|
36 |
import org.gvsig.fmap.dal.FileHelper; |
|
37 |
import org.gvsig.fmap.dal.exception.CloseException; |
|
38 |
import org.gvsig.fmap.dal.exception.DataException; |
|
39 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
40 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
41 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
42 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
43 |
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor; |
|
44 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor; |
|
45 |
import org.gvsig.fmap.dal.raster.api.BandQuery; |
|
46 |
import org.gvsig.fmap.dal.raster.api.RasterQuery; |
|
47 |
import org.gvsig.fmap.dal.raster.spi.AbstractRasterStoreProvider; |
|
48 |
import org.gvsig.fmap.dal.resource.ResourceAction; |
|
49 |
import org.gvsig.fmap.dal.resource.exception.AccessResourceException; |
|
50 |
import org.gvsig.fmap.dal.resource.file.FileResource; |
|
51 |
import org.gvsig.fmap.dal.resource.spi.ResourceConsumer; |
|
52 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
|
53 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
|
54 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
|
55 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
56 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
57 |
import org.gvsig.metadata.MetadataLocator; |
|
58 |
import org.gvsig.metadata.MetadataManager; |
|
59 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
60 |
import org.gvsig.raster.lib.buffer.api.BandInfo; |
|
61 |
import org.gvsig.raster.lib.buffer.api.Buffer; |
|
62 |
import org.gvsig.raster.lib.buffer.api.BufferLocator; |
|
63 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
64 |
import org.gvsig.raster.lib.buffer.api.NoData; |
|
65 |
import org.gvsig.raster.lib.buffer.api.PageManager; |
|
66 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
|
67 |
import org.gvsig.tools.ToolsLocator; |
|
68 |
import org.gvsig.tools.dynobject.DynObject; |
|
69 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
70 |
import org.gvsig.tools.exception.BaseException; |
|
71 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
72 |
import org.gvsig.tools.task.TaskStatusManager; |
|
73 |
import org.slf4j.Logger; |
|
74 |
import org.slf4j.LoggerFactory; |
|
75 |
|
|
76 |
/** |
|
77 |
* Provider for Tile Cache |
|
78 |
* @author dmartinezizquierdo |
|
79 |
* |
|
80 |
*/ |
|
81 |
public class TileCacheStoreProvider extends AbstractRasterStoreProvider implements |
|
82 |
ResourceConsumer{ |
|
83 |
|
|
84 |
private static final Logger logger = |
|
85 |
LoggerFactory.getLogger(TileCacheStoreProvider.class); |
|
86 |
|
|
87 |
public static String NAME = "TileCache"; |
|
88 |
public static String DESCRIPTION = "Tile cache provider"; |
|
89 |
public static final String METADATA_DEFINITION_NAME = NAME; |
|
90 |
|
|
91 |
private ResourceProvider resource; |
|
92 |
private final SimpleTaskStatus taskStatus; |
|
93 |
|
|
94 |
private TileStructImage tileStructImage = null; |
|
95 |
|
|
96 |
private Envelope envelope = null; |
|
97 |
private IProjection projection= null; |
|
98 |
|
|
99 |
protected static void registerMetadataDefinition() |
|
100 |
throws MetadataException { |
|
101 |
MetadataManager manager = MetadataLocator.getMetadataManager(); |
|
102 |
if (manager.getDefinition(METADATA_DEFINITION_NAME) == null) { |
|
103 |
manager.addDefinition(METADATA_DEFINITION_NAME, |
|
104 |
TileCacheStoreProviderParameters.class |
|
105 |
.getResourceAsStream("TileCacheMetadata.xml"), |
|
106 |
TileCacheStoreProviderParameters.class.getClassLoader()); |
|
107 |
} |
|
108 |
} |
|
109 |
|
|
110 |
public TileCacheStoreProvider(TileCacheStoreProviderParameters params, |
|
111 |
DataStoreProviderServices storeServices) |
|
112 |
throws InitializeException { |
|
113 |
super( |
|
114 |
params, |
|
115 |
storeServices, |
|
116 |
FileHelper.newMetadataContainer(METADATA_DEFINITION_NAME) |
|
117 |
); |
|
118 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
119 |
this.taskStatus = manager.createDefaultSimpleTaskStatus("TileCache"); |
|
120 |
this.init(params, storeServices); |
|
121 |
} |
|
122 |
|
|
123 |
protected TileCacheStoreProvider(TileCacheStoreProviderParameters params, |
|
124 |
DataStoreProviderServices storeServices, DynObject metadata) |
|
125 |
throws InitializeException { |
|
126 |
super(params, storeServices, metadata); |
|
127 |
TaskStatusManager manager = ToolsLocator.getTaskStatusManager(); |
|
128 |
this.taskStatus = manager.createDefaultSimpleTaskStatus("TileCache"); |
|
129 |
this.init(params, storeServices); |
|
130 |
} |
|
131 |
|
|
132 |
protected void init(TileCacheStoreProviderParameters params, |
|
133 |
DataStoreProviderServices storeServices) throws InitializeException { |
|
134 |
if (params == null) { |
|
135 |
throw new InitializeException( |
|
136 |
new NullPointerException("params is null")); |
|
137 |
} |
|
138 |
// File file = getTileCacheParameters().getFile(); |
|
139 |
// if (file == null) { |
|
140 |
// throw new InitializeException( |
|
141 |
// new NullPointerException("Jimi file is null")); |
|
142 |
// } |
|
143 |
// |
|
144 |
this.projection=params.getCRS(); |
|
145 |
|
|
146 |
//FIXME |
|
147 |
File file = new File("/home/daniel/pruebas/datosPruebaRaster/tileCache/valencia1980"); |
|
148 |
|
|
149 |
resource = this.createResource( |
|
150 |
FileResource.NAME, |
|
151 |
new Object[] { file.getAbsolutePath() } |
|
152 |
); |
|
153 |
|
|
154 |
resource.addConsumer(this); |
|
155 |
|
|
156 |
} |
|
157 |
|
|
158 |
private TileCacheStoreProviderParameters getTileCacheParameters() { |
|
159 |
return (TileCacheStoreProviderParameters) this.getParameters(); |
|
160 |
} |
|
161 |
|
|
162 |
@Override |
|
163 |
public BandDescriptor getBandDescriptor(int band) { |
|
164 |
if(band > this.getBands()){ |
|
165 |
throw new IllegalArgumentException("Invalid band"); |
|
166 |
} |
|
167 |
return getStoreServices().createBandDescriptor(band, |
|
168 |
new ArrayList<BandAttributeDescriptor>()); |
|
169 |
} |
|
170 |
|
|
171 |
@Override |
|
172 |
public int getBands() { |
|
173 |
return tileStructImage.getBandNumber(); |
|
174 |
} |
|
175 |
|
|
176 |
@Override |
|
177 |
public Buffer createBuffer(RasterQuery rasterQuery) throws BufferException { |
|
178 |
BufferManager bufferManager = BufferLocator.getBufferManager(); |
|
179 |
int[] bandDataTypes; |
|
180 |
List<PageManager> pageManagers = new ArrayList<PageManager>(); |
|
181 |
NoData[] bandNoData; |
|
182 |
if (rasterQuery != null) { |
|
183 |
List<BandQuery> bands; |
|
184 |
bands = rasterQuery.getBands(); |
|
185 |
bandDataTypes = new int[bands.size()]; |
|
186 |
bandNoData = new NoData[bands.size()]; |
|
187 |
|
|
188 |
for (BandQuery bandQuery : bands) { |
|
189 |
int band = bandQuery.getBand(); |
|
190 |
bandDataTypes[band] = tileStructImage.getDataTypes()[band]; |
|
191 |
bandNoData[band] = null; |
|
192 |
pageManagers.add(new TileCacheBandPageManager(tileStructImage, rasterQuery.getPixelSize(), band)); |
|
193 |
} |
|
194 |
} else { |
|
195 |
int bands = getBands(); |
|
196 |
bandDataTypes = new int[bands]; |
|
197 |
bandNoData = new NoData[bands]; |
|
198 |
for (int i = 0; i < bands; i++) { |
|
199 |
bandDataTypes[i] = tileStructImage.getDataTypes()[i]; |
|
200 |
bandNoData[i] = null; |
|
201 |
pageManagers.add(new TileCacheBandPageManager(tileStructImage, rasterQuery.getPixelSize(), i)); |
|
202 |
} |
|
203 |
} |
|
204 |
int zoomLevel=tileStructImage.getZoomLvlForPixelSize(rasterQuery.getPixelSize()); |
|
205 |
envelope=tileStructImage.getEnvelopePerZoomLevel(zoomLevel); |
|
206 |
Buffer buffer = |
|
207 |
bufferManager.createBuffer(tileStructImage.getRows(zoomLevel), tileStructImage.getColumns(zoomLevel), bandDataTypes, bandNoData, |
|
208 |
projection, envelope, pageManagers); |
|
209 |
|
|
210 |
return buffer; |
|
211 |
} |
|
212 |
|
|
213 |
@Override |
|
214 |
public BandInfo getBandInfo(int band) { |
|
215 |
//FIXME |
|
216 |
return null;//tileStructImage.getBandInfo(band); |
|
217 |
} |
|
218 |
|
|
219 |
@Override |
|
220 |
public DataServerExplorer getExplorer() |
|
221 |
throws ReadException, ValidateDataParametersException { |
|
222 |
// DataManager manager = DALLocator.getDataManager(); |
|
223 |
// FilesystemServerExplorerParameters params; |
|
224 |
// try { |
|
225 |
// params = (FilesystemServerExplorerParameters) manager |
|
226 |
// .createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
227 |
// params.setRoot(this.getTileCacheParameters().getFile().getParent()); |
|
228 |
// return manager.openServerExplorer(FilesystemServerExplorer.NAME,params); |
|
229 |
// } catch (DataException e) { |
|
230 |
// throw new ReadException(this.getProviderName(), e); |
|
231 |
// } catch (ValidateDataParametersException e) { |
|
232 |
// throw new ReadException(this.getProviderName(), e); |
|
233 |
// } |
|
234 |
//FIXME |
|
235 |
return null; |
|
236 |
} |
|
237 |
|
|
238 |
public void open() throws OpenException { |
|
239 |
if (this.tileStructImage != null) { |
|
240 |
return; |
|
241 |
} |
|
242 |
openEver(); |
|
243 |
} |
|
244 |
|
|
245 |
private void openEver() throws OpenException { |
|
246 |
try { |
|
247 |
getResource().execute(new ResourceAction() { |
|
248 |
|
|
249 |
public Object run() throws Exception { |
|
250 |
|
|
251 |
try { |
|
252 |
File folder = (File) resource.get(); |
|
253 |
resource.notifyOpen(); |
|
254 |
|
|
255 |
//FIXME |
|
256 |
tileStructImage = new TileStructImage(folder,getTileCacheParameters().getCRS()); |
|
257 |
|
|
258 |
|
|
259 |
// if (getTileCacheParameters().getWldParams()!=null){ |
|
260 |
// envelope=createWLDEnvelope(getTileCacheParameters().getWldParams()); |
|
261 |
// }else{ |
|
262 |
// envelope = |
|
263 |
// GeometryLocator.getGeometryManager().createEnvelope(0, 0, |
|
264 |
// tileStructImage.getColumns(), tileStructImage.getRows(), Geometry.SUBTYPES.GEOM2D); |
|
265 |
// } |
|
266 |
|
|
267 |
resource.notifyClose(); |
|
268 |
|
|
269 |
resource.setData(tileStructImage); |
|
270 |
} finally { |
|
271 |
//TODO |
|
272 |
} |
|
273 |
return null; |
|
274 |
} |
|
275 |
|
|
276 |
}); |
|
277 |
} catch (Exception e) { |
|
278 |
this.tileStructImage = null; |
|
279 |
try { |
|
280 |
throw new OpenException(resource.getName(), e); |
|
281 |
} catch (AccessResourceException e1) { |
|
282 |
throw new OpenException(getProviderName(), e); |
|
283 |
} |
|
284 |
} finally { |
|
285 |
this.taskStatus.remove(); |
|
286 |
} |
|
287 |
} |
|
288 |
|
|
289 |
// private Envelope createWLDEnvelope(List<String> wldParams){ |
|
290 |
// double pixelSizeX=Double.valueOf(wldParams.get(0)); |
|
291 |
// double rotationAxisY = Double.valueOf(wldParams.get(1)); |
|
292 |
// double rotationAxisX = Double.valueOf(wldParams.get(2)); |
|
293 |
// double pixelSizeY = Double.valueOf(wldParams.get(3)); |
|
294 |
// double upperLeftPixelCenterCoordX = Double.valueOf(wldParams.get(4)); |
|
295 |
// double upperLeftPixelCenterCoordY = Double.valueOf(wldParams.get(5)); |
|
296 |
// |
|
297 |
// if (0.0 != rotationAxisX || 0.0 != rotationAxisY) { |
|
298 |
// logger.warn( |
|
299 |
// "Rotation in wld file not implemented yet. It will be ignored"); |
|
300 |
// } |
|
301 |
// |
|
302 |
// double leftMostX = upperLeftPixelCenterCoordX - (pixelSizeX * 0.5); |
|
303 |
// double upperMostY = upperLeftPixelCenterCoordY - (pixelSizeY * 0.5); |
|
304 |
// double height=tileStructImage.getRows()*pixelSizeY; |
|
305 |
// double width=tileStructImage.getColumns()*pixelSizeX; |
|
306 |
// |
|
307 |
// // double minX, double minY, double maxX, double maxY, int subType |
|
308 |
// try { |
|
309 |
// envelope = GeometryLocator.getGeometryManager().createEnvelope( |
|
310 |
// Math.min(leftMostX,leftMostX + width), |
|
311 |
// Math.min(upperMostY,upperMostY + height), |
|
312 |
// Math.max(leftMostX,leftMostX + width), |
|
313 |
// Math.max(upperMostY,upperMostY + height), |
|
314 |
// Geometry.SUBTYPES.GEOM2D); |
|
315 |
// } catch (LocatorException | CreateEnvelopeException e) { |
|
316 |
// logger.warn( |
|
317 |
// "Failed to create envelope from wld file with coords: minx:"+leftMostX+ |
|
318 |
// ", miny:"+upperMostY+", maxX: "+leftMostX + width+", maxY: "+upperMostY + height); |
|
319 |
// e.printStackTrace(); |
|
320 |
// } |
|
321 |
// |
|
322 |
// return envelope; |
|
323 |
// } |
|
324 |
|
|
325 |
@Override |
|
326 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
|
327 |
if( DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name) ) { |
|
328 |
return this.envelope; |
|
329 |
} else if( DataStore.METADATA_CRS.equalsIgnoreCase(name) ) { |
|
330 |
IProjection pro = this.getTileCacheParameters().getCRS(); |
|
331 |
if (pro != null) { |
|
332 |
return pro; |
|
333 |
} |
|
334 |
} |
|
335 |
return super.getDynValue(name); |
|
336 |
} |
|
337 |
|
|
338 |
@Override |
|
339 |
public void close() throws CloseException { |
|
340 |
this.tileStructImage = null; |
|
341 |
} |
|
342 |
|
|
343 |
@Override |
|
344 |
public ResourceProvider getResource() { |
|
345 |
return this.resource; |
|
346 |
} |
|
347 |
|
|
348 |
|
|
349 |
@Override |
|
350 |
public Object getSourceId() { |
|
351 |
return this.getTileCacheParameters().getName(); |
|
352 |
} |
|
353 |
|
|
354 |
@Override |
|
355 |
public String getProviderName() { |
|
356 |
return NAME; |
|
357 |
} |
|
358 |
|
|
359 |
@Override |
|
360 |
public String getName() { |
|
361 |
String name = this.getTileCacheParameters().getName(); |
|
362 |
return name; //FilenameUtils.getBaseName(name); |
|
363 |
|
|
364 |
} |
|
365 |
|
|
366 |
@Override |
|
367 |
public String getFullName() { |
|
368 |
return this.getTileCacheParameters().getName(); |
|
369 |
} |
|
370 |
|
|
371 |
@Override |
|
372 |
public boolean closeResourceRequested(ResourceProvider resource) { |
|
373 |
return true; |
|
374 |
} |
|
375 |
|
|
376 |
@Override |
|
377 |
/* |
|
378 |
* (non-Javadoc) |
|
379 |
* |
|
380 |
* @see |
|
381 |
* org.gvsig.fmap.dal.resource.spi.ResourceConsumer#resourceChanged(org. |
|
382 |
* gvsig.fmap.dal.resource.spi.ResourceProvider) |
|
383 |
*/ |
|
384 |
public void resourceChanged(ResourceProvider resource) { |
|
385 |
this.getStoreServices().notifyChange( |
|
386 |
DataStoreNotification.RESOURCE_CHANGED, |
|
387 |
resource); |
|
388 |
} |
|
389 |
|
|
390 |
@Override |
|
391 |
/* (non-Javadoc) |
|
392 |
* @see org.gvsig.fmap.dal.feature.spi.memory.AbstractMemoryStoreProvider#doDispose() |
|
393 |
*/ |
|
394 |
protected void doDispose() throws BaseException { |
|
395 |
super.doDispose(); |
|
396 |
resource.removeConsumer(this); |
|
397 |
} |
|
398 |
|
|
399 |
public TileStructImage getTileStructImage() { |
|
400 |
return tileStructImage; |
|
401 |
} |
|
402 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheStoreProviderParameters.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.raster.tilecache.provider; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.io.IOException; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.apache.commons.io.FileUtils; |
|
30 |
import org.apache.commons.io.FilenameUtils; |
|
31 |
import org.apache.commons.lang3.StringUtils; |
|
32 |
import org.cresques.cts.ICRSFactory; |
|
33 |
import org.cresques.cts.IProjection; |
|
34 |
import org.gvsig.fmap.crs.CRSFactory; |
|
35 |
import org.gvsig.fmap.dal.FileHelper; |
|
36 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
|
37 |
import org.gvsig.fmap.dal.raster.spi.OpenRasterStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
|
39 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
|
40 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
41 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
42 |
import org.slf4j.Logger; |
|
43 |
import org.slf4j.LoggerFactory; |
|
44 |
|
|
45 |
/** |
|
46 |
* Parameters to create a JIMI Provider |
|
47 |
* @author dmartinezizquierdo |
|
48 |
* |
|
49 |
*/ |
|
50 |
public class TileCacheStoreProviderParameters extends AbstractDataParameters implements |
|
51 |
OpenRasterStoreParameters{ |
|
52 |
|
|
53 |
private static final Logger logger = LoggerFactory.getLogger(TileCacheStoreProviderParameters.class); |
|
54 |
|
|
55 |
public static final String PARAMETERS_DEFINITION_NAME = "TileCacheStoreProviderParameters"; |
|
56 |
public static final String TILECACHE_NAME_PARAMTER_NAME = "name"; |
|
57 |
public static final String CRS_PARAMTER_NAME = "crs"; |
|
58 |
public static final String WLD_PARAMS_NAME= "wldParams"; |
|
59 |
|
|
60 |
|
|
61 |
private DelegatedDynObject parameters; |
|
62 |
|
|
63 |
/** |
|
64 |
* Constructor |
|
65 |
*/ |
|
66 |
public TileCacheStoreProviderParameters() { |
|
67 |
this(PARAMETERS_DEFINITION_NAME); |
|
68 |
} |
|
69 |
|
|
70 |
protected TileCacheStoreProviderParameters(String parametersDefinitionName) { |
|
71 |
this(parametersDefinitionName, TileCacheStoreProvider.NAME); |
|
72 |
} |
|
73 |
|
|
74 |
|
|
75 |
/** |
|
76 |
* Constructor |
|
77 |
* @param parametersDefinitionName |
|
78 |
* @param name |
|
79 |
*/ |
|
80 |
public TileCacheStoreProviderParameters(String parametersDefinitionName, String name) { |
|
81 |
super(); |
|
82 |
this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName); |
|
83 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name); |
|
84 |
} |
|
85 |
|
|
86 |
@Override |
|
87 |
public String getDataStoreName() { |
|
88 |
return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME); |
|
89 |
} |
|
90 |
|
|
91 |
@Override |
|
92 |
public boolean isValid() { |
|
93 |
return (this.getName() != null); |
|
94 |
} |
|
95 |
|
|
96 |
@Override |
|
97 |
public String getDescription() { |
|
98 |
return this.getDynClass().getDescription(); |
|
99 |
} |
|
100 |
|
|
101 |
public String getName() { |
|
102 |
return (String) this.getDynValue(TILECACHE_NAME_PARAMTER_NAME); |
|
103 |
} |
|
104 |
|
|
105 |
public void setName(String name) { |
|
106 |
this.setDynValue(TILECACHE_NAME_PARAMTER_NAME, name); |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* Sets CRS |
|
111 |
* @param crsCode |
|
112 |
*/ |
|
113 |
public void setCRS(String crsCode) { |
|
114 |
IProjection crs=CRSFactory.getCRS(crsCode); |
|
115 |
setDynValue(CRS_PARAMTER_NAME, crs); |
|
116 |
} |
|
117 |
|
|
118 |
/** |
|
119 |
* Sets CRS |
|
120 |
* @param crs |
|
121 |
*/ |
|
122 |
public void setCRS(IProjection crs) { |
|
123 |
setDynValue(CRS_PARAMTER_NAME, crs); |
|
124 |
} |
|
125 |
|
|
126 |
|
|
127 |
/** |
|
128 |
* Gets CRS |
|
129 |
* @return IProjection |
|
130 |
*/ |
|
131 |
public IProjection getCRS() { |
|
132 |
return (IProjection) getDynValue(CRS_PARAMTER_NAME); |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* Gets the 6 params of a WLD file as Strings. |
|
137 |
* @return Returns WLD parameters |
|
138 |
*/ |
|
139 |
public List<String> getWldParams(){ |
|
140 |
return (List<String>) getDynValue(WLD_PARAMS_NAME); |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* Sets the params of a wld file |
|
145 |
* @param wldParams |
|
146 |
*/ |
|
147 |
public void setWldParams(List<String> wldParams){ |
|
148 |
setDynValue(WLD_PARAMS_NAME,wldParams); |
|
149 |
} |
|
150 |
|
|
151 |
@Override |
|
152 |
protected DelegatedDynObject getDelegatedDynObject() { |
|
153 |
return parameters; |
|
154 |
} |
|
155 |
|
|
156 |
|
|
157 |
// private void loadPRJ(File file){ |
|
158 |
// File prjFile = new File(FilenameUtils.removeExtension(file.getAbsolutePath())+".prj"); |
|
159 |
// if (prjFile.exists()) { |
|
160 |
// try { |
|
161 |
// String contentFile = FileUtils.readFileToString(prjFile); |
|
162 |
// if (StringUtils.isNotEmpty(contentFile)){ |
|
163 |
// IProjection crs=CRSFactory.getCRSFactory().get(ICRSFactory.FORMAT_WKT_ESRI, contentFile); |
|
164 |
// setCRS(crs); |
|
165 |
// } |
|
166 |
// |
|
167 |
// } catch (IOException e) { |
|
168 |
// logger.warn("Couldn't read wld file"); |
|
169 |
// } |
|
170 |
// } |
|
171 |
// } |
|
172 |
// |
|
173 |
// private void loadWLD(File file){ |
|
174 |
// File wldFile = new File(FilenameUtils.removeExtension(file.getAbsolutePath())+".wld"); |
|
175 |
// if (wldFile.exists()) { |
|
176 |
// try { |
|
177 |
// List<String> lines = FileUtils.readLines(wldFile); |
|
178 |
// if (lines!=null && lines.size()==6){ |
|
179 |
// setWldParams(lines); |
|
180 |
// } |
|
181 |
// |
|
182 |
// } catch (IOException e) { |
|
183 |
// logger.warn("Couldn't read wld file"); |
|
184 |
// } |
|
185 |
// } |
|
186 |
// } |
|
187 |
|
|
188 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheBandPageManager.java | ||
---|---|---|
1 |
package org.gvsig.raster.tilecache.provider; |
|
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
import java.nio.Buffer; |
|
5 |
import java.nio.ByteBuffer; |
|
6 |
import java.nio.DoubleBuffer; |
|
7 |
import java.nio.FloatBuffer; |
|
8 |
import java.nio.IntBuffer; |
|
9 |
import java.nio.ShortBuffer; |
|
10 |
|
|
11 |
import org.gvsig.raster.lib.buffer.api.BandInfo; |
|
12 |
import org.gvsig.raster.lib.buffer.api.BandPageManager; |
|
13 |
import org.gvsig.raster.lib.buffer.api.BandTileManager; |
|
14 |
import org.gvsig.raster.lib.buffer.api.BufferLocator; |
|
15 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
16 |
|
|
17 |
/** |
|
18 |
* Band Page Managaer for a Memory Image |
|
19 |
* @author dmartinezizquierdo |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class TileCacheBandPageManager implements BandTileManager{ |
|
23 |
|
|
24 |
private TileStructImage tileStructImage; |
|
25 |
private int band; |
|
26 |
private int dataSize = -1; |
|
27 |
private int dataType = BufferManager.TYPE_UNDEFINED; |
|
28 |
private double pixelSize; |
|
29 |
private int zoomLevel; |
|
30 |
|
|
31 |
/** |
|
32 |
* @param image |
|
33 |
* @param band |
|
34 |
*/ |
|
35 |
public TileCacheBandPageManager(TileStructImage tileStructImage, double pixelSize, int band){ |
|
36 |
this.tileStructImage=tileStructImage; |
|
37 |
this.pixelSize=pixelSize; |
|
38 |
this.band=band; |
|
39 |
this.zoomLevel=tileStructImage.getZoomLvlForPixelSize(pixelSize); |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
public boolean isSupportedSave() { |
|
44 |
return false; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public void load(Buffer buffer, int row, int rows, int col, int cols, int dataType) throws IOException { |
|
49 |
// int xOffset = col; |
|
50 |
// int xSize = cols; |
|
51 |
// int yOffset = row; |
|
52 |
// int ySize = rows; |
|
53 |
buffer.rewind(); |
|
54 |
|
|
55 |
// int completeRasterRows=tileStructImage.getRows(this.zoomLevel); |
|
56 |
// int completeRasterColumns=tileStructImage.getColumns(this.zoomLevel); |
|
57 |
|
|
58 |
int tileRow=(int)row/getRowsPerTile(); |
|
59 |
int tileCol=(int)col/getColumnsPerTile(); |
|
60 |
|
|
61 |
tileStructImage.fetchTile(buffer, band, this.zoomLevel,tileRow,tileCol); |
|
62 |
|
|
63 |
// |
|
64 |
// buffer.rewind(); |
|
65 |
// |
|
66 |
// int offset=0; |
|
67 |
// for (int i=row; i<=rows; i++){ |
|
68 |
// int tileRow=(int)i/getRowsPerTile(); |
|
69 |
// int rowInTile=i-(tileRow*getRowsPerTile()); |
|
70 |
// int j =col; |
|
71 |
// while (j<cols){ |
|
72 |
// int tileCol=(int)j/getColumnsPerTile(); |
|
73 |
// int firstColInTile=j-(tileCol*getColumnsPerTile()); |
|
74 |
// int lastColInTile=getColumnsPerTile(); |
|
75 |
// if ( cols<(tileCol+1)*getColumnsPerTile() ){ |
|
76 |
// lastColInTile=cols-(tileRow*getRowsPerTile()); |
|
77 |
// } |
|
78 |
// Tile tile=tileStructImage.getTile(this.zoomLevel,tileRow,tileCol); |
|
79 |
// byte[] tileBuffer= tile.getBuffer(rowInTile,firstColInTile, lastColInTile); |
|
80 |
// int length=lastColInTile-firstColInTile; |
|
81 |
// ((ByteBuffer) buffer).put(tileBuffer, offset, length); |
|
82 |
// offset+=length; |
|
83 |
// |
|
84 |
// j=( tileCol*getColumnsPerTile() ) +1; |
|
85 |
// } |
|
86 |
// |
|
87 |
// } |
|
88 |
} |
|
89 |
|
|
90 |
@Override |
|
91 |
public BandInfo getBandInfo() { |
|
92 |
//FIXME |
|
93 |
return null; |
|
94 |
} |
|
95 |
|
|
96 |
@Override |
|
97 |
public void save(Buffer buffer, int row, int rows, int col, int cols, |
|
98 |
int dataType) throws IOException { |
|
99 |
throw new UnsupportedOperationException(); |
|
100 |
|
|
101 |
} |
|
102 |
|
|
103 |
@Override |
|
104 |
public int getRowsPerTile() { |
|
105 |
return tileStructImage.getRowsPerTile(); |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
109 |
public int getColumnsPerTile() { |
|
110 |
return tileStructImage.getColumnsPerTile(); |
|
111 |
} |
|
112 |
|
|
113 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheStoreProviderFactory.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.raster.tilecache.provider; |
|
24 |
|
|
25 |
import org.gvsig.fmap.dal.DALLocator; |
|
26 |
import org.gvsig.fmap.dal.DataParameters; |
|
27 |
import org.gvsig.fmap.dal.DataStoreProvider; |
|
28 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
29 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
30 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
31 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
32 |
import org.gvsig.fmap.dal.raster.spi.AbstractRasterStoreProviderFactory; |
|
33 |
import org.gvsig.fmap.dal.raster.spi.RasterStoreProviderServices; |
|
34 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
35 |
import org.gvsig.tools.dynobject.DynObject; |
|
36 |
import org.gvsig.tools.locator.LocatorException; |
|
37 |
import org.slf4j.Logger; |
|
38 |
import org.slf4j.LoggerFactory; |
|
39 |
|
|
40 |
/** |
|
41 |
* Factory for JIMI provider |
|
42 |
* @author dmartinezizquierdo |
|
43 |
* |
|
44 |
*/ |
|
45 |
public class TileCacheStoreProviderFactory extends AbstractRasterStoreProviderFactory { |
|
46 |
|
|
47 |
private static final Logger logger = LoggerFactory.getLogger(TileCacheStoreProviderFactory.class); |
|
48 |
|
|
49 |
protected TileCacheStoreProviderFactory(String name, String description) { |
|
50 |
super(name, description); |
|
51 |
} |
|
52 |
|
|
53 |
@Override |
|
54 |
public DataStoreProvider createProvider(DataParameters parameters, |
|
55 |
DataStoreProviderServices providerServices) throws InitializeException { |
|
56 |
return (DataStoreProvider) new TileCacheStoreProvider((TileCacheStoreProviderParameters)parameters,providerServices); |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public DynObject createParameters() { |
|
61 |
return new TileCacheStoreProviderParameters(); |
|
62 |
} |
|
63 |
|
|
64 |
public TileCacheStoreProvider createJimiProvider(TileCacheStoreProviderParameters parameters, |
|
65 |
DataStoreProviderServices providerServices) throws InitializeException { |
|
66 |
return new TileCacheStoreProvider(parameters,providerServices); |
|
67 |
} |
|
68 |
|
|
69 |
public TileCacheStoreProviderParameters createJimiParameters(){ |
|
70 |
return new TileCacheStoreProviderParameters(); |
|
71 |
} |
|
72 |
|
|
73 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileStructImage.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.raster.tilecache.provider; |
|
24 |
|
|
25 |
import java.io.File; |
|
26 |
import java.nio.Buffer; |
|
27 |
import java.util.ArrayList; |
|
28 |
import java.util.Collections; |
|
29 |
import java.util.HashSet; |
|
30 |
import java.util.Iterator; |
|
31 |
import java.util.List; |
|
32 |
import java.util.Set; |
|
33 |
import java.util.SortedMap; |
|
34 |
import java.util.TreeMap; |
|
35 |
|
|
36 |
import javax.xml.parsers.DocumentBuilder; |
|
37 |
import javax.xml.parsers.DocumentBuilderFactory; |
|
38 |
|
|
39 |
import org.apache.commons.io.FilenameUtils; |
|
40 |
import org.cresques.cts.IProjection; |
|
41 |
import org.gvsig.fmap.dal.DALFileLocator; |
|
42 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
|
43 |
import org.gvsig.fmap.dal.exception.DataException; |
|
44 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
45 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
46 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerManager; |
|
47 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory; |
|
48 |
import org.gvsig.fmap.dal.spi.DALSPILocator; |
|
49 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
|
50 |
import org.gvsig.fmap.geom.Geometry.DIMENSIONS; |
|
51 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
52 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
53 |
import org.gvsig.fmap.geom.GeometryManager; |
|
54 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
55 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
56 |
import org.gvsig.raster.lib.buffer.api.Band; |
|
57 |
import org.gvsig.tools.dynobject.DynObject; |
|
58 |
import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension; |
|
59 |
import org.slf4j.Logger; |
|
60 |
import org.slf4j.LoggerFactory; |
|
61 |
import org.w3c.dom.Document; |
|
62 |
import org.w3c.dom.Element; |
|
63 |
import org.w3c.dom.NamedNodeMap; |
|
64 |
import org.w3c.dom.Node; |
|
65 |
import org.w3c.dom.NodeList; |
|
66 |
|
|
67 |
/** |
|
68 |
* Represents a tiled image |
|
69 |
* @author dmartinezizquierdo |
|
70 |
* |
|
71 |
*/ |
|
72 |
public class TileStructImage{ |
|
73 |
|
|
74 |
private static final Logger logger = LoggerFactory.getLogger(TileStructImage.class); |
|
75 |
|
|
76 |
private int rowsPerTile; |
|
77 |
private int columnsPerTile; |
|
78 |
private String providerName; |
|
79 |
private FilesystemServerExplorerProviderFactory factory; |
|
80 |
private SortedMap<Integer,Double> pixelSizePerZoomLevel; |
|
81 |
// private SortedMap<Integer,Integer> rowsPerZoomLevel; |
|
82 |
// private SortedMap<Integer,Integer> columnsPerZoomLevel; |
|
83 |
private SortedMap<Integer,List<Integer>> rowsInZoomLevel; |
|
84 |
private SortedMap<Integer,List<Integer>> columnsInZoomLevel; |
|
85 |
private SortedMap<Integer,Envelope> envelopePerZoomLevel; |
|
86 |
// private SortedMap<Integer,Integer[][]> tileMatrixPerZoomLevel; |
|
87 |
private File tilesFolder; |
|
88 |
|
|
89 |
private int bandNumber; |
|
90 |
|
|
91 |
private int[] dataTypes; |
|
92 |
|
|
93 |
private RasterStore tileStore; |
|
94 |
private IProjection crs; |
|
95 |
|
|
96 |
public TileStructImage(File folder, IProjection crs){ |
|
97 |
|
|
98 |
this.crs=crs; |
|
99 |
|
|
100 |
rowsInZoomLevel=new TreeMap<Integer,List<Integer>>(); |
|
101 |
columnsInZoomLevel=new TreeMap<Integer,List<Integer>>(); |
|
102 |
envelopePerZoomLevel=new TreeMap<Integer,Envelope>(); |
|
103 |
pixelSizePerZoomLevel=new TreeMap<Integer,Double>(); |
|
104 |
|
|
105 |
//FIXME |
|
106 |
File tilePropertiesFile=new File(folder, "tileCacheStruct.xml"); |
|
107 |
tilesFolder=new File (folder,"V"+File.separatorChar+"Z"+File.separatorChar+"T"); |
|
108 |
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); |
|
109 |
DocumentBuilder dBuilder; |
|
110 |
try { |
|
111 |
dBuilder = dbFactory.newDocumentBuilder(); |
|
112 |
Document doc = dBuilder.parse(tilePropertiesFile); |
|
113 |
|
|
114 |
doc.getDocumentElement().normalize(); |
|
115 |
|
|
116 |
NodeList nList = doc.getElementsByTagName("TileCacheStruct"); |
|
117 |
for (int temp = 0; temp < nList.getLength(); temp++) { |
|
118 |
|
|
119 |
Node nNode = nList.item(temp); |
|
120 |
|
|
121 |
if (nNode.getNodeType() == Node.ELEMENT_NODE) { |
|
122 |
Element eElement = (Element) nNode; |
|
123 |
|
|
124 |
|
|
125 |
NamedNodeMap tileSizeAttributes = eElement.getElementsByTagName("tileSize").item(0).getAttributes(); |
|
126 |
rowsPerTile=Integer.valueOf(tileSizeAttributes.getNamedItem("rows").getNodeValue()); |
|
127 |
columnsPerTile=Integer.valueOf(tileSizeAttributes.getNamedItem("columns").getNodeValue()); |
|
128 |
|
|
129 |
NodeList elementsByTagName = eElement.getElementsByTagName("format"); |
|
130 |
providerName=elementsByTagName.item(0).getTextContent(); |
|
131 |
|
|
132 |
FilesystemServerExplorerManager explorerManager = DALFileLocator.getFilesystemServerExplorerManager(); |
|
133 |
Iterator it = explorerManager.getRegisteredProviders(); |
|
134 |
while(it.hasNext()){ |
|
135 |
|
|
136 |
Extension ext = (Extension) it.next(); |
|
137 |
FilesystemServerExplorerProviderFactory providerFactory; |
|
138 |
try { |
|
139 |
providerFactory = (FilesystemServerExplorerProviderFactory) ext.create(); |
|
140 |
if(providerFactory.getName().equalsIgnoreCase(providerName)){ |
|
141 |
this.factory = providerFactory; |
|
142 |
break; |
|
143 |
} |
|
144 |
} catch (Exception e) { |
|
145 |
throw new RuntimeException(e);// FIXME !!! |
|
146 |
} |
|
147 |
} |
|
148 |
|
|
149 |
NodeList levelsTag = eElement.getElementsByTagName("levels"); |
|
150 |
Element levels = (Element)levelsTag.item(0); |
|
151 |
NodeList levelList=levels.getElementsByTagName("level"); |
|
152 |
for (int i = 0; i < levelList.getLength(); i++) { |
|
153 |
Element level = (Element)levelList.item(i); |
|
154 |
int zoomLevel=Integer.valueOf(level.getElementsByTagName("index").item(0).getTextContent()); |
|
155 |
double pixelSize=Double.valueOf(level.getElementsByTagName("pixelSize").item(0).getTextContent()); |
|
156 |
pixelSizePerZoomLevel.put(zoomLevel, pixelSize); |
|
157 |
readFolderTileStructure(zoomLevel); |
|
158 |
} |
|
159 |
|
|
160 |
} |
|
161 |
} |
|
162 |
|
|
163 |
} catch (Exception e) { |
|
164 |
throw new RuntimeException(); |
|
165 |
} |
|
166 |
|
|
167 |
} |
|
168 |
|
|
169 |
/** |
|
170 |
* @param zoomLevel |
|
171 |
*/ |
|
172 |
private void readFolderTileStructure(int zoomLevel){ |
|
173 |
File zoomFolder=new File(tilesFolder,String.valueOf(zoomLevel)); |
|
174 |
String[] columnsNames = zoomFolder.list(); |
|
175 |
Set<Integer> columns = new HashSet<Integer>(); |
|
176 |
for (int i = 0; i < columnsNames.length; i++) { |
|
177 |
columns.add(Integer.valueOf(FilenameUtils.getBaseName(columnsNames[i]))); |
|
178 |
} |
|
179 |
ArrayList<Integer> columnsList = new ArrayList<Integer>(); |
|
180 |
columnsList.addAll(columns); |
|
181 |
Collections.sort(columnsList); |
|
182 |
this.columnsInZoomLevel.put(zoomLevel, columnsList); |
|
183 |
|
|
184 |
// columnsPerZoomLevel.put(zoomLevel, columnsNames.length*getColumnsPerTile()); |
|
185 |
int maxRows=0; |
|
186 |
Integer firstColumn=columnsList.get(0); |
|
187 |
Integer firstRow=null; |
|
188 |
for (String columnName:columnsNames){ |
|
189 |
File columnFolder=new File(zoomFolder,columnName); |
|
190 |
String[] filenames = columnFolder.list(); |
|
191 |
Set<Integer> rows = new HashSet<Integer>(); |
|
192 |
for (int i = 0; i < filenames.length; i++) { |
|
193 |
rows.add(Integer.valueOf(FilenameUtils.getBaseName(filenames[i]))); |
|
194 |
} |
|
195 |
if (rows.size()>maxRows){ |
|
196 |
maxRows=rows.size(); |
|
197 |
} |
|
198 |
if (firstRow==null){ |
|
199 |
ArrayList<Integer> rowsList = new ArrayList<Integer>(); |
|
200 |
rowsList.addAll(rows); |
|
201 |
Collections.sort(rowsList); |
|
202 |
this.rowsInZoomLevel.put(zoomLevel, rowsList); |
|
203 |
firstRow=rowsList.get(0); |
|
204 |
} |
|
205 |
} |
|
206 |
// rowsPerZoomLevel.put(zoomLevel, maxRows*getColumnsPerTile()); |
|
207 |
|
|
208 |
//FIXME: leer el primer tile para obtener el upperLeftPoint |
|
209 |
File firstRowFile=null; |
|
210 |
File firstColumnFolder=new File(zoomFolder,String.valueOf(firstColumn)); |
|
211 |
String rowBaseName = String.valueOf(firstRow); |
|
212 |
File[] providerAcceptedFiles = firstColumnFolder.listFiles(factory); |
|
213 |
for (int i = 0; i < providerAcceptedFiles.length; i++) { |
|
214 |
File providerAcceptedFile = providerAcceptedFiles[i]; |
|
215 |
if(FilenameUtils.getBaseName(providerAcceptedFile.getAbsolutePath()).equalsIgnoreCase(rowBaseName)){ |
|
216 |
firstRowFile = providerAcceptedFile; |
|
217 |
} |
|
218 |
} |
|
219 |
if ( firstRowFile!=null ){ |
|
220 |
DataManagerProviderServices manager = DALSPILocator.getDataManagerProviderServices(); |
|
221 |
DataStoreProviderFactory providerFactory = manager.getStoreProviderFactory(providerName); |
|
222 |
DynObject params = providerFactory.createParameters(); |
|
223 |
if (params.getDynClass().getDynField("file")!=null){ |
|
224 |
params.setDynValue("file", firstRowFile); |
|
225 |
} |
|
226 |
if (params.getDynClass().getDynField("crs")!=null){ |
|
227 |
params.setDynValue("crs", this.crs); |
|
228 |
} |
|
229 |
try { |
|
230 |
this.tileStore = (RasterStore) manager.openStore(providerName,params); |
|
231 |
this.bandNumber=this.tileStore.getBands(); |
|
232 |
this.dataTypes=new int[this.bandNumber]; |
|
233 |
for (int i=0;i<this.bandNumber;i++){ |
|
234 |
dataTypes[i]=this.tileStore.getBandInfo(i).getDataType(); |
|
235 |
} |
|
236 |
Envelope firstTileEnvelope=this.tileStore.getEnvelope(); |
|
237 |
GeometryManager geoManager=GeometryLocator.getGeometryManager(); |
|
238 |
double minX = firstTileEnvelope.getMinimum(DIMENSIONS.X); |
|
239 |
double maxY = firstTileEnvelope.getMaximum(DIMENSIONS.Y); |
|
240 |
Envelope levelEnvelope=geoManager.createEnvelope( |
|
241 |
minX, |
|
242 |
maxY - ( getRows(zoomLevel)*pixelSizePerZoomLevel.get(zoomLevel) ), |
|
243 |
minX + ( getColumns(zoomLevel)*pixelSizePerZoomLevel.get(zoomLevel) ), |
|
244 |
maxY, |
|
245 |
SUBTYPES.GEOM2D); |
|
246 |
|
|
247 |
envelopePerZoomLevel.put(zoomLevel, levelEnvelope); |
|
248 |
|
|
249 |
|
|
250 |
} catch (ValidateDataParametersException | |
|
251 |
CreateEnvelopeException | DataException e) { |
|
252 |
logger.info("Can't read tile", e); |
|
253 |
// TODO exception |
|
254 |
|
|
255 |
} |
|
256 |
}else{ |
|
257 |
logger.info("Can't read tile structure"); |
|
258 |
|
|
259 |
} |
|
260 |
} |
|
261 |
|
|
262 |
public int getZoomLvlForPixelSize(double pixelSize){ |
|
263 |
int zoom=0; |
|
264 |
for (int i:pixelSizePerZoomLevel.keySet()){ |
|
265 |
zoom=i; |
|
266 |
double levelPixelSize=pixelSizePerZoomLevel.get(zoom); |
|
267 |
if (pixelSize>=levelPixelSize){ |
|
268 |
return zoom; |
|
269 |
} |
|
270 |
} |
|
271 |
return zoom; |
|
272 |
} |
|
273 |
|
|
274 |
public void fetchTile(Buffer buffer, int band, int zoomLevel, int tileRow, int tileCol){ |
|
275 |
|
|
276 |
Integer structCol = columnsInZoomLevel.get(zoomLevel).get(tileCol); |
|
277 |
Integer structRow = rowsInZoomLevel.get(zoomLevel).get(tileRow); |
|
278 |
|
|
279 |
File tileFile=null; |
|
280 |
|
|
281 |
File zoomFolder=new File(tilesFolder,String.valueOf(zoomLevel)); |
|
282 |
File firstColumnFolder=new File(zoomFolder,String.valueOf(structCol)); |
|
283 |
String rowBaseName = String.valueOf(structRow); |
|
284 |
File[] providerAcceptedFiles = firstColumnFolder.listFiles(factory); |
|
285 |
for (int i = 0; i < providerAcceptedFiles.length; i++) { |
|
286 |
File providerAcceptedFile = providerAcceptedFiles[i]; |
|
287 |
if(FilenameUtils.getBaseName(providerAcceptedFile.getAbsolutePath()).equalsIgnoreCase(rowBaseName)){ |
|
288 |
tileFile = providerAcceptedFile; |
|
289 |
} |
|
290 |
} |
|
291 |
if ( tileFile!=null ){ |
|
292 |
DataManagerProviderServices manager = DALSPILocator.getDataManagerProviderServices(); |
|
293 |
DataStoreProviderFactory providerFactory = manager.getStoreProviderFactory(providerName); |
|
294 |
DynObject params = providerFactory.createParameters(); |
|
295 |
if (params.getDynClass().getDynField("file")!=null){ |
|
296 |
params.setDynValue("file", tileFile); |
|
297 |
} |
|
298 |
if (params.getDynClass().getDynField("crs")!=null){ |
|
299 |
params.setDynValue("crs", this.crs); |
|
300 |
} |
|
301 |
// RasterStore store; |
|
302 |
try { |
|
303 |
this.tileStore = (RasterStore) manager.openStore(providerName,params); |
|
304 |
Band tileBand = tileStore.getRasterSet().getBand(band); |
|
305 |
Object rowBuffer = tileBand.createRowBuffer(); |
|
306 |
for(int r=0; r<tileBand.getRows(); r++){ |
|
307 |
tileBand.fetchRow(r, rowBuffer); |
|
308 |
System.arraycopy(rowBuffer, 0, buffer.array(), r*tileBand.getColumns(), tileBand.getColumns()); |
|
309 |
} |
|
310 |
} catch (ValidateDataParametersException | DataException e) { |
|
311 |
// TODO Auto-generated catch block |
|
312 |
e.printStackTrace(); |
|
313 |
} |
|
314 |
} |
|
315 |
} |
|
316 |
|
|
317 |
public int getBandNumber(){ |
|
318 |
return this.bandNumber; |
|
319 |
} |
|
320 |
|
|
321 |
public int[] getDataTypes(){ |
|
322 |
return this.dataTypes; |
|
323 |
} |
|
324 |
|
|
325 |
public int getRows(int zoomLevel){ |
|
326 |
return rowsInZoomLevel.get(zoomLevel).size()*rowsPerTile; |
|
327 |
//rowsPerZoomLevel.get(zoomLevel); |
|
328 |
} |
|
329 |
|
|
330 |
public int getColumns(int zoomLevel){ |
|
331 |
return columnsInZoomLevel.get(zoomLevel).size()*columnsPerTile; |
|
332 |
|
|
333 |
// return columnsPerZoomLevel.get(zoomLevel); |
|
334 |
} |
|
335 |
|
|
336 |
public Envelope getEnvelopePerZoomLevel(int zoomLevel){ |
|
337 |
return envelopePerZoomLevel.get(zoomLevel); |
|
338 |
} |
|
339 |
|
|
340 |
public int getRowsPerTile() { |
|
341 |
return rowsPerTile; |
|
342 |
} |
|
343 |
|
|
344 |
public int getColumnsPerTile() { |
|
345 |
return columnsPerTile; |
|
346 |
} |
|
347 |
|
|
348 |
public String getProviderName() { |
|
349 |
return providerName; |
|
350 |
} |
|
351 |
|
|
352 |
|
|
353 |
public RasterStore getTileStore() { |
|
354 |
return tileStore; |
|
355 |
} |
|
356 |
} |
|
357 |
|
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/java/org/gvsig/raster/tilecache/provider/TileCacheLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
|
|
24 |
package org.gvsig.raster.tilecache.provider; |
|
25 |
|
|
26 |
import java.util.ArrayList; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.gvsig.fmap.dal.DALFileLibrary; |
|
30 |
import org.gvsig.fmap.dal.DALFileLocator; |
|
31 |
import org.gvsig.fmap.dal.DALLibrary; |
|
32 |
import org.gvsig.fmap.dal.FileHelper; |
|
33 |
import org.gvsig.fmap.dal.spi.DALSPILocator; |
|
34 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
|
35 |
import org.gvsig.metadata.exceptions.MetadataException; |
|
36 |
import org.gvsig.tools.library.AbstractLibrary; |
|
37 |
import org.gvsig.tools.library.LibraryException; |
|
38 |
|
|
39 |
/** |
|
40 |
* Jimi Library to register provider commponents |
|
41 |
* @author dmartinezizquierdo |
|
42 |
* |
|
43 |
*/ |
|
44 |
public class TileCacheLibrary extends AbstractLibrary { |
|
45 |
|
|
46 |
@Override |
|
47 |
public void doRegistration() { |
|
48 |
registerAsServiceOf(DALLibrary.class); |
|
49 |
require(DALFileLibrary.class); |
|
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
@Override |
|
54 |
protected void doInitialize() throws LibraryException { |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
protected void doPostInitialize() throws LibraryException { |
|
59 |
List<Throwable> exs = new ArrayList<Throwable>(); |
|
60 |
|
|
61 |
FileHelper.registerParametersDefinition( |
|
62 |
TileCacheStoreProviderParameters.PARAMETERS_DEFINITION_NAME, |
|
63 |
TileCacheStoreProviderParameters.class, "TileCacheParameters.xml"); |
|
64 |
try { |
|
65 |
FileHelper.registerMetadataDefinition( |
|
66 |
TileCacheStoreProvider.METADATA_DEFINITION_NAME, |
|
67 |
TileCacheStoreProvider.class, "TileCacheMetadata.xml"); |
|
68 |
} catch (MetadataException e) { |
|
69 |
exs.add(e); |
|
70 |
} |
|
71 |
|
|
72 |
DataManagerProviderServices dataman = DALSPILocator.getDataManagerProviderServices(); |
|
73 |
|
|
74 |
|
|
75 |
try { |
|
76 |
if (!dataman.getStoreProviders() |
|
77 |
.contains(TileCacheStoreProvider.NAME)) { |
|
78 |
dataman.registerStoreProviderFactory( |
|
79 |
new TileCacheStoreProviderFactory( |
|
80 |
TileCacheStoreProvider.NAME, |
|
81 |
TileCacheStoreProvider.DESCRIPTION)); |
|
82 |
} |
|
83 |
} catch (RuntimeException e) { |
|
84 |
exs.add(e); |
|
85 |
} |
|
86 |
|
|
87 |
// try { |
|
88 |
// DALFileLocator.getFilesystemServerExplorerManager() |
|
89 |
// .registerProvider(TileCacheStoreProvider.NAME, |
|
90 |
// TileCacheStoreProvider.DESCRIPTION, |
|
91 |
// TileCacheFileSystemServerProvider.class); |
|
92 |
// } catch (RuntimeException e) { |
|
93 |
// exs.add(e); |
|
94 |
// } |
|
95 |
|
|
96 |
if (exs.size() > 0) { |
|
97 |
throw new LibraryException(this.getClass(), exs); |
|
98 |
} |
|
99 |
} |
|
100 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.tilecache.provider.TileCacheLibrary |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/resources/org/gvsig/raster/tilecache/provider/TileCacheMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields of a Tile Cache file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
|
|
9 |
<class name="TileCache" namespace="Metadata"> |
|
10 |
<extends> |
|
11 |
<class namespace="Metadata" name="SpatialProvider"/> |
|
12 |
</extends> |
|
13 |
<description>Metadata of a Tile Cache store</description> |
|
14 |
<fields> |
|
15 |
</fields> |
|
16 |
</class> |
|
17 |
|
|
18 |
</classes> |
|
19 |
</definitions> |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/src/main/resources/org/gvsig/raster/tilecache/provider/TileCacheParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="TileCacheStoreProviderParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a tile cache file</description> |
|
10 |
<fields> |
|
11 |
<field name="name" type="string" mandatory="true" group="Basic"> |
|
12 |
<description>Name to identify the tile structure</description> |
|
13 |
</field> |
|
14 |
<field name="crs" type="crs" mandatory="true" group="Basic"> |
|
15 |
<description>The coordinate reference system used in this jimi file</description> |
|
16 |
</field> |
|
17 |
<field name="wldParams" type="object" mandatory="false" group="Basic" classOfValue="java.util.List"> |
|
18 |
<description>Info given by a wld file with geolocation</description> |
|
19 |
</field> |
|
20 |
</fields> |
|
21 |
</class> |
|
22 |
</classes> |
|
23 |
</definitions> |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.provider/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.raster.tilecache</artifactId> |
|
6 |
<version>2.4.1-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.raster.tilecache.provider</artifactId> |
|
9 |
<name>org.gvsig.raster.tilecache.provider</name> |
|
10 |
<description>Provider for tiled cache</description> |
|
11 |
|
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.fmap.dal.raster.spi</artifactId> |
|
16 |
</dependency> |
|
17 |
<dependency> |
|
18 |
<groupId>org.gvsig</groupId> |
|
19 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
20 |
</dependency> |
|
21 |
|
|
22 |
</dependencies> |
|
23 |
</project> |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.raster.tilecache</artifactId> |
|
6 |
<version>2.4.1-SNAPSHOT</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.raster.tilecache.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.raster.tilecache.app</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.raster.tilecache.app.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
Also available in: Unified diff