Revision 43876
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.api/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/MapContextRasterSwingManager.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.util.List; |
27 | 27 |
|
28 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
28 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
29 | 29 |
import org.gvsig.fmap.mapcontext.raster.swing.bands.BandsPanel; |
30 | 30 |
import org.gvsig.fmap.mapcontext.raster.swing.export.ExportRasterPanel; |
31 | 31 |
import org.gvsig.fmap.mapcontext.raster.swing.operations.OperationListPanel; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/RasterStoreBand.java | ||
---|---|---|
26 | 26 |
import org.slf4j.LoggerFactory; |
27 | 27 |
|
28 | 28 |
import org.gvsig.fmap.dal.exception.DataException; |
29 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
29 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
30 | 30 |
import org.gvsig.raster.lib.buffer.api.NoData; |
31 | 31 |
import org.gvsig.tools.dispose.DisposeUtils; |
32 | 32 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/bands/BandsPanelController.java | ||
---|---|---|
55 | 55 |
import org.gvsig.fmap.dal.exception.InitializeException; |
56 | 56 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
57 | 57 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
58 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
59 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
58 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
59 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
60 | 60 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter; |
61 | 61 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
62 | 62 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/DefaultSelectableBandDescriptorsTableModel.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import javax.swing.table.AbstractTableModel; |
31 | 31 |
|
32 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
32 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
33 | 33 |
import org.gvsig.fmap.mapcontext.raster.swing.SelectableBandDescriptorsTableModel; |
34 | 34 |
import org.gvsig.raster.swing.buffer.SelectableBandsTableModel; |
35 | 35 |
import org.gvsig.tools.ToolsLocator; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/DefaultMapContextRasterSwingManager.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import java.util.List; |
26 | 26 |
|
27 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
27 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
28 | 28 |
import org.gvsig.fmap.mapcontext.raster.swing.MapContextRasterSwingManager; |
29 | 29 |
import org.gvsig.fmap.mapcontext.raster.swing.SelectableBandDescriptorsTableModel; |
30 | 30 |
import org.gvsig.fmap.mapcontext.raster.swing.bands.BandsPanel; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.fmap.mapcontext.swing/org.gvsig.fmap.mapcontext.swing.impl/src/main/java/org/gvsig/fmap/mapcontext/raster/swing/impl/export/DefaultExportRasterPanel.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.mapcontext.raster.swing.impl.export; |
2 | 2 |
|
3 |
import java.beans.PropertyChangeEvent; |
|
4 |
import java.beans.PropertyChangeListener; |
|
5 | 3 |
import java.io.File; |
6 | 4 |
import java.nio.Buffer; |
7 | 5 |
import java.util.ArrayList; |
... | ... | |
10 | 8 |
|
11 | 9 |
import javax.swing.JComponent; |
12 | 10 |
import javax.swing.JFileChooser; |
13 |
import javax.swing.JPanel; |
|
14 | 11 |
|
15 | 12 |
import org.slf4j.Logger; |
16 | 13 |
import org.slf4j.LoggerFactory; |
... | ... | |
18 | 15 |
import org.gvsig.fmap.dal.DALLocator; |
19 | 16 |
import org.gvsig.fmap.dal.DataManager; |
20 | 17 |
import org.gvsig.fmap.dal.DataServerExplorer; |
21 |
import org.gvsig.fmap.dal.raster.api.NewRasterStoreParameters;
|
|
18 |
import org.gvsig.fmap.dal.raster.NewRasterStoreParameters; |
|
22 | 19 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter; |
23 | 20 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
24 | 21 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
... | ... | |
65 | 62 |
final JFileChooser jfc = new JFileChooser("/home/paco/tmp"); |
66 | 63 |
|
67 | 64 |
List dataStoreProviderNames = explorer.getDataStoreProviderNames(); |
68 |
List<FilesystemServerExplorerProvider> creationProviders = |
|
69 |
new ArrayList<FilesystemServerExplorerProvider>(); |
|
65 |
List<FilesystemServerExplorerProvider> creationProviders = new ArrayList<>(); |
|
70 | 66 |
Iterator filters = explorer.getFilters(DataServerExplorer.MODE_RASTER); |
71 | 67 |
while (filters.hasNext()) { |
72 | 68 |
FilesystemServerExplorerProvider provider = (FilesystemServerExplorerProvider) filters.next(); |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.imageio/src/main/java/org/gvsig/fmap/dal/file/imageio/legend/ImageIOGetLegend.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.file.imageio.legend; |
2 | 2 |
|
3 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
3 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
4 | 4 |
import org.gvsig.fmap.dal.spi.DataStoreProvider; |
5 | 5 |
import org.gvsig.raster.lib.legend.api.RasterLegend; |
6 | 6 |
import org.gvsig.raster.lib.legend.api.RasterLegendLocator; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.imageio/src/main/java/org/gvsig/fmap/dal/file/imageio/legend/ImageIOGetColorInterpretation.java | ||
---|---|---|
10 | 10 |
import java.util.List; |
11 | 11 |
import org.gvsig.fmap.dal.file.imageio.ImageIOStoreProvider; |
12 | 12 |
|
13 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
13 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
14 | 14 |
import org.gvsig.raster.lib.legend.api.RasterLegendLocator; |
15 | 15 |
import org.gvsig.raster.lib.legend.api.RasterLegendManager; |
16 | 16 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.imageio/src/main/java/org/gvsig/fmap/dal/file/imageio/legend/ImageIOGetColorTable.java | ||
---|---|---|
7 | 7 |
import java.util.List; |
8 | 8 |
import org.gvsig.fmap.dal.file.imageio.ImageIOStoreProvider; |
9 | 9 |
|
10 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
10 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
11 | 11 |
import org.gvsig.raster.lib.legend.api.RasterLegendLocator; |
12 | 12 |
import org.gvsig.raster.lib.legend.api.RasterLegendManager; |
13 | 13 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTable; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.tilecache/src/main/java/org/gvsig/raster/tilecache/provider/legend/TileCacheGetColorInterpretation.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.tilecache.provider.legend; |
2 | 2 |
|
3 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
3 | 4 |
import org.slf4j.LoggerFactory; |
4 | 5 |
|
5 |
import org.gvsig.fmap.dal.exception.DataException; |
|
6 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
7 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
8 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
9 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
|
10 | 6 |
import org.gvsig.raster.lib.legend.api.colorinterpretation.ColorInterpretation; |
11 | 7 |
import org.gvsig.raster.tilecache.provider.TileCacheStoreProvider; |
12 | 8 |
import org.gvsig.raster.tilecache.provider.TileStructImage; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.tilecache/src/main/java/org/gvsig/raster/tilecache/provider/legend/TileCacheGetColorTable.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.tilecache.provider.legend; |
2 | 2 |
|
3 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
4 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTable; |
|
3 | 5 |
import org.slf4j.LoggerFactory; |
4 | 6 |
|
5 |
import org.gvsig.fmap.dal.exception.DataException; |
|
6 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
7 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
8 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
9 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
|
10 |
import org.gvsig.raster.lib.legend.api.colortable.ColorTable; |
|
7 |
|
|
11 | 8 |
import org.gvsig.raster.tilecache.provider.TileCacheStoreProvider; |
12 | 9 |
import org.gvsig.raster.tilecache.provider.TileStructImage; |
13 | 10 |
import org.gvsig.tools.ToolsLocator; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.legend/org.gvsig.raster.legend.tilecache/src/main/java/org/gvsig/raster/tilecache/provider/legend/TileCacheGetLegend.java | ||
---|---|---|
1 | 1 |
package org.gvsig.raster.tilecache.provider.legend; |
2 | 2 |
|
3 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
3 | 4 |
import org.slf4j.LoggerFactory; |
4 | 5 |
|
5 |
import org.gvsig.fmap.dal.exception.DataException; |
|
6 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
7 |
import org.gvsig.fmap.dal.raster.api.RasterStore; |
|
8 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
|
9 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
|
10 | 6 |
import org.gvsig.raster.lib.legend.api.RasterLegend; |
11 | 7 |
import org.gvsig.raster.tilecache.provider.TileCacheStoreProvider; |
12 | 8 |
import org.gvsig.raster.tilecache.provider.TileStructImage; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.tools/org.gvsig.raster.tools.lib/org.gvsig.raster.tools.lib.api/src/main/java/org/gvsig/raster/tools/lib/api/RasterClip.java | ||
---|---|---|
25 | 25 |
import java.io.File; |
26 | 26 |
import java.util.List; |
27 | 27 |
|
28 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor; |
|
29 | 28 |
import org.gvsig.fmap.geom.primitive.Envelope; |
30 | 29 |
import org.gvsig.fmap.mapcontext.raster.api.RasterLayer; |
31 | 30 |
import org.gvsig.raster.tools.lib.api.exceptions.ClipException; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.tools/org.gvsig.raster.tools.lib/org.gvsig.raster.tools.lib.impl/src/main/java/org/gvsig/raster/tools/lib/impl/DefaultRasterClip.java | ||
---|---|---|
16 | 16 |
import org.gvsig.fmap.dal.exception.InitializeException; |
17 | 17 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
18 | 18 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
19 |
import org.gvsig.fmap.dal.raster.api.NewRasterStoreParameters;
|
|
20 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
21 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
19 |
import org.gvsig.fmap.dal.raster.NewRasterStoreParameters; |
|
20 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
21 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
22 | 22 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
23 | 23 |
import org.gvsig.fmap.dal.spi.DALSPILocator; |
24 | 24 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
... | ... | |
66 | 66 |
public DefaultRasterClip() { |
67 | 67 |
} |
68 | 68 |
|
69 |
@Override |
|
69 | 70 |
public RasterLayer getLayer() { |
70 | 71 |
return layer; |
71 | 72 |
} |
72 | 73 |
|
74 |
@Override |
|
73 | 75 |
public void setLayer(RasterLayer layer) { |
74 | 76 |
this.layer = layer; |
75 | 77 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.tools/org.gvsig.raster.tools.swing/org.gvsig.raster.tools.swing.impl/src/main/java/org/gvsig/raster/tools/swing/impl/converttype/ConvertTypePanelController.java | ||
---|---|---|
32 | 32 |
import org.slf4j.LoggerFactory; |
33 | 33 |
|
34 | 34 |
import org.gvsig.fmap.dal.exception.DataException; |
35 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
35 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
36 | 36 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
37 | 37 |
import org.gvsig.fmap.mapcontext.raster.api.RasterLayer; |
38 | 38 |
import org.gvsig.raster.lib.buffer.api.Buffer; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster.tools/org.gvsig.raster.tools.swing/org.gvsig.raster.tools.swing.impl/src/main/java/org/gvsig/raster/tools/swing/impl/clip/ClipPanelController.java | ||
---|---|---|
52 | 52 |
import org.gvsig.fmap.IconThemeHelper; |
53 | 53 |
import org.gvsig.fmap.dal.exception.DataException; |
54 | 54 |
import org.gvsig.fmap.dal.exception.InitializeException; |
55 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
56 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
57 |
import org.gvsig.fmap.dal.raster.api.RasterSet;
|
|
58 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
55 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
56 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
57 |
import org.gvsig.fmap.dal.raster.RasterSet; |
|
58 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
59 | 59 |
import org.gvsig.fmap.geom.Geometry.DIMENSIONS; |
60 | 60 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
61 | 61 |
import org.gvsig.fmap.geom.GeometryLocator; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer.api/src/main/java/org/gvsig/raster/lib/buffer/api/Buffer.java | ||
---|---|---|
222 | 222 |
*/ |
223 | 223 |
public int[] getBandTypes(); |
224 | 224 |
|
225 |
public boolean areAllBandsOfTheSameType(); |
|
226 |
|
|
225 | 227 |
/** |
226 | 228 |
* @return Gets NoData object from buffer bands |
227 | 229 |
*/ |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/AbstractBuffer.java | ||
---|---|---|
492 | 492 |
return bandDataTypes; |
493 | 493 |
} |
494 | 494 |
|
495 |
@Override |
|
496 |
public boolean areAllBandsOfTheSameType() { |
|
497 |
if( this.bands.isEmpty() ) { |
|
498 |
return true; |
|
499 |
} |
|
500 |
int type = this.bands.get(0).getDataType(); |
|
501 |
for (int i = 1; i < this.bands.size(); i++) { |
|
502 |
if( type != this.bands.get(i).getDataType() ) { |
|
503 |
return false; |
|
504 |
} |
|
505 |
} |
|
506 |
return true; |
|
507 |
} |
|
508 |
|
|
495 | 509 |
public NoData[] getBandNoData() { |
496 | 510 |
NoData[] bandNoData = new NoData[this.getBandCount()]; |
497 | 511 |
for (int i = 0; i < this.bands.size(); i++) { |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.library/org.gvsig.raster/org.gvsig.raster.swing/org.gvsig.raster.swing.buffer/org.gvsig.raster.swing.buffer.impl/src/main/java/org/gvsig/raster/swing/buffer/impl/save/DefaultSaveBufferDialog.java | ||
---|---|---|
45 | 45 |
import org.gvsig.fmap.dal.exception.InitializeException; |
46 | 46 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
47 | 47 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
48 |
import org.gvsig.fmap.dal.raster.api.NewRasterStoreParameters;
|
|
48 |
import org.gvsig.fmap.dal.raster.NewRasterStoreParameters; |
|
49 | 49 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemFileFilter; |
50 | 50 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
51 | 51 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/CoverageStoreProvider.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.fmap.dal.raster.spi; |
|
26 |
|
|
27 |
import org.gvsig.fmap.dal.spi.DataStoreProvider; |
|
28 |
|
|
29 |
public interface CoverageStoreProvider extends DataStoreProvider { |
|
30 |
public String getProviderName(); |
|
31 |
|
|
32 |
public CoverageStoreProviderServices getStoreServices(); |
|
33 |
|
|
34 |
public boolean allowWrite(); |
|
35 |
|
|
36 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/AbstractCoverageStoreProvider.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.fmap.dal.raster.spi; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.DALLocator; |
|
27 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
28 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
29 |
import org.gvsig.fmap.dal.exception.CloseException; |
|
30 |
import org.gvsig.fmap.dal.exception.DataException; |
|
31 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
32 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
33 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
34 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
35 |
import org.gvsig.fmap.dal.raster.CoverageSelection; |
|
36 |
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices; |
|
37 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
|
38 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
39 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
40 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
|
41 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
42 |
import org.gvsig.tools.dynobject.DynClass; |
|
43 |
import org.gvsig.tools.dynobject.DynObject; |
|
44 |
import org.gvsig.tools.dynobject.DynObject_v2; |
|
45 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
46 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
|
47 |
import org.gvsig.tools.exception.BaseException; |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* @author jmvivo |
|
52 |
* |
|
53 |
*/ |
|
54 |
public abstract class AbstractCoverageStoreProvider extends AbstractDisposable |
|
55 |
implements CoverageStoreProvider { |
|
56 |
protected CoverageStoreProviderServices store; |
|
57 |
protected DelegatedDynObject metadata; |
|
58 |
protected DataStoreParameters parameters; |
|
59 |
|
|
60 |
|
|
61 |
protected AbstractCoverageStoreProvider(DataStoreParameters params, |
|
62 |
DataStoreProviderServices storeServices, DynObject metadata) { |
|
63 |
init(params, storeServices, metadata); |
|
64 |
} |
|
65 |
|
|
66 |
protected AbstractCoverageStoreProvider(DataStoreParameters params, |
|
67 |
DataStoreProviderServices storeServices) { |
|
68 |
init(params, storeServices, null); |
|
69 |
} |
|
70 |
|
|
71 |
protected AbstractCoverageStoreProvider() { |
|
72 |
} |
|
73 |
|
|
74 |
protected void init(DataStoreParameters params, |
|
75 |
DataStoreProviderServices storeServices, DynObject metadata) { |
|
76 |
this.store = (CoverageStoreProviderServices) storeServices; |
|
77 |
this.metadata = (DelegatedDynObject) metadata; |
|
78 |
this.parameters = params; |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* Gets the DataStoreParameters |
|
83 |
* @return DataStoreParameters |
|
84 |
*/ |
|
85 |
public DataStoreParameters getDataStoreParameters() { |
|
86 |
return parameters; |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* Set metada container if this not set at construction time and only in one |
|
91 |
* time. In other case an Exception will be throw |
|
92 |
* |
|
93 |
* @param metadata |
|
94 |
*/ |
|
95 |
protected void setMetadata(DynObject metadata) { |
|
96 |
if (this.metadata != null) { |
|
97 |
// FIXME Exception |
|
98 |
throw new IllegalStateException(); |
|
99 |
} |
|
100 |
this.metadata = (DelegatedDynObject) metadata; |
|
101 |
} |
|
102 |
|
|
103 |
protected ResourceProvider createResource(String type, Object[] params) |
|
104 |
throws InitializeException { |
|
105 |
ResourceManagerProviderServices manager = (ResourceManagerProviderServices) DALLocator |
|
106 |
.getResourceManager(); |
|
107 |
ResourceProvider resource = manager.createAddResource(type, params); |
|
108 |
return resource; |
|
109 |
} |
|
110 |
|
|
111 |
public CoverageStoreProviderServices getStoreServices() { |
|
112 |
return this.store; |
|
113 |
} |
|
114 |
|
|
115 |
public String getClassName() { |
|
116 |
return this.getClass().getName(); |
|
117 |
} |
|
118 |
|
|
119 |
public boolean allowWrite() { |
|
120 |
return false; |
|
121 |
} |
|
122 |
|
|
123 |
public CoverageSelection createCoverageSelection() throws DataException { |
|
124 |
return this.store.createDefaultCoverageSelection(); |
|
125 |
} |
|
126 |
|
|
127 |
public void refresh() throws OpenException { |
|
128 |
// Do nothing by default |
|
129 |
} |
|
130 |
|
|
131 |
public void close() throws CloseException { |
|
132 |
// Do nothing by default |
|
133 |
} |
|
134 |
|
|
135 |
protected void doDispose() throws BaseException { |
|
136 |
this.metadata = null; |
|
137 |
this.store = null; |
|
138 |
this.parameters = null; |
|
139 |
} |
|
140 |
|
|
141 |
public Envelope getEnvelope() throws DataException { |
|
142 |
return null; |
|
143 |
} |
|
144 |
|
|
145 |
public abstract DataServerExplorer getExplorer() throws ReadException, |
|
146 |
ValidateDataParametersException; |
|
147 |
|
|
148 |
public void delegate(DynObject dynObject) { |
|
149 |
if (this.metadata == null) { |
|
150 |
return; |
|
151 |
} |
|
152 |
this.metadata.delegate(dynObject); |
|
153 |
} |
|
154 |
|
|
155 |
public DynClass getDynClass() { |
|
156 |
if (this.metadata == null) { |
|
157 |
return null; |
|
158 |
} |
|
159 |
return this.metadata.getDynClass(); |
|
160 |
} |
|
161 |
|
|
162 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
|
163 |
if (this.metadata == null) { |
|
164 |
return null; |
|
165 |
} |
|
166 |
// TODO this.open?? |
|
167 |
return this.metadata.getDynValue(name); |
|
168 |
} |
|
169 |
|
|
170 |
public boolean hasDynValue(String name) { |
|
171 |
if (this.metadata == null) { |
|
172 |
return false; |
|
173 |
} |
|
174 |
// TODO this.open?? |
|
175 |
return this.metadata.hasDynValue(name); |
|
176 |
} |
|
177 |
|
|
178 |
@Override |
|
179 |
public boolean hasDynMethod(String name) { |
|
180 |
if( metadata instanceof DynObject_v2 ) { |
|
181 |
return ((DynObject_v2)this.metadata).hasDynMethod(name); |
|
182 |
} |
|
183 |
return false; |
|
184 |
} |
|
185 |
|
|
186 |
public void implement(DynClass dynClass) { |
|
187 |
if (this.metadata == null) { |
|
188 |
return; |
|
189 |
} |
|
190 |
this.metadata.implement(dynClass); |
|
191 |
|
|
192 |
} |
|
193 |
|
|
194 |
public Object invokeDynMethod(int code, Object[] args) |
|
195 |
throws DynMethodException { |
|
196 |
if (this.metadata == null) { |
|
197 |
return null; |
|
198 |
} |
|
199 |
// TODO this.open?? |
|
200 |
return this.metadata.invokeDynMethod(this, code, args); |
|
201 |
} |
|
202 |
|
|
203 |
public Object invokeDynMethod(String name, Object[] args) |
|
204 |
throws DynMethodException { |
|
205 |
if (this.metadata == null) { |
|
206 |
return null; |
|
207 |
} |
|
208 |
// TODO this.open?? |
|
209 |
return this.metadata.invokeDynMethod(this, name, args); |
|
210 |
} |
|
211 |
|
|
212 |
public void setDynValue(String name, Object value) |
|
213 |
throws DynFieldNotFoundException { |
|
214 |
if (this.metadata == null) { |
|
215 |
return; |
|
216 |
} |
|
217 |
// TODO this.open?? |
|
218 |
this.metadata.setDynValue(name, value); |
|
219 |
} |
|
220 |
|
|
221 |
public void clear() { |
|
222 |
if (metadata != null) { |
|
223 |
metadata.clear(); |
|
224 |
} |
|
225 |
} |
|
226 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/CoverageStoreProviderServices.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.fmap.dal.raster.spi; |
|
26 |
|
|
27 |
import org.gvsig.fmap.dal.DataManager; |
|
28 |
import org.gvsig.fmap.dal.exception.DataException; |
|
29 |
import org.gvsig.fmap.dal.raster.CoverageSelection; |
|
30 |
import org.gvsig.fmap.dal.raster.CoverageStore; |
|
31 |
import org.gvsig.fmap.dal.resource.Resource; |
|
32 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
33 |
import org.gvsig.tools.undo.command.Command; |
|
34 |
|
|
35 |
public interface CoverageStoreProviderServices extends |
|
36 |
DataStoreProviderServices, CoverageStore { |
|
37 |
public void notifyChange(String notification); |
|
38 |
|
|
39 |
public void notifyChange(String notification, Resource resource); |
|
40 |
|
|
41 |
public void notifyChange(String notification, Command command); |
|
42 |
|
|
43 |
public CoverageSelection createDefaultCoverageSelection() |
|
44 |
throws DataException; |
|
45 |
|
|
46 |
public DataManager getManager(); |
|
47 |
|
|
48 |
public CoverageStoreProvider getProvider(); |
|
49 |
|
|
50 |
public CoverageStore getCoverageStore(); |
|
51 |
|
|
52 |
|
|
53 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/BandDescriptorServices.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.raster.spi; |
2 | 2 |
|
3 |
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor;
|
|
4 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
3 |
import org.gvsig.fmap.dal.raster.BandAttributeDescriptor; |
|
4 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
5 | 5 |
|
6 | 6 |
|
7 | 7 |
public interface BandDescriptorServices extends BandDescriptor { |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/AbstractAwtRasterStoreProvider.java | ||
---|---|---|
16 | 16 |
import org.gvsig.fmap.dal.DataStoreParameters; |
17 | 17 |
import org.gvsig.fmap.dal.exception.CloseException; |
18 | 18 |
import org.gvsig.fmap.dal.exception.InitializeException; |
19 |
import org.gvsig.fmap.dal.raster.api.BandQuery;
|
|
20 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
19 |
import org.gvsig.fmap.dal.raster.BandQuery; |
|
20 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
21 | 21 |
import org.gvsig.fmap.dal.raster.spi.AbstractOpenRasterStoreParameters; |
22 | 22 |
import org.gvsig.fmap.dal.raster.spi.AbstractRasterStoreProvider; |
23 | 23 |
import org.gvsig.fmap.dal.raster.spi.BandDescriptorServices; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/RasterStoreProvider.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.dal.DataStoreParameters; |
28 | 28 |
import org.gvsig.fmap.dal.exception.InitializeException; |
29 |
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor;
|
|
30 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
31 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
29 |
import org.gvsig.fmap.dal.raster.BandAttributeDescriptor; |
|
30 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
31 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
32 | 32 |
import org.gvsig.fmap.dal.spi.DataStoreProvider; |
33 | 33 |
import org.gvsig.raster.lib.buffer.api.BandInfo; |
34 | 34 |
import org.gvsig.raster.lib.buffer.api.Buffer; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/AbstractRasterStoreProvider.java | ||
---|---|---|
36 | 36 |
import org.gvsig.fmap.dal.exception.CloseException; |
37 | 37 |
import org.gvsig.fmap.dal.exception.InitializeException; |
38 | 38 |
import org.gvsig.fmap.dal.exception.OpenException; |
39 |
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor;
|
|
40 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
41 |
import org.gvsig.fmap.dal.raster.api.BandQuery;
|
|
42 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
39 |
import org.gvsig.fmap.dal.raster.BandAttributeDescriptor; |
|
40 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
41 |
import org.gvsig.fmap.dal.raster.BandQuery; |
|
42 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
43 | 43 |
import org.gvsig.fmap.dal.resource.ResourceManager; |
44 | 44 |
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices; |
45 | 45 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/RasterCacheStoreProvider.java | ||
---|---|---|
25 | 25 |
import org.cresques.cts.IProjection; |
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.dal.exception.DataException; |
28 |
import org.gvsig.fmap.dal.raster.api.RasterCache;
|
|
29 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
30 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
28 |
import org.gvsig.fmap.dal.raster.RasterCache; |
|
29 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
30 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
31 | 31 |
|
32 | 32 |
|
33 | 33 |
/** |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/RasterStoreProviderServices.java | ||
---|---|---|
25 | 25 |
import java.util.List; |
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.dal.DataManager; |
28 |
import org.gvsig.fmap.dal.raster.api.BandAttributeDescriptor;
|
|
29 |
import org.gvsig.fmap.dal.raster.api.BandDescriptor;
|
|
30 |
import org.gvsig.fmap.dal.raster.api.RasterStore;
|
|
28 |
import org.gvsig.fmap.dal.raster.BandAttributeDescriptor; |
|
29 |
import org.gvsig.fmap.dal.raster.BandDescriptor; |
|
30 |
import org.gvsig.fmap.dal.raster.RasterStore; |
|
31 | 31 |
import org.gvsig.fmap.dal.resource.Resource; |
32 | 32 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
33 | 33 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/BSQLibrary.java | ||
---|---|---|
94 | 94 |
new BSQFileSystemServerProviderFactory( |
95 | 95 |
NAME, |
96 | 96 |
DESCRIPTION, |
97 |
FILE_EXTENSIONS, |
|
98 |
true |
|
97 |
FILE_EXTENSIONS |
|
99 | 98 |
) |
100 | 99 |
); |
101 | 100 |
} catch (Exception e) { |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/AbstractFileRasterStoreProvider.java | ||
---|---|---|
8 | 8 |
import java.util.Map; |
9 | 9 |
import org.apache.commons.io.FilenameUtils; |
10 | 10 |
import org.cresques.cts.IProjection; |
11 |
import org.gvsig.basicformats.FormatsFile; |
|
12 |
import org.gvsig.basicformats.PRJFile; |
|
13 |
import org.gvsig.basicformats.STXFile; |
|
14 |
import org.gvsig.basicformats.WLDFile; |
|
11 | 15 |
import org.gvsig.fmap.dal.DALLocator; |
12 | 16 |
import org.gvsig.fmap.dal.DataManager; |
13 | 17 |
import org.gvsig.fmap.dal.DataServerExplorer; |
... | ... | |
19 | 23 |
import org.gvsig.fmap.dal.exception.OpenException; |
20 | 24 |
import org.gvsig.fmap.dal.exception.ReadException; |
21 | 25 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
22 |
import org.gvsig.fmap.dal.fileutils.CLRFile; |
|
23 |
import org.gvsig.fmap.dal.fileutils.PRJFile; |
|
24 |
import org.gvsig.fmap.dal.fileutils.STXFile; |
|
25 |
import org.gvsig.fmap.dal.fileutils.WLDFile; |
|
26 |
import org.gvsig.fmap.dal.fileutils.spi.UtilsFile; |
|
27 | 26 |
import org.gvsig.fmap.dal.raster.OpenRasterStoreParameters; |
28 |
import org.gvsig.fmap.dal.raster.api.BandQuery;
|
|
29 |
import org.gvsig.fmap.dal.raster.api.RasterQuery;
|
|
27 |
import org.gvsig.fmap.dal.raster.BandQuery; |
|
28 |
import org.gvsig.fmap.dal.raster.RasterQuery; |
|
30 | 29 |
import org.gvsig.fmap.dal.raster.spi.AbstractAwtRasterStoreProvider; |
31 | 30 |
import org.gvsig.fmap.dal.raster.spi.AbstractRasterStoreProvider; |
32 | 31 |
import org.gvsig.fmap.dal.resource.file.FileResource; |
... | ... | |
97 | 96 |
new NullPointerException(this.storeProviderName +" file is null")); |
98 | 97 |
} |
99 | 98 |
|
100 |
this.wldFile = UtilsFile.createWLDFile(this.getFile());
|
|
101 |
this.prjFile = UtilsFile.createPRJFile(this.getFile());
|
|
102 |
this.stxFile = UtilsFile.createSTXFile(this.getFile());
|
|
99 |
this.wldFile = FormatsFile.getWLDFile(this.getFile());
|
|
100 |
this.prjFile = FormatsFile.getPRJFile(this.getFile());
|
|
101 |
this.stxFile = FormatsFile.getSTXFile(this.getFile());
|
|
103 | 102 |
// this.clrFile = UtilsFile.createCLRFile(this.getFile()); |
104 | 103 |
|
105 | 104 |
this.projection = (IProjection) params.getDynValue(DataStore.METADATA_CRS); |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/BSQFileSystemServerProvider.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.fmap.dal.file.bsq; |
24 | 24 |
|
25 |
import java.io.DataOutputStream; |
|
25 | 26 |
import java.io.File; |
27 |
import java.io.FileOutputStream; |
|
28 |
import java.io.IOException; |
|
29 |
import java.nio.ByteOrder; |
|
26 | 30 |
import org.apache.commons.io.FilenameUtils; |
31 |
import org.apache.commons.io.IOUtils; |
|
32 |
import org.gvsig.basicformats.FormatsFile; |
|
33 |
import org.gvsig.basicformats.HDRFile; |
|
27 | 34 |
|
28 | 35 |
import org.gvsig.fmap.dal.DataServerExplorer; |
29 | 36 |
import org.gvsig.fmap.dal.NewDataStoreParameters; |
30 | 37 |
import org.gvsig.fmap.dal.exception.CreateException; |
31 | 38 |
import org.gvsig.fmap.dal.exception.DataException; |
39 |
import org.gvsig.fmap.dal.raster.NewRasterStoreParameters; |
|
40 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
|
32 | 41 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider; |
42 |
import org.gvsig.raster.lib.buffer.api.Band; |
|
43 |
import org.gvsig.raster.lib.buffer.api.Buffer; |
|
44 |
import org.gvsig.raster.lib.buffer.api.BufferDimensions; |
|
45 |
import org.gvsig.raster.lib.buffer.api.BufferManager; |
|
33 | 46 |
|
34 | 47 |
public class BSQFileSystemServerProvider extends AbstractFilesystemServerExplorerProvider { |
35 | 48 |
|
36 | 49 |
protected String[] fileExtensions; |
37 |
protected boolean canCreate; |
|
38 | 50 |
|
39 | 51 |
public BSQFileSystemServerProvider( |
40 |
String name,
|
|
41 |
String description,
|
|
52 |
String name, |
|
53 |
String description, |
|
42 | 54 |
String[] fileExtensions |
43 |
) { |
|
44 |
this(name, description, fileExtensions, false); |
|
45 |
} |
|
46 |
|
|
47 |
public BSQFileSystemServerProvider( |
|
48 |
String name, |
|
49 |
String description, |
|
50 |
String[] fileExtensions, |
|
51 |
boolean canCreate |
|
52 |
) { |
|
55 |
) { |
|
53 | 56 |
super(name, description); |
54 | 57 |
this.fileExtensions = fileExtensions; |
55 |
this.canCreate = canCreate; |
|
56 | 58 |
} |
57 |
|
|
59 |
|
|
58 | 60 |
@Override |
59 | 61 |
public boolean canCreate() { |
60 |
return canCreate;
|
|
62 |
return true;
|
|
61 | 63 |
} |
62 | 64 |
|
63 | 65 |
@Override |
... | ... | |
67 | 69 |
|
68 | 70 |
@Override |
69 | 71 |
public void create(NewDataStoreParameters parameters, boolean overwrite) throws CreateException { |
70 |
throw new UnsupportedOperationException(); |
|
72 |
FileOutputStream fos = null; |
|
73 |
try { |
|
74 |
Buffer buffer = ((NewRasterStoreParameters) parameters).getBuffer(); |
|
75 |
if (!buffer.areAllBandsOfTheSameType()) { |
|
76 |
throw new IllegalArgumentException("The BSQ format does not support bands of different types."); |
|
77 |
} |
|
78 |
BufferDimensions dimensions = buffer.getDimensions(); |
|
79 |
File file = ((FilesystemStoreParameters) parameters).getFile(); |
|
80 |
fos = new FileOutputStream(file); |
|
81 |
DataOutputStream dos = new DataOutputStream(fos); |
|
82 |
HDRFile hdr = FormatsFile.createHDRFile(); |
|
83 |
hdr.setDataType(buffer.getBandTypes()[0]); |
|
84 |
hdr.setNBands(buffer.getBandCount()); |
|
85 |
hdr.setByteOrder(ByteOrder.nativeOrder()); |
|
86 |
hdr.setDimensions( |
|
87 |
dimensions.getRows(), |
|
88 |
dimensions.getColumns(), |
|
89 |
dimensions.getEnvelope() |
|
90 |
); |
|
91 |
for (int nband = 0; nband < buffer.getBandCount(); nband++) { |
|
92 |
writeBand(dos, buffer.getBand(nband)); |
|
93 |
} |
|
94 |
hdr.write(file); |
|
95 |
} catch (Exception ex) { |
|
96 |
throw new CreateException(this.getName(), ex); |
|
97 |
} finally { |
|
98 |
IOUtils.closeQuietly(fos); |
|
99 |
} |
|
71 | 100 |
} |
72 |
|
|
101 |
|
|
102 |
void writeBand(DataOutputStream dos, Band band) throws IOException { |
|
103 |
int dataType = band.getDataType(); |
|
104 |
Object rowBuffer = band.createRowBuffer(); |
|
105 |
for (int row = 0; row < band.getRows(); row++) { |
|
106 |
band.fetchRow(row, rowBuffer); |
|
107 |
switch (dataType) { |
|
108 |
case BufferManager.TYPE_BYTE: |
|
109 |
byte[] byteBuffer = (byte[]) rowBuffer; |
|
110 |
for (int n = 0; n < byteBuffer.length; n++) { |
|
111 |
dos.writeByte(byteBuffer[n]); |
|
112 |
} |
|
113 |
break; |
|
114 |
case BufferManager.TYPE_SHORT: |
|
115 |
case BufferManager.TYPE_USHORT: |
|
116 |
short[] shortBuffer = (short[]) rowBuffer; |
|
117 |
for (int n = 0; n < shortBuffer.length; n++) { |
|
118 |
dos.writeShort(shortBuffer[n]); |
|
119 |
} |
|
120 |
break; |
|
121 |
case BufferManager.TYPE_INT: |
|
122 |
int[] intBuffer = (int[]) rowBuffer; |
|
123 |
for (int n = 0; n < intBuffer.length; n++) { |
|
124 |
dos.writeInt(intBuffer[n]); |
|
125 |
} |
|
126 |
break; |
|
127 |
case BufferManager.TYPE_FLOAT: |
|
128 |
float[] floatBuffer = (float[]) rowBuffer; |
|
129 |
for (int n = 0; n < floatBuffer.length; n++) { |
|
130 |
dos.writeFloat(floatBuffer[n]); |
|
131 |
} |
|
132 |
break; |
|
133 |
|
|
134 |
case BufferManager.TYPE_DOUBLE: |
|
135 |
double[] doubleBuffer = (double[]) rowBuffer; |
|
136 |
for (int n = 0; n < doubleBuffer.length; n++) { |
|
137 |
dos.writeDouble(doubleBuffer[n]); |
|
138 |
} |
|
139 |
break; |
|
140 |
|
|
141 |
default: |
|
142 |
throw new IllegalArgumentException("Data Type " + dataType + " not supported."); |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
|
|
73 | 147 |
@Override |
74 | 148 |
public int getMode() { |
75 | 149 |
return DataServerExplorer.MODE_RASTER; |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/BSQStoreProvider.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import java.io.IOException; |
26 | 26 |
import java.util.ArrayList; |
27 |
import org.gvsig.basicformats.FormatsFile; |
|
28 |
import org.gvsig.basicformats.HDRFile; |
|
27 | 29 |
import org.gvsig.fmap.dal.exception.InitializeException; |
28 | 30 |
import org.gvsig.fmap.dal.exception.OpenException; |
29 |
import org.gvsig.fmap.dal.fileutils.HDRFile; |
|
30 |
import org.gvsig.fmap.dal.fileutils.spi.UtilsFile; |
|
31 | 31 |
import org.gvsig.fmap.dal.raster.OpenRasterStoreParameters; |
32 | 32 |
import org.gvsig.fmap.dal.raster.spi.BandDescriptorServices; |
33 | 33 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
... | ... | |
37 | 37 |
|
38 | 38 |
// https://www.qgistutorials.com/en/docs/open_bil_bip_bsq_files.html |
39 | 39 |
// http://glcf.umd.edu/data/landcover/data.shtml |
40 |
|
|
41 | 40 |
protected HDRFile hdrFile; |
42 | 41 |
|
43 | 42 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
44 | 43 |
public BSQStoreProvider( |
45 | 44 |
String name, |
46 | 45 |
String description, |
47 |
OpenRasterStoreParameters params,
|
|
46 |
OpenRasterStoreParameters params, |
|
48 | 47 |
DataStoreProviderServices storeServices) throws InitializeException { |
49 | 48 |
super( |
50 | 49 |
name, |
... | ... | |
72 | 71 |
this.autoOpen(); |
73 | 72 |
return this.hdrFile.getNcols(); |
74 | 73 |
} |
75 |
|
|
74 |
|
|
76 | 75 |
@Override |
77 | 76 |
protected void doDispose() throws BaseException { |
78 | 77 |
super.doDispose(); |
79 | 78 |
this.hdrFile = null; |
80 | 79 |
} |
81 |
|
|
80 |
|
|
82 | 81 |
@Override |
83 | 82 |
public void open() throws OpenException { |
84 |
if ( this.hdrFile!=null ) {
|
|
83 |
if (this.hdrFile != null) {
|
|
85 | 84 |
return; |
86 | 85 |
} |
87 |
HDRFile theHDRFile = UtilsFile.createHDRFile(this.getFile()); |
|
88 |
if (!theHDRFile.isValid()) { |
|
86 |
HDRFile theHDRFile; |
|
87 |
theHDRFile = FormatsFile.getHDRFile(this.getFile()); |
|
88 |
if (theHDRFile == null || !theHDRFile.isValid()) { |
|
89 | 89 |
throw new OpenException(this.getProviderName(), null); |
90 | 90 |
} |
91 | 91 |
this.hdrFile = theHDRFile; |
... | ... | |
104 | 104 |
bandDescriptor.setDataType(dataType); |
105 | 105 |
bandDescriptor.setName(String.valueOf(nband)); |
106 | 106 |
try { |
107 |
bandDescriptor.setDescription(this.getName()+ "- band "+nband);
|
|
107 |
bandDescriptor.setDescription(this.getName() + "- band " + nband);
|
|
108 | 108 |
} catch (Exception e) { |
109 |
bandDescriptor.setDescription("band "+nband);
|
|
109 |
bandDescriptor.setDescription("band " + nband);
|
|
110 | 110 |
} |
111 | 111 |
bandDescriptor.add("X size", this.hdrFile.getNcols()); |
112 |
bandDescriptor.add("Y size", this.hdrFile.getNrows());
|
|
112 |
bandDescriptor.add("Y size", this.hdrFile.getNrows()); |
|
113 | 113 |
BSQBandPageManager pageManager = new BSQBandPageManager( |
114 | 114 |
getFile(), |
115 | 115 |
nband * this.hdrFile.getBandSize(), |
116 | 116 |
this.hdrFile.getNrows(), |
117 | 117 |
this.hdrFile.getNcols(), |
118 |
dataType |
|
118 |
dataType, |
|
119 |
this.hdrFile.getByteorder() |
|
119 | 120 |
); |
120 | 121 |
this.pageManagers.add(pageManager); |
121 | 122 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/BSQBandPageManager.java | ||
---|---|---|
6 | 6 |
import java.io.RandomAccessFile; |
7 | 7 |
import java.nio.Buffer; |
8 | 8 |
import java.nio.ByteBuffer; |
9 |
import java.nio.ByteOrder; |
|
9 | 10 |
import java.nio.DoubleBuffer; |
10 | 11 |
import java.nio.FloatBuffer; |
11 | 12 |
import java.nio.IntBuffer; |
... | ... | |
26 | 27 |
private final int dataType; |
27 | 28 |
private final File file; |
28 | 29 |
private final long startpos; |
30 |
private final ByteOrder byteOrder; |
|
29 | 31 |
|
30 | 32 |
/** |
31 | 33 |
* @param file |
... | ... | |
33 | 35 |
* @param rows |
34 | 36 |
* @param columns |
35 | 37 |
* @param dataType |
38 |
* @param byteOrder |
|
36 | 39 |
* @throws IOException |
37 | 40 |
*/ |
38 |
public BSQBandPageManager(File file, long startpos, int rows, int columns, int dataType) throws IOException { |
|
41 |
public BSQBandPageManager(File file, long startpos, int rows, int columns, int dataType, ByteOrder byteOrder) throws IOException {
|
|
39 | 42 |
this.rows = rows; |
40 | 43 |
this.columns = columns; |
41 | 44 |
this.dataType = dataType; |
42 | 45 |
this.file = file; |
43 | 46 |
this.startpos = startpos; |
47 |
this.byteOrder = byteOrder; |
|
44 | 48 |
|
45 | 49 |
this.raf = new RandomAccessFile(this.file, "r"); |
46 | 50 |
// BufferManager bufferManager = BufferLocator.getBufferManager(); |
... | ... | |
55 | 59 |
raf.seek(pos); |
56 | 60 |
BufferManager bufferManager = BufferLocator.getBufferManager(); |
57 | 61 |
int dataTypeSize = bufferManager.getDataTypeSize(dataType); |
58 |
byte[] byteArray = new byte[buffer.capacity() * dataTypeSize]; |
|
59 |
raf.read(byteArray); |
|
62 |
int elements = buffer.capacity(); |
|
63 |
|
|
64 |
ByteBuffer byteBuffer = ByteBuffer.allocate(elements * dataTypeSize); |
|
65 |
byteBuffer.order(this.byteOrder); |
|
66 |
raf.read(byteBuffer.array()); |
|
67 |
|
|
60 | 68 |
buffer.rewind(); |
69 |
byteBuffer.rewind(); |
|
61 | 70 |
|
62 | 71 |
switch (dataType) { |
63 | 72 |
case BufferManager.TYPE_BYTE: |
64 |
//FIXME: Elegir cual de las dos siguientes maneras de hacerlo es la id?nea |
|
65 |
|
|
66 |
((ByteBuffer) buffer).put(byteArray, 0, byteArray.length); |
|
67 |
// System.arraycopy(byteArray, 0, ((ByteBuffer) buffer).array(), 0, byteArray.length); |
|
73 |
((ByteBuffer) buffer).put(byteBuffer); |
|
68 | 74 |
break; |
69 | 75 |
case BufferManager.TYPE_SHORT: |
70 | 76 |
case BufferManager.TYPE_USHORT: |
71 |
for( int cell =0 ; cell<byteArray.length ; cell++ ) {
|
|
72 |
((ShortBuffer) buffer).put((int)(cell/dataTypeSize), byteArray[cell]);
|
|
77 |
for( int element =0 ; element<elements ; element++ ) {
|
|
78 |
((ShortBuffer) buffer).put(byteBuffer.getShort());
|
|
73 | 79 |
} |
74 | 80 |
break; |
75 | 81 |
case BufferManager.TYPE_INT: |
76 |
for( int cell =0 ; cell<byteArray.length ; cell++ ) {
|
|
77 |
((IntBuffer) buffer).put((int)(cell/dataTypeSize), byteArray[cell]);
|
|
82 |
for( int element =0 ; element<elements ; element++ ) {
|
|
83 |
((IntBuffer) buffer).put(byteBuffer.getInt());
|
|
78 | 84 |
} |
79 | 85 |
break; |
80 | 86 |
case BufferManager.TYPE_FLOAT: |
81 |
for( int cell =0 ; cell<byteArray.length ; cell++ ) {
|
|
82 |
((FloatBuffer) buffer).put((int)(cell/dataTypeSize), byteArray[cell]);
|
|
87 |
for( int element=0 ; element<elements ; element++ ) {
|
|
88 |
((FloatBuffer) buffer).put(byteBuffer.getFloat());
|
|
83 | 89 |
} |
84 | 90 |
break; |
85 | 91 |
|
86 | 92 |
case BufferManager.TYPE_DOUBLE: |
87 |
for( int cell =0 ; cell<byteArray.length ; cell++ ) {
|
|
88 |
((DoubleBuffer) buffer).put((int)(cell/dataTypeSize), byteArray[cell]);
|
|
93 |
for( int element=0 ; element<elements ; element++ ) {
|
|
94 |
((DoubleBuffer) buffer).put(byteBuffer.getDouble());
|
|
89 | 95 |
} |
90 | 96 |
break; |
91 | 97 |
|
... | ... | |
97 | 103 |
@Override |
98 | 104 |
public void save(Buffer buffer, int row, int rows, int dataType) throws IOException { |
99 | 105 |
|
100 |
long pos = row*this.columns + this.startpos; |
|
101 |
raf.seek(pos); |
|
102 |
|
|
103 |
BufferManager bufferManager = BufferLocator.getBufferManager(); |
|
104 |
ByteBuffer byteBuffer = ByteBuffer.allocate(buffer.capacity() * bufferManager.getDataTypeSize(dataType)); |
|
105 |
switch (dataType) { |
|
106 |
case BufferManager.TYPE_BYTE: |
|
107 |
byteBuffer.put(((ByteBuffer)buffer).array()); |
|
108 |
break; |
|
109 |
case BufferManager.TYPE_SHORT: |
|
110 |
case BufferManager.TYPE_USHORT: |
|
111 |
ShortBuffer byteAsShortBuffer = byteBuffer.asShortBuffer(); |
|
112 |
byteAsShortBuffer.put((short[]) buffer.array()); |
|
113 |
break; |
|
114 |
case BufferManager.TYPE_INT: |
|
115 |
IntBuffer byteAsIntBuffer = byteBuffer.asIntBuffer(); |
|
116 |
byteAsIntBuffer.put((int[]) buffer.array()); |
|
117 |
break; |
|
118 |
case BufferManager.TYPE_FLOAT: |
|
119 |
FloatBuffer byteAsFloatBuffer = byteBuffer.asFloatBuffer(); |
|
120 |
byteAsFloatBuffer.put((float[]) buffer.array()); |
|
121 |
break; |
|
122 |
case BufferManager.TYPE_DOUBLE: |
|
123 |
DoubleBuffer byteAsDoubleBuffer = byteBuffer.asDoubleBuffer(); |
|
124 |
byteAsDoubleBuffer.put((double[]) buffer.array()); |
|
125 |
break; |
|
126 |
default: |
|
127 |
throw new IllegalArgumentException("Data Type " + dataType + " not supported."); |
|
128 |
} |
|
129 |
raf.write(byteBuffer.array()); |
|
130 |
|
|
131 | 106 |
} |
132 | 107 |
|
133 | 108 |
@Override |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/src/main/java/org/gvsig/fmap/dal/file/bsq/BSQFileSystemServerProviderFactory.java | ||
---|---|---|
32 | 32 |
public class BSQFileSystemServerProviderFactory extends AbstractFilesystemServerExplorerProviderFactory { |
33 | 33 |
|
34 | 34 |
protected String[] fileExtensions; |
35 |
protected boolean canCreate; |
|
36 | 35 |
|
37 | 36 |
public BSQFileSystemServerProviderFactory( |
38 | 37 |
String name, |
39 | 38 |
String description, |
40 | 39 |
String[] fileExtensions |
41 | 40 |
) { |
42 |
this(name, description, fileExtensions, false); |
|
43 |
} |
|
44 |
|
|
45 |
public BSQFileSystemServerProviderFactory( |
|
46 |
String name, |
|
47 |
String description, |
|
48 |
String[] fileExtensions, |
|
49 |
boolean canCreate |
|
50 |
) { |
|
51 | 41 |
super(name, description); |
52 | 42 |
this.fileExtensions = fileExtensions; |
53 |
this.canCreate = canCreate; |
|
54 | 43 |
} |
55 | 44 |
|
56 | 45 |
@Override |
... | ... | |
58 | 47 |
return new BSQFileSystemServerProvider( |
59 | 48 |
this.getName(), |
60 | 49 |
this.getDescription(), |
61 |
this.fileExtensions, |
|
62 |
this.canCreate |
|
50 |
this.fileExtensions |
|
63 | 51 |
); |
64 | 52 |
} |
65 | 53 |
|
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.bsq/pom.xml | ||
---|---|---|
31 | 31 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
32 | 32 |
<scope>compile</scope> |
33 | 33 |
</dependency> |
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.basicformats</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
34 | 39 |
</dependencies> |
35 | 40 |
</project> |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.imageio/src/main/java/org/gvsig/fmap/dal/file/imageio/ImageIOFileSystemServerProvider.java | ||
---|---|---|
42 | 42 |
import org.gvsig.fmap.dal.NewDataStoreParameters; |
43 | 43 |
import org.gvsig.fmap.dal.exception.CreateException; |
44 | 44 |
import org.gvsig.fmap.dal.exception.DataException; |
45 |
import org.gvsig.fmap.dal.raster.api.NewRasterStoreParameters;
|
|
45 |
import org.gvsig.fmap.dal.raster.NewRasterStoreParameters; |
|
46 | 46 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
47 | 47 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider; |
48 | 48 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderServices; |
49 | 49 |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/.directory | ||
---|---|---|
1 |
[Dolphin] |
|
2 |
Timestamp=2018,6,19,10,5,57 |
|
3 |
Version=3 |
|
4 |
ViewMode=1 |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/raster/DefaultCoverageStoreFactory.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.fmap.dal.raster; |
|
25 |
|
|
26 |
import org.gvsig.fmap.dal.DataParameters; |
|
27 |
import org.gvsig.fmap.dal.DataStore; |
|
28 |
import org.gvsig.fmap.dal.DataStoreFactory; |
|
29 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
30 |
import org.gvsig.fmap.dal.raster.impl.DefaultCoverageStore; |
|
31 |
|
|
32 |
public class DefaultCoverageStoreFactory implements DataStoreFactory { |
|
33 |
|
|
34 |
public void setParameters(DataParameters parameters) { |
|
35 |
// Do Nothing |
|
36 |
|
|
37 |
} |
|
38 |
|
|
39 |
public DataStore createStore() throws InitializeException { |
|
40 |
return new DefaultCoverageStore(); |
|
41 |
} |
|
42 |
|
|
43 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/raster/impl/DefaultCoverageStoreNotification.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
|
|
25 |
package org.gvsig.fmap.dal.raster.impl; |
|
26 |
|
|
27 |
import org.gvsig.fmap.dal.DataStore; |
|
28 |
import org.gvsig.fmap.dal.DataStoreNotification; |
|
29 |
import org.gvsig.tools.undo.command.Command; |
|
30 |
|
|
31 |
public class DefaultCoverageStoreNotification implements DataStoreNotification { |
|
32 |
|
|
33 |
public DefaultCoverageStoreNotification( |
|
34 |
DefaultCoverageStore defaultCoverageStore, String notification, |
|
35 |
Command command) { |
|
36 |
// TODO Auto-generated constructor stub |
|
37 |
} |
|
38 |
|
|
39 |
public DefaultCoverageStoreNotification( |
|
40 |
DefaultCoverageStore defaultCoverageStore, String notification) { |
|
41 |
// TODO Auto-generated constructor stub |
|
42 |
} |
|
43 |
|
|
44 |
public DataStore getSource() { |
|
45 |
// TODO Auto-generated method stub |
|
46 |
return null; |
|
47 |
} |
|
48 |
|
|
49 |
public String getType() { |
|
50 |
// TODO Auto-generated method stub |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
} |
branches/org.gvsig.desktop-2018a/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/raster/impl/DefaultCoverageStore.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.fmap.dal.raster.impl; |
|
25 |
|
|
26 |
import java.util.Collection; |
|
27 |
import java.util.Iterator; |
|
28 |
import java.util.Set; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.DataCache; |
|
31 |
import org.gvsig.fmap.dal.DataManager; |
|
32 |
import org.gvsig.fmap.dal.DataQuery; |
|
33 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
34 |
import org.gvsig.fmap.dal.DataSet; |
|
35 |
import org.gvsig.fmap.dal.DataStore; |
|
36 |
import org.gvsig.fmap.dal.DataStoreNotification; |
|
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.DataStoreProviderFactory; |
|
39 |
import org.gvsig.fmap.dal.exception.CloseException; |
|
40 |
import org.gvsig.fmap.dal.exception.DataException; |
|
41 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
42 |
import org.gvsig.fmap.dal.exception.OpenException; |
|
43 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
44 |
import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
|
45 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureStoreNotification; |
|
46 |
import org.gvsig.fmap.dal.impl.DefaultDataManager; |
|
47 |
import org.gvsig.fmap.dal.raster.CoverageSelection; |
|
48 |
import org.gvsig.fmap.dal.raster.CoverageStore; |
|
49 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider; |
|
50 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices; |
|
51 |
import org.gvsig.fmap.dal.resource.Resource; |
|
52 |
import org.gvsig.fmap.dal.spi.DataStoreInitializer; |
|
53 |
import org.gvsig.fmap.dal.spi.DataStoreProvider; |
|
54 |
import org.gvsig.metadata.MetadataLocator; |
|
55 |
import org.gvsig.timesupport.Interval; |
|
56 |
import org.gvsig.timesupport.RelativeInterval; |
|
57 |
import org.gvsig.tools.ToolsLocator; |
|
58 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
|
59 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
60 |
import org.gvsig.tools.dynobject.DynClass; |
|
61 |
import org.gvsig.tools.dynobject.DynObject; |
|
62 |
import org.gvsig.tools.dynobject.DynObjectManager; |
|
63 |
import org.gvsig.tools.dynobject.DynObject_v2; |
|
64 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
|
65 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
|
66 |
import org.gvsig.tools.exception.BaseException; |
|
67 |
import org.gvsig.tools.observer.Observer; |
|
68 |
import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable; |
|
69 |
import org.gvsig.tools.persistence.PersistentState; |
|
70 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
71 |
import org.gvsig.tools.undo.command.Command; |
|
72 |
import org.gvsig.tools.visitor.Visitor; |
|
73 |
|
|
74 |
/** |
|
75 |
* @author jmvivo |
|
76 |
* |
|
77 |
*/ |
|
78 |
public class DefaultCoverageStore extends AbstractDisposable implements |
|
79 |
CoverageStore, CoverageStoreProviderServices, DataStoreInitializer { |
|
80 |
|
|
81 |
// final static private Logger logger = LoggerFactory |
|
82 |
// .getLogger(DefaultFeatureStore.class); |
|
83 |
|
|
84 |
private DataStoreParameters parameters = null; |
|
85 |
private CoverageSelection selection; |
|
86 |
|
|
87 |
// private long versionOfUpdate = 0; |
|
88 |
|
|
89 |
private DefaultDataManager dataManager = null; |
|
90 |
|
|
91 |
private CoverageStoreProvider provider = null; |
|
92 |
|
|
93 |
private DelegatedDynObject metadata; |
|
94 |
|
|
95 |
private DelegateWeakReferencingObservable delegateObservable = new DelegateWeakReferencingObservable( |
|
96 |
this); |
|
97 |
|
|
98 |
public DefaultCoverageStore() { |
|
99 |
|
|
100 |
} |
|
101 |
|
|
102 |
/* |
|
103 |
* (non-Javadoc) |
|
104 |
* |
|
105 |
* @see |
|
106 |
* org.gvsig.fmap.dal.impl.DataStoreImplementation#intializePhase1(org.gvsig |
|
107 |
* .fmap.dal.impl.DefaultDataManager, |
|
108 |
* org.gvsig.fmap.dal.DataStoreParameters) |
|
109 |
*/ |
|
110 |
public void intializePhase1(DataManager dataManager, |
|
111 |
DataStoreParameters parameters) throws InitializeException { |
|
112 |
DynObjectManager dynManager = ToolsLocator.getDynObjectManager(); |
|
113 |
|
|
114 |
this.metadata = (DelegatedDynObject) dynManager |
|
115 |
.createDynObject( |
|
116 |
MetadataLocator.getMetadataManager().getDefinition(DataStore.SPATIAL_METADATA_DEFINITION_NAME) |
|
117 |
); |
|
118 |
this.dataManager = (DefaultDataManager)dataManager; |
|
119 |
this.parameters = parameters; |
|
120 |
|
|
121 |
} |
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
/* |
|
126 |
* (non-Javadoc) |
|
127 |
* |
|
128 |
* @see |
Also available in: Unified diff