Revision 162
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalDriver.java | ||
---|---|---|
53 | 53 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
54 | 54 |
import org.gvsig.raster.impl.provider.RasterProvider; |
55 | 55 |
import org.gvsig.raster.impl.store.AbstractRasterStoreParameters; |
56 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
57 |
import org.gvsig.raster.impl.store.properties.DatasetMetadata;
|
|
58 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
56 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
57 |
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
|
|
58 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
59 | 59 |
import org.gvsig.tools.ToolsLocator; |
60 | 60 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
61 | 61 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
517 | 517 |
/** |
518 | 518 |
* Obtiene el objeto que contiene los metadatos |
519 | 519 |
*/ |
520 |
public DatasetMetadata getMetadata() {
|
|
520 |
public DataStoreMetadata getMetadata() {
|
|
521 | 521 |
if(file != null) |
522 | 522 |
return file.metadata; |
523 | 523 |
else |
... | ... | |
529 | 529 |
* color por banda |
530 | 530 |
* @return |
531 | 531 |
*/ |
532 |
public DatasetColorInterpretation getColorInterpretation(){
|
|
532 |
public DataStoreColorInterpretation getColorInterpretation(){
|
|
533 | 533 |
if(file != null) |
534 | 534 |
return file.colorInterpr; |
535 | 535 |
return null; |
... | ... | |
538 | 538 |
/** |
539 | 539 |
* Asigna el objeto que contiene que contiene la interpretaci?n de |
540 | 540 |
* color por banda |
541 |
* @param DatasetColorInterpretation
|
|
541 |
* @param DataStoreColorInterpretation
|
|
542 | 542 |
*/ |
543 |
public void setColorInterpretation(DatasetColorInterpretation colorInterpretation){
|
|
543 |
public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
|
|
544 | 544 |
if(file != null) |
545 | 545 |
file.colorInterpr = colorInterpretation; |
546 | 546 |
} |
... | ... | |
548 | 548 |
/** |
549 | 549 |
* Obtiene el objeto que contiene el estado de la transparencia |
550 | 550 |
*/ |
551 |
public DatasetTransparency getTransparency() {
|
|
551 |
public DataStoreTransparency getTransparency() {
|
|
552 | 552 |
return file.fileTransparency; |
553 | 553 |
} |
554 | 554 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalWriter.java | ||
---|---|---|
48 | 48 |
import org.gvsig.raster.impl.store.ParamsImpl; |
49 | 49 |
import org.gvsig.raster.impl.store.WriteFileFormatFeatures; |
50 | 50 |
import org.gvsig.raster.impl.store.ParamsImpl.ParamImpl; |
51 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
51 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
52 | 52 |
import org.gvsig.raster.impl.store.writer.DefaultRasterWriter; |
53 | 53 |
import org.gvsig.raster.util.DefaultProviderServices; |
54 | 54 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
634 | 634 |
|
635 | 635 |
if (colorInterp != null) |
636 | 636 |
try { |
637 |
RasterLocator.getManager().getProviderServices().saveObjectToRmfFile(outFileName, DatasetColorInterpretation.class, colorInterp);
|
|
637 |
RasterLocator.getManager().getProviderServices().saveObjectToRmfFile(outFileName, DataStoreColorInterpretation.class, colorInterp);
|
|
638 | 638 |
} catch (RmfSerializerException e) { |
639 | 639 |
throw new IOException("No se ha podido guardar la interpretacion de color"); |
640 | 640 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/MemoryRasterDriver.java | ||
---|---|---|
41 | 41 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
42 | 42 |
import org.gvsig.raster.impl.provider.RasterProvider; |
43 | 43 |
import org.gvsig.raster.impl.store.AbstractRasterStoreParameters; |
44 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
44 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
45 | 45 |
import org.gvsig.tools.ToolsLocator; |
46 | 46 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
47 | 47 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
64 | 64 |
/** |
65 | 65 |
* Estado de transparencia del raster. |
66 | 66 |
*/ |
67 |
protected DatasetTransparency fileTransparency = null;
|
|
67 |
protected DataStoreTransparency fileTransparency = null;
|
|
68 | 68 |
|
69 | 69 |
public static void register() { |
70 | 70 |
ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager(); |
... | ... | |
664 | 664 |
/** |
665 | 665 |
* Obtiene el objeto que contiene el estado de la transparencia |
666 | 666 |
*/ |
667 |
public DatasetTransparency getTransparency() {
|
|
667 |
public DataStoreTransparency getTransparency() {
|
|
668 | 668 |
if(fileTransparency == null) |
669 |
fileTransparency = new DatasetTransparency();
|
|
669 |
fileTransparency = new DataStoreTransparency();
|
|
670 | 670 |
return fileTransparency; |
671 | 671 |
} |
672 | 672 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/ErmapperDriver.java | ||
---|---|---|
53 | 53 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
54 | 54 |
import org.gvsig.raster.impl.provider.RasterProvider; |
55 | 55 |
import org.gvsig.raster.impl.store.AbstractRasterStoreParameters; |
56 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
57 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
56 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
57 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
58 | 58 |
import org.gvsig.tools.ToolsLocator; |
59 | 59 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
60 | 60 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
76 | 76 |
private JNCSFile file = null; |
77 | 77 |
protected Transparency fileTransparency = null; |
78 | 78 |
private Extent viewRequest = null; |
79 |
private DatasetColorInterpretation colorInterpr = null;
|
|
79 |
private DataStoreColorInterpretation colorInterpr = null;
|
|
80 | 80 |
private boolean open = false; |
81 | 81 |
|
82 | 82 |
public static void register() { |
... | ... | |
214 | 214 |
*/ |
215 | 215 |
public Transparency getTransparency() { |
216 | 216 |
if(fileTransparency == null) |
217 |
fileTransparency = new DatasetTransparency();
|
|
217 |
fileTransparency = new DataStoreTransparency();
|
|
218 | 218 |
return fileTransparency; |
219 | 219 |
} |
220 | 220 |
|
... | ... | |
799 | 799 |
* color por banda |
800 | 800 |
* @return |
801 | 801 |
*/ |
802 |
public DatasetColorInterpretation getColorInterpretation(){
|
|
802 |
public DataStoreColorInterpretation getColorInterpretation(){
|
|
803 | 803 |
if(colorInterpr == null) { |
804 |
colorInterpr = new DatasetColorInterpretation();
|
|
804 |
colorInterpr = new DataStoreColorInterpretation();
|
|
805 | 805 |
colorInterpr.initColorInterpretation(getBandCount()); |
806 | 806 |
if(getBandCount() == 1) |
807 |
colorInterpr.setColorInterpValue(0, DatasetColorInterpretation.GRAY_BAND);
|
|
807 |
colorInterpr.setColorInterpValue(0, DataStoreColorInterpretation.GRAY_BAND);
|
|
808 | 808 |
if(getBandCount() >= 3) { |
809 |
colorInterpr.setColorInterpValue(0, DatasetColorInterpretation.RED_BAND);
|
|
810 |
colorInterpr.setColorInterpValue(1, DatasetColorInterpretation.GREEN_BAND);
|
|
811 |
colorInterpr.setColorInterpValue(2, DatasetColorInterpretation.BLUE_BAND);
|
|
809 |
colorInterpr.setColorInterpValue(0, DataStoreColorInterpretation.RED_BAND);
|
|
810 |
colorInterpr.setColorInterpValue(1, DataStoreColorInterpretation.GREEN_BAND);
|
|
811 |
colorInterpr.setColorInterpValue(2, DataStoreColorInterpretation.BLUE_BAND);
|
|
812 | 812 |
} |
813 | 813 |
} |
814 | 814 |
return colorInterpr; |
... | ... | |
817 | 817 |
/** |
818 | 818 |
* Asigna el objeto que contiene que contiene la interpretaci?n de |
819 | 819 |
* color por banda |
820 |
* @param DatasetColorInterpretation
|
|
820 |
* @param DataStoreColorInterpretation
|
|
821 | 821 |
*/ |
822 |
public void setColorInterpretation(DatasetColorInterpretation colorInterpretation){
|
|
822 |
public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
|
|
823 | 823 |
this.colorInterpretation = colorInterpretation; |
824 | 824 |
} |
825 | 825 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/MrSidDriver.java | ||
---|---|---|
52 | 52 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
53 | 53 |
import org.gvsig.raster.impl.provider.RasterProvider; |
54 | 54 |
import org.gvsig.raster.impl.store.AbstractRasterStoreParameters; |
55 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
56 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
55 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
56 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
57 | 57 |
import org.gvsig.tools.ToolsLocator; |
58 | 58 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
59 | 59 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
72 | 72 |
public static final String METADATA_DEFINITION_NAME = "LizardTechStore"; |
73 | 73 |
protected MrSidNative file = null; |
74 | 74 |
private Extent viewRequest = null; |
75 |
private DatasetColorInterpretation colorInterpr = null;
|
|
76 |
protected DatasetTransparency fileTransparency = null;
|
|
75 |
private DataStoreColorInterpretation colorInterpr = null;
|
|
76 |
protected DataStoreTransparency fileTransparency = null;
|
|
77 | 77 |
private boolean open = false; |
78 | 78 |
|
79 | 79 |
public static void register() { |
... | ... | |
516 | 516 |
/** |
517 | 517 |
* Obtiene el objeto que contiene el estado de la transparencia |
518 | 518 |
*/ |
519 |
public DatasetTransparency getTransparency() {
|
|
519 |
public DataStoreTransparency getTransparency() {
|
|
520 | 520 |
if (fileTransparency == null) |
521 |
fileTransparency = new DatasetTransparency();
|
|
521 |
fileTransparency = new DataStoreTransparency();
|
|
522 | 522 |
return fileTransparency; |
523 | 523 |
} |
524 | 524 |
|
... | ... | |
526 | 526 |
* Obtiene el objeto que contiene que contiene la interpretaci?n de color por banda |
527 | 527 |
* @return |
528 | 528 |
*/ |
529 |
public DatasetColorInterpretation getColorInterpretation() {
|
|
529 |
public DataStoreColorInterpretation getColorInterpretation() {
|
|
530 | 530 |
if (colorInterpr == null) { |
531 |
colorInterpr = new DatasetColorInterpretation();
|
|
531 |
colorInterpr = new DataStoreColorInterpretation();
|
|
532 | 532 |
colorInterpr.initColorInterpretation(getBandCount()); |
533 | 533 |
if (getBandCount() == 1) |
534 |
colorInterpr.setColorInterpValue(0, DatasetColorInterpretation.GRAY_BAND);
|
|
534 |
colorInterpr.setColorInterpValue(0, DataStoreColorInterpretation.GRAY_BAND);
|
|
535 | 535 |
if (getBandCount() >= 3) { |
536 |
colorInterpr.setColorInterpValue(0, DatasetColorInterpretation.RED_BAND);
|
|
537 |
colorInterpr.setColorInterpValue(1, DatasetColorInterpretation.GREEN_BAND);
|
|
538 |
colorInterpr.setColorInterpValue(2, DatasetColorInterpretation.BLUE_BAND);
|
|
536 |
colorInterpr.setColorInterpValue(0, DataStoreColorInterpretation.RED_BAND);
|
|
537 |
colorInterpr.setColorInterpValue(1, DataStoreColorInterpretation.GREEN_BAND);
|
|
538 |
colorInterpr.setColorInterpValue(2, DataStoreColorInterpretation.BLUE_BAND);
|
|
539 | 539 |
} |
540 | 540 |
} |
541 | 541 |
return colorInterpr; |
... | ... | |
543 | 543 |
|
544 | 544 |
/** |
545 | 545 |
* Asigna el objeto que contiene que contiene la interpretaci?n de color por banda |
546 |
* @param DatasetColorInterpretation
|
|
546 |
* @param DataStoreColorInterpretation
|
|
547 | 547 |
*/ |
548 |
public void setColorInterpretation(DatasetColorInterpretation colorInterpretation) {
|
|
548 |
public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation) {
|
|
549 | 549 |
this.colorInterpretation = colorInterpretation; |
550 | 550 |
} |
551 | 551 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.io/org.gvsig.raster.io.base/src/main/java/org/gvsig/fmap/dal/coverage/dataset/io/GdalNative.java | ||
---|---|---|
35 | 35 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
36 | 36 |
import org.gvsig.raster.impl.process.RasterTask; |
37 | 37 |
import org.gvsig.raster.impl.process.RasterTaskQueue; |
38 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
39 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
40 |
import org.gvsig.raster.impl.store.properties.DatasetMetadata;
|
|
41 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
38 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
39 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
40 |
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
|
|
41 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
42 | 42 |
|
43 | 43 |
import es.gva.cit.jgdal.Gdal; |
44 | 44 |
import es.gva.cit.jgdal.GdalBuffer; |
... | ... | |
60 | 60 |
public String version = ""; |
61 | 61 |
protected int rBandNr = 1, gBandNr = 2, bBandNr = 3, aBandNr = 4; |
62 | 62 |
private int[] dataType = null; |
63 |
DatasetMetadata metadata = null;
|
|
63 |
DataStoreMetadata metadata = null;
|
|
64 | 64 |
protected boolean georeferenced = true; |
65 | 65 |
|
66 | 66 |
/** |
... | ... | |
88 | 88 |
/** |
89 | 89 |
* Estado de transparencia del raster. |
90 | 90 |
*/ |
91 |
DatasetTransparency fileTransparency = null;
|
|
92 |
DatasetColorTable palette = null;
|
|
93 |
DatasetColorInterpretation colorInterpr = null;
|
|
91 |
DataStoreTransparency fileTransparency = null;
|
|
92 |
DataStoreColorTable palette = null;
|
|
93 |
DataStoreColorInterpretation colorInterpr = null;
|
|
94 | 94 |
AffineTransform ownTransformation = null; |
95 | 95 |
AffineTransform externalTransformation = new AffineTransform(); |
96 | 96 |
|
... | ... | |
120 | 120 |
dt[i] = this.getRasterBand(i + 1).getRasterDataType(); |
121 | 121 |
setDataType(dt); |
122 | 122 |
shortName = getDriverShortName(); |
123 |
fileTransparency = new DatasetTransparency();
|
|
124 |
colorInterpr = new DatasetColorInterpretation();
|
|
125 |
metadata = new DatasetMetadata(getMetadata(), colorInterpr);
|
|
123 |
fileTransparency = new DataStoreTransparency();
|
|
124 |
colorInterpr = new DataStoreColorInterpretation();
|
|
125 |
metadata = new DataStoreMetadata(getMetadata(), colorInterpr);
|
|
126 | 126 |
|
127 | 127 |
// Asignamos la interpretaci?n de color leida por gdal a cada banda. Esto |
128 | 128 |
// nos sirve para saber que banda de la imagen va asignada a cada banda de |
... | ... | |
139 | 139 |
fileTransparency.setTransparencyBand(i); |
140 | 140 |
|
141 | 141 |
if (rb.getRasterColorTable() != null && palette == null) { |
142 |
palette = new DatasetColorTable();
|
|
142 |
palette = new DataStoreColorTable();
|
|
143 | 143 |
palette.createPaletteFromGdalColorTable(rb.getRasterColorTable()); |
144 | 144 |
// fileTransparency.setTransparencyRangeList(palette.getTransparencyRange()); |
145 | 145 |
} |
... | ... | |
647 | 647 |
w = gdalBands[0].getRasterBandXSize()-x; |
648 | 648 |
|
649 | 649 |
if(gdalBands[0].getRasterColorTable() != null) { |
650 |
palette = new DatasetColorTable();
|
|
650 |
palette = new DataStoreColorTable();
|
|
651 | 651 |
palette.createPaletteFromGdalColorTable(gdalBands[0].getRasterColorTable()); |
652 | 652 |
r = gdalBands[0].readRaster(x, y, w, 1, w, 1, dataType[0]); |
653 | 653 |
} else { |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java | ||
---|---|---|
34 | 34 |
import java.io.IOException; |
35 | 35 |
import java.util.ArrayList; |
36 | 36 |
import java.util.HashMap; |
37 |
import java.util.Iterator; |
|
38 | 37 |
import java.util.Set; |
39 | 38 |
|
40 | 39 |
import org.cresques.cts.IProjection; |
... | ... | |
119 | 118 |
import org.gvsig.raster.util.RasterNotLoadException; |
120 | 119 |
import org.gvsig.raster.util.RasterToolsUtil; |
121 | 120 |
import org.gvsig.tools.ToolsLocator; |
121 |
import org.gvsig.tools.dynobject.DynObjectSet; |
|
122 | 122 |
import org.gvsig.tools.dynobject.DynStruct; |
123 | 123 |
import org.gvsig.tools.exception.BaseException; |
124 | 124 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
... | ... | |
1082 | 1082 |
// Extent extent = new Extent(rectCuadricula); |
1083 | 1083 |
|
1084 | 1084 |
Dimension tam = new Dimension(anchoAux + 1, altoAux + 1); |
1085 |
ViewPort vp = viewPort.cloneViewPort();
|
|
1085 |
ViewPort vp = (ViewPort)viewPort.clone();
|
|
1086 | 1086 |
vp.setImageSize(tam); |
1087 | 1087 |
Envelope env = geomManager.createEnvelope(rectCuadricula |
1088 | 1088 |
.getMinX(), rectCuadricula.getMinY(), |
... | ... | |
1098 | 1098 |
//throw new ReadDriverException("Error en la transformaci?n.", e); |
1099 | 1099 |
} catch (CreateEnvelopeException e) { |
1100 | 1100 |
logger.error("Error creating the envelope", e); |
1101 |
} catch (CloneNotSupportedException e) { |
|
1102 |
logger.error("Error cloning the viewport", e); |
|
1101 | 1103 |
} |
1102 | 1104 |
// Fin parte que dibuja |
1103 | 1105 |
xProv = xProv + A; |
... | ... | |
2069 | 2071 |
this.readingData = readingData; |
2070 | 2072 |
} |
2071 | 2073 |
|
2072 |
@SuppressWarnings("unchecked") |
|
2073 |
public Iterator getInfo(Point p, double tolerance, Cancellable cancel) |
|
2074 |
public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel) |
|
2074 | 2075 |
throws LoadLayerException, DataException { |
2075 | 2076 |
return null; |
2076 | 2077 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfWrite.java | ||
---|---|---|
45 | 45 |
import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer; |
46 | 46 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
47 | 47 |
import org.gvsig.raster.impl.store.QueryableRaster; |
48 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
49 |
import org.gvsig.raster.impl.store.properties.DatasetStatistics;
|
|
48 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
49 |
import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
|
|
50 | 50 |
import org.gvsig.raster.impl.store.rmf.RmfBlocksManager; |
51 | 51 |
import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer; |
52 | 52 |
import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer; |
... | ... | |
125 | 125 |
blocksManager.addClient(ser1); |
126 | 126 |
|
127 | 127 |
// Estadisticas |
128 |
DatasetStatistics stat = ((QueryableRaster)f).getProvider(0).getStatistics();
|
|
128 |
DataStoreStatistics stat = ((QueryableRaster)f).getProvider(0).getStatistics();
|
|
129 | 129 |
stat.setTailTrimValue(3.0, new Double(10.0)); |
130 | 130 |
stat.setTailTrimValue(4.0, new Double(16.0)); |
131 | 131 |
StatisticsRmfSerializer ser2 = new StatisticsRmfSerializer(stat); |
... | ... | |
169 | 169 |
|
170 | 170 |
// Interpretaci?n de color |
171 | 171 |
ColorInterpretation ci = f.getColorInterpretation(); |
172 |
ci.setColorInterpValue(0, DatasetColorInterpretation.BLUE_BAND);
|
|
173 |
ci.setColorInterpValue(2, DatasetColorInterpretation.RED_BAND);
|
|
174 |
ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DatasetColorInterpretation)f.getColorInterpretation());
|
|
172 |
ci.setColorInterpValue(0, DataStoreColorInterpretation.BLUE_BAND);
|
|
173 |
ci.setColorInterpValue(2, DataStoreColorInterpretation.RED_BAND);
|
|
174 |
ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DataStoreColorInterpretation)f.getColorInterpretation());
|
|
175 | 175 |
blocksManager.addClient(ser6); |
176 | 176 |
|
177 | 177 |
try { |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfRead.java | ||
---|---|---|
40 | 40 |
import org.gvsig.raster.impl.datastruct.serializer.HistogramRmfSerializer; |
41 | 41 |
import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer; |
42 | 42 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
43 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
44 |
import org.gvsig.raster.impl.store.properties.DatasetStatistics;
|
|
43 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
44 |
import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
|
|
45 | 45 |
import org.gvsig.raster.impl.store.rmf.IRmfBlock; |
46 | 46 |
import org.gvsig.raster.impl.store.rmf.RmfBlocksManager; |
47 | 47 |
import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer; |
... | ... | |
93 | 93 |
GeoInfoRmfSerializer ser3 = new GeoInfoRmfSerializer(f2); |
94 | 94 |
GeoPointListRmfSerializer ser4 = new GeoPointListRmfSerializer(); |
95 | 95 |
NoDataRmfSerializer ser5 = new NoDataRmfSerializer(); |
96 |
ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DatasetColorInterpretation)f2.getColorInterpretation());
|
|
96 |
ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DataStoreColorInterpretation)f2.getColorInterpretation());
|
|
97 | 97 |
|
98 | 98 |
blocksManager.addClient(ser); |
99 | 99 |
blocksManager.addClient(ser1); |
... | ... | |
115 | 115 |
testColorTable(colorTable); |
116 | 116 |
} |
117 | 117 |
if (client instanceof StatisticsRmfSerializer) |
118 |
testStatistics((DatasetStatistics) client.getResult());
|
|
118 |
testStatistics((DataStoreStatistics) client.getResult());
|
|
119 | 119 |
if (client instanceof NoDataRmfSerializer) |
120 | 120 |
testNoData((DefaultNoData) client.getResult()); |
121 | 121 |
// if (client instanceof GeoInfoRmfSerializer) |
... | ... | |
123 | 123 |
if (client instanceof GeoPointListRmfSerializer) |
124 | 124 |
testGeoPoints((GeoPointList) client.getResult()); |
125 | 125 |
if (client instanceof ColorInterpretationRmfSerializer) { |
126 |
DatasetColorInterpretation ci = (DatasetColorInterpretation) client.getResult();
|
|
126 |
DataStoreColorInterpretation ci = (DataStoreColorInterpretation) client.getResult();
|
|
127 | 127 |
testColorInterpretation(ci); |
128 | 128 |
} |
129 | 129 |
} |
... | ... | |
134 | 134 |
|
135 | 135 |
} |
136 | 136 |
|
137 |
public void testColorInterpretation(DatasetColorInterpretation ci) {
|
|
137 |
public void testColorInterpretation(DataStoreColorInterpretation ci) {
|
|
138 | 138 |
for (int j = 0; j < ci.length(); j++) { |
139 | 139 |
String value = ci.get(j); |
140 | 140 |
// System.out.println(value); |
... | ... | |
218 | 218 |
assertEquals(noData.getType(), 2); |
219 | 219 |
} |
220 | 220 |
|
221 |
public void testStatistics(DatasetStatistics ds) {
|
|
221 |
public void testStatistics(DataStoreStatistics ds) {
|
|
222 | 222 |
int bandCount = ds.getBandCount(); |
223 | 223 |
double[] max = ds.getMaxByteUnsigned(); |
224 | 224 |
double[] min = ds.getMinByteUnsigned(); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/datastruct/TestColorTable.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.dal.coverage.BaseTestCase; |
28 | 28 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
29 | 29 |
import org.gvsig.raster.impl.datastruct.ColorItemImpl; |
30 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
30 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
31 | 31 |
/** |
32 | 32 |
* Test para comprobar el funcionamiento de las tablas de color. |
33 | 33 |
* @version 12/05/2008 |
... | ... | |
95 | 95 |
*/ |
96 | 96 |
@SuppressWarnings("unchecked") |
97 | 97 |
private void dataTest2() { |
98 |
ColorTable table = new DatasetColorTable("dataTest2");
|
|
98 |
ColorTable table = new DataStoreColorTable("dataTest2");
|
|
99 | 99 |
ArrayList list = new ArrayList(); |
100 | 100 |
ColorItem item = new ColorItemImpl(); |
101 | 101 |
item.setValue(0.0f); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/SerialInfo.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.fmap.dal.coverage.store.props; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* This interfaz represents a serie of raster data |
|
27 |
* |
|
28 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
29 |
*/ |
|
30 |
public interface SerialInfo { |
|
31 |
|
|
32 |
/** |
|
33 |
* Sets the description |
|
34 |
* @return |
|
35 |
*/ |
|
36 |
public String getDescription(); |
|
37 |
|
|
38 |
} |
|
0 | 39 |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java | ||
---|---|---|
30 | 30 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
31 | 31 |
*/ |
32 | 32 |
public interface RasterQuery extends DataQuery { |
33 |
public static final int SINGLE_VALUE = 0; |
|
34 |
public static final int MULTIPLE_VALUE = 1; |
|
35 |
public static final int SINGLE_RANGE = 2; |
|
36 |
public static final int MULTIPLE_RANGE = 3; |
|
37 |
|
|
33 | 38 |
/** |
34 | 39 |
* The user can told if the buffer will be stored or not in the RasterDatasource. |
35 | 40 |
* @param store |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataStore.java | ||
---|---|---|
27 | 27 |
import org.cresques.cts.IProjection; |
28 | 28 |
import org.gvsig.fmap.dal.DataStore; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
30 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
|
30 | 31 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
31 | 32 |
import org.gvsig.fmap.dal.coverage.exception.BandAccessException; |
32 | 33 |
import org.gvsig.fmap.dal.coverage.exception.HistogramException; |
... | ... | |
40 | 41 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
41 | 42 |
import org.gvsig.fmap.dal.coverage.store.props.Histogram; |
42 | 43 |
import org.gvsig.fmap.dal.coverage.store.props.Metadata; |
44 |
import org.gvsig.fmap.dal.coverage.store.props.SerialInfo; |
|
43 | 45 |
import org.gvsig.fmap.dal.coverage.store.props.Statistics; |
44 | 46 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
45 | 47 |
import org.gvsig.fmap.dal.exception.CloseException; |
... | ... | |
327 | 329 |
public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException; |
328 | 330 |
|
329 | 331 |
/** |
332 |
* Returns the band list |
|
333 |
* @return |
|
334 |
*/ |
|
335 |
public BandList getBands(); |
|
336 |
|
|
337 |
/** |
|
330 | 338 |
* Clones this object |
331 | 339 |
* @return RasterDataStore |
332 | 340 |
*/ |
... | ... | |
382 | 390 |
*/ |
383 | 391 |
public Histogram getHistogram() throws HistogramException; |
384 | 392 |
|
393 |
/** |
|
394 |
* Gets the serial information |
|
395 |
* @return |
|
396 |
* @throws RmfSerializerException |
|
397 |
*/ |
|
398 |
public SerialInfo getSerialInfo() throws RmfSerializerException; |
|
399 |
|
|
400 |
/** |
|
401 |
* Sets the serial information |
|
402 |
* @throws RmfSerializerException |
|
403 |
*/ |
|
404 |
public void setSerialInfo(SerialInfo serialInfo) throws RmfSerializerException; |
|
405 |
|
|
406 |
|
|
385 | 407 |
//****************************************** |
386 | 408 |
//***********Query methods****************** |
387 | 409 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/test/java/org/gvsig/raster/impl/TestRequestTime.java | ||
---|---|---|
1 |
package org.gvsig.raster.impl; |
|
2 |
|
|
3 |
import java.text.ParseException; |
|
4 |
|
|
5 |
import junit.framework.TestCase; |
|
6 |
|
|
7 |
import org.gvsig.raster.impl.buffer.DefaultRasterQuery; |
|
8 |
|
|
9 |
public class TestRequestTime extends TestCase { |
|
10 |
|
|
11 |
public void setUp() { |
|
12 |
|
|
13 |
} |
|
14 |
|
|
15 |
public void testStack() { |
|
16 |
DefaultRasterQuery q = new DefaultRasterQuery(); |
|
17 |
try { |
|
18 |
q.setTime(new String[]{"25/3/2010"}, 1); |
|
19 |
q.setTime(new String[]{"26/4/1980-23:12:25"}, 1); |
|
20 |
} catch (ParseException e) { |
|
21 |
e.printStackTrace(); |
|
22 |
} |
|
23 |
} |
|
24 |
|
|
25 |
} |
|
0 | 26 |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterManager.java | ||
---|---|---|
92 | 92 |
import org.gvsig.raster.impl.store.DefaultMultiRasterStore; |
93 | 93 |
import org.gvsig.raster.impl.store.ParamsImpl; |
94 | 94 |
import org.gvsig.raster.impl.store.QueryableRaster; |
95 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
95 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
96 | 96 |
import org.gvsig.raster.impl.store.writer.DefaultRasterWriter; |
97 | 97 |
import org.gvsig.raster.util.DefaultCRSUtils; |
98 | 98 |
import org.gvsig.raster.util.DefaultColorConversion; |
... | ... | |
502 | 502 |
* @see org.gvsig.fmap.dal.coverage.RasterManager#createColorInterpretation() |
503 | 503 |
*/ |
504 | 504 |
public ColorInterpretation createColorInterpretation(String[] colorInterp) { |
505 |
return new DatasetColorInterpretation(colorInterp);
|
|
505 |
return new DataStoreColorInterpretation(colorInterp);
|
|
506 | 506 |
} |
507 | 507 |
|
508 | 508 |
/* |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java | ||
---|---|---|
60 | 60 |
import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList; |
61 | 61 |
import org.gvsig.raster.impl.grid.filter.band.ColorTableFilter; |
62 | 62 |
import org.gvsig.raster.impl.store.DefaultMultiRasterStore; |
63 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
63 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
64 | 64 |
import org.gvsig.tools.ToolsLocator; |
65 | 65 |
import org.gvsig.tools.dynobject.DynStruct; |
66 | 66 |
import org.gvsig.tools.persistence.PersistenceManager; |
... | ... | |
192 | 192 |
|
193 | 193 |
ColorInterpretation colorInterpr = dataStore.getColorInterpretation(); |
194 | 194 |
if (colorInterpr != null) |
195 |
if (colorInterpr.getBand(DatasetColorInterpretation.PAL_BAND) == -1) {
|
|
195 |
if (colorInterpr.getBand(DataStoreColorInterpretation.PAL_BAND) == -1) {
|
|
196 | 196 |
if (colorInterpr.isUndefined()) |
197 | 197 |
return; |
198 | 198 |
int[] result = new int[] { -1, -1, -1 }; |
199 |
int gray = colorInterpr.getBand(DatasetColorInterpretation.GRAY_BAND);
|
|
199 |
int gray = colorInterpr.getBand(DataStoreColorInterpretation.GRAY_BAND);
|
|
200 | 200 |
if (gray != -1) |
201 | 201 |
result[0] = result[1] = result[2] = gray; |
202 | 202 |
else { |
203 |
int r = colorInterpr.getBand(DatasetColorInterpretation.RED_BAND);
|
|
203 |
int r = colorInterpr.getBand(DataStoreColorInterpretation.RED_BAND);
|
|
204 | 204 |
if (r != -1) |
205 | 205 |
result[0] = r; |
206 |
int g = colorInterpr.getBand(DatasetColorInterpretation.GREEN_BAND);
|
|
206 |
int g = colorInterpr.getBand(DataStoreColorInterpretation.GREEN_BAND);
|
|
207 | 207 |
if (g != -1) |
208 | 208 |
result[1] = g; |
209 |
int b = colorInterpr.getBand(DatasetColorInterpretation.BLUE_BAND);
|
|
209 |
int b = colorInterpr.getBand(DataStoreColorInterpretation.BLUE_BAND);
|
|
210 | 210 |
if (b != -1) |
211 | 211 |
result[2] = b; |
212 | 212 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridTransparencyImpl.java | ||
---|---|---|
24 | 24 |
import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange; |
25 | 25 |
import org.gvsig.fmap.dal.coverage.grid.GridTransparency; |
26 | 26 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
27 |
import org.gvsig.raster.impl.store.properties.DatasetTransparency;
|
|
27 |
import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
|
|
28 | 28 |
import org.gvsig.tools.ToolsLocator; |
29 | 29 |
import org.gvsig.tools.dynobject.DynClass; |
30 | 30 |
import org.gvsig.tools.dynobject.DynStruct; |
... | ... | |
66 | 66 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
67 | 67 |
* |
68 | 68 |
*/ |
69 |
public class GridTransparencyImpl extends DatasetTransparency implements GridTransparency {
|
|
69 |
public class GridTransparencyImpl extends DataStoreTransparency implements GridTransparency {
|
|
70 | 70 |
/** |
71 | 71 |
* Flag de activaci?n de la transparencia cuando se visualiza o exporta. |
72 | 72 |
*/ |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridPaletteDeprecated.java | ||
---|---|---|
22 | 22 |
package org.gvsig.raster.impl.grid; |
23 | 23 |
|
24 | 24 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
25 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
25 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
26 | 26 |
/** |
27 | 27 |
* Tabla de color asociada a un grid |
28 | 28 |
* |
29 | 29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
30 | 30 |
*/ |
31 |
public class GridPaletteDeprecated extends DatasetColorTable {
|
|
31 |
public class GridPaletteDeprecated extends DataStoreColorTable {
|
|
32 | 32 |
/** |
33 | 33 |
* Flag de activaci?n de la paleta cuando se visualiza o exporta. |
34 | 34 |
*/ |
... | ... | |
49 | 49 |
public GridPaletteDeprecated(ColorTable fp){ |
50 | 50 |
if (fp == null) |
51 | 51 |
return; |
52 |
DatasetColorTable palette = null;
|
|
53 |
if(fp instanceof DatasetColorTable)
|
|
54 |
palette = (DatasetColorTable)fp;
|
|
52 |
DataStoreColorTable palette = null;
|
|
53 |
if(fp instanceof DataStoreColorTable)
|
|
54 |
palette = (DataStoreColorTable)fp;
|
|
55 | 55 |
else |
56 | 56 |
return; |
57 | 57 |
this.range = palette.getRange(); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableListManager.java | ||
---|---|---|
35 | 35 |
import org.gvsig.raster.impl.datastruct.ColorItemImpl; |
36 | 36 |
import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl; |
37 | 37 |
import org.gvsig.raster.impl.store.ParamsImpl.ParamImpl; |
38 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
38 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
39 | 39 |
import org.gvsig.tools.ToolsLocator; |
40 | 40 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
41 | 41 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
... | ... | |
217 | 217 |
linesCloned.remove(0); |
218 | 218 |
} |
219 | 219 |
|
220 |
ColorTable colorTable = new DatasetColorTable();
|
|
220 |
ColorTable colorTable = new DataStoreColorTable();
|
|
221 | 221 |
|
222 |
colorTable = new DatasetColorTable();
|
|
222 |
colorTable = new DataStoreColorTable();
|
|
223 | 223 |
colorTable.setName(paletteName); |
224 | 224 |
colorTable.createPaletteFromColorItems(rows, false); |
225 | 225 |
colorTable.setInterpolated(interpolated); |
... | ... | |
243 | 243 |
ColorTable colorTable = createColorTableFromArray(filters); |
244 | 244 |
|
245 | 245 |
filterList.remove(ColorTableFilter.class); |
246 |
addColorTableFilter(new DatasetColorTable(colorTable));
|
|
246 |
addColorTableFilter(new DataStoreColorTable(colorTable));
|
|
247 | 247 |
|
248 | 248 |
ColorTableFilter ct = (ColorTableFilter) filterList.getFilterByBaseClass(ColorTableFilter.class); |
249 | 249 |
ct.setExec(exec); |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFilter.java | ||
---|---|---|
28 | 28 |
import org.gvsig.raster.impl.DefaultRasterManager; |
29 | 29 |
import org.gvsig.raster.impl.buffer.RasterBuffer; |
30 | 30 |
import org.gvsig.raster.impl.store.ParamsImpl; |
31 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
31 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
32 | 32 |
/** |
33 | 33 |
* <P> |
34 | 34 |
* Clase base para los filtros de tabla de color. Siempre gastar? la banda cero |
... | ... | |
45 | 45 |
public class ColorTableFilter extends BaseRasterFilter { |
46 | 46 |
protected Buffer rasterAlpha = null; |
47 | 47 |
public static String[] names = new String[] { "colortable" }; |
48 |
protected DatasetColorTable colorTable = new DatasetColorTable();
|
|
48 |
protected DataStoreColorTable colorTable = new DataStoreColorTable();
|
|
49 | 49 |
protected boolean hasAlpha = false; |
50 | 50 |
|
51 | 51 |
/** |
... | ... | |
63 | 63 |
public void pre() { |
64 | 64 |
exec = true; |
65 | 65 |
raster = (RasterBuffer) params.get("raster"); |
66 |
colorTable = ((DatasetColorTable) params.get("colorTable"));
|
|
66 |
colorTable = ((DataStoreColorTable) params.get("colorTable"));
|
|
67 | 67 |
hasAlpha = colorTable.hasAlpha(); |
68 | 68 |
if (raster != null) { |
69 | 69 |
height = raster.getHeight(); |
... | ... | |
110 | 110 |
public Params getUIParams(String nameFilter) { |
111 | 111 |
Params params = new ParamsImpl(); |
112 | 112 |
params.setParam("colorTable", |
113 |
new DatasetColorTable(colorTable),
|
|
113 |
new DataStoreColorTable(colorTable),
|
|
114 | 114 |
-1, |
115 | 115 |
null); |
116 | 116 |
return params; |
... | ... | |
144 | 144 |
*/ |
145 | 145 |
public ColorTable getColorTable() { |
146 | 146 |
if ((colorTable == null) || (colorTable.getColorItems() == null)) |
147 |
colorTable = ((DatasetColorTable) params.get("colorTable"));
|
|
147 |
colorTable = ((DataStoreColorTable) params.get("colorTable"));
|
|
148 | 148 |
return colorTable; |
149 | 149 |
} |
150 | 150 |
|
... | ... | |
161 | 161 |
* @param colorTable the colorTable to set |
162 | 162 |
*/ |
163 | 163 |
public void setColorTable(ColorTable colorTable) { |
164 |
this.colorTable = (DatasetColorTable)colorTable;
|
|
164 |
this.colorTable = (DataStoreColorTable)colorTable;
|
|
165 | 165 |
} |
166 | 166 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridImpl.java | ||
---|---|---|
46 | 46 |
import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList; |
47 | 47 |
import org.gvsig.raster.impl.grid.render.DefaultRender; |
48 | 48 |
import org.gvsig.raster.impl.store.QueryableRaster; |
49 |
import org.gvsig.raster.impl.store.properties.DatasetColorTable;
|
|
49 |
import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
|
|
50 | 50 |
|
51 | 51 |
/** |
52 | 52 |
* Clase que representa una rejilla de datos raster. Este tipo de grid tiene el interfaz necesario |
... | ... | |
355 | 355 |
Transparency transp = ds.getTransparency(); |
356 | 356 |
if (transp != null) |
357 | 357 |
transparency = new GridTransparencyImpl(transp); |
358 |
this.palette = new DatasetColorTable(ds.getColorTable());
|
|
358 |
this.palette = new DataStoreColorTable(ds.getColorTable());
|
|
359 | 359 |
} |
360 | 360 |
filterList = new DefaultRasterFilterList(); |
361 | 361 |
if (ds != null) { |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.raster.impl.buffer; |
23 | 23 |
|
24 |
import java.text.ParseException; |
|
25 |
|
|
24 | 26 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
27 |
import org.gvsig.raster.impl.datastruct.TimeInfo; |
|
25 | 28 |
import org.gvsig.tools.persistence.PersistentState; |
26 | 29 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
27 | 30 |
|
... | ... | |
72 | 75 |
*/ |
73 | 76 |
private double noDataValueToFill = -99999; |
74 | 77 |
|
78 |
private TimeInfo time = null; |
|
79 |
|
|
80 |
/** |
|
81 |
* Sets the time |
|
82 |
* @param t Time values. Each element in the vector is a value. It could contain or a |
|
83 |
* single values or a intervals. It will depend on type constant |
|
84 |
* @param type Constant defined in RasterQuery. |
|
85 |
*/ |
|
86 |
public void setTime(String[] t, int type) throws ParseException { |
|
87 |
time = new TimeInfo(); |
|
88 |
time.load(t, type); |
|
89 |
} |
|
90 |
|
|
75 | 91 |
/* |
76 | 92 |
* (non-Javadoc) |
77 | 93 |
* @see org.gvsig.fmap.dal.coverage.buffer.RasterQuery#setAreaOfInterest(double, double, double, double) |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RasterProvider.java | ||
---|---|---|
38 | 38 |
import org.gvsig.fmap.dal.coverage.store.props.Histogram; |
39 | 39 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
40 | 40 |
import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider; |
41 |
import org.gvsig.raster.impl.store.properties.DatasetMetadata;
|
|
42 |
import org.gvsig.raster.impl.store.properties.DatasetStatistics;
|
|
41 |
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
|
|
42 |
import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
|
|
43 | 43 |
|
44 | 44 |
/** |
45 | 45 |
* Interfaz que deben implementar cualquier fuente de datos raster. Estas pueden estar |
... | ... | |
147 | 147 |
* Obtiene el objeto con las estadisticas |
148 | 148 |
* @return MultiFileStatistics |
149 | 149 |
*/ |
150 |
public DatasetStatistics getStatistics();
|
|
150 |
public DataStoreStatistics getStatistics();
|
|
151 | 151 |
|
152 | 152 |
/** |
153 | 153 |
* Obtiene el extent del raster. |
... | ... | |
212 | 212 |
* Gets a DatasetMetadata object |
213 | 213 |
* @return |
214 | 214 |
*/ |
215 |
public DatasetMetadata getMetadata();
|
|
215 |
public DataStoreMetadata getMetadata();
|
|
216 | 216 |
|
217 | 217 |
/** |
218 | 218 |
* Obtiene el objeto que contiene que contiene la interpretaci?n de |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultRasterProvider.java | ||
---|---|---|
69 | 69 |
import org.gvsig.raster.impl.datastruct.serializer.ColorTableRmfSerializer; |
70 | 70 |
import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer; |
71 | 71 |
import org.gvsig.raster.impl.store.AbstractRasterStoreParameters; |
72 |
import org.gvsig.raster.impl.store.properties.DatasetColorInterpretation;
|
|
73 |
import org.gvsig.raster.impl.store.properties.DatasetHistogram;
|
|
74 |
import org.gvsig.raster.impl.store.properties.DatasetMetadata;
|
|
75 |
import org.gvsig.raster.impl.store.properties.DatasetStatistics;
|
|
72 |
import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
|
|
73 |
import org.gvsig.raster.impl.store.properties.DataStoreHistogram;
|
|
74 |
import org.gvsig.raster.impl.store.properties.DataStoreMetadata;
|
|
75 |
import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
|
|
76 | 76 |
import org.gvsig.raster.impl.store.rmf.ClassSerializer; |
77 | 77 |
import org.gvsig.raster.impl.store.rmf.RmfBlocksManager; |
78 | 78 |
import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer; |
... | ... | |
111 | 111 |
protected double noData = 0; |
112 | 112 |
protected String wktProjection = ""; |
113 | 113 |
|
114 |
protected DatasetStatistics stats = new DatasetStatistics(this);
|
|
115 |
protected DatasetHistogram histogram = null;
|
|
114 |
protected DataStoreStatistics stats = new DataStoreStatistics(this);
|
|
115 |
protected DataStoreHistogram histogram = null;
|
|
116 | 116 |
protected AbstractRasterStoreParameters param = null; |
117 | 117 |
protected RmfBlocksManager rmfBlocksManager = null; |
118 | 118 |
protected ColorTable colorTable = null; |
119 |
protected DatasetColorInterpretation colorInterpretation = null;
|
|
119 |
protected DataStoreColorInterpretation colorInterpretation = null;
|
|
120 | 120 |
|
121 | 121 |
/** |
122 | 122 |
* Indica si el valor NoData esta activo |
... | ... | |
494 | 494 |
} |
495 | 495 |
|
496 | 496 |
if (colorInterpSerializer.getResult() != null) { |
497 |
DatasetColorInterpretation ci = (DatasetColorInterpretation) colorInterpSerializer.getResult();
|
|
497 |
DataStoreColorInterpretation ci = (DataStoreColorInterpretation) colorInterpSerializer.getResult();
|
|
498 | 498 |
setColorInterpretation(ci); |
499 |
if (ci.getBand(DatasetColorInterpretation.ALPHA_BAND) != -1)
|
|
500 |
getTransparency().setTransparencyBand(ci.getBand(DatasetColorInterpretation.ALPHA_BAND));
|
|
499 |
if (ci.getBand(DataStoreColorInterpretation.ALPHA_BAND) != -1)
|
|
500 |
getTransparency().setTransparencyBand(ci.getBand(DataStoreColorInterpretation.ALPHA_BAND));
|
|
501 | 501 |
} |
502 | 502 |
|
503 | 503 |
if (projectionRmfSerializer.getResult() != null) |
... | ... | |
923 | 923 |
* (non-Javadoc) |
924 | 924 |
* @see org.gvsig.raster.impl.provider.RasterProvider#getMetadata() |
925 | 925 |
*/ |
926 |
public DatasetMetadata getMetadata() {
|
|
926 |
public DataStoreMetadata getMetadata() {
|
|
927 | 927 |
return null; |
928 | 928 |
} |
929 | 929 |
|
... | ... | |
938 | 938 |
/** |
939 | 939 |
* Asigna el objeto que contiene que contiene la interpretaci?n de |
940 | 940 |
* color por banda |
941 |
* @param DatasetColorInterpretation
|
|
941 |
* @param DataStoreColorInterpretation
|
|
942 | 942 |
*/ |
943 |
public void setColorInterpretation(DatasetColorInterpretation colorInterpretation){
|
|
943 |
public void setColorInterpretation(DataStoreColorInterpretation colorInterpretation){
|
|
944 | 944 |
this.colorInterpretation = colorInterpretation; |
945 | 945 |
} |
946 | 946 |
|
... | ... | |
948 | 948 |
* (non-Javadoc) |
949 | 949 |
* @see org.gvsig.raster.impl.dataset.RasterProvider#getStatistics() |
950 | 950 |
*/ |
951 |
public DatasetStatistics getStatistics() {
|
|
951 |
public DataStoreStatistics getStatistics() {
|
|
952 | 952 |
return stats; |
953 | 953 |
} |
954 | 954 |
|
... | ... | |
958 | 958 |
*/ |
959 | 959 |
public Histogram getHistogram() { |
960 | 960 |
if (histogram == null) |
961 |
histogram = new DatasetHistogram(this);
|
|
961 |
histogram = new DataStoreHistogram(this);
|
|
962 | 962 |
return histogram; |
963 | 963 |
} |
964 | 964 |
|
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/StatisticsRmfSerializer.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.store.props.Statistics; |
30 |
import org.gvsig.raster.impl.store.properties.DatasetStatistics;
|
|
30 |
import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
|
|
31 | 31 |
import org.gvsig.raster.impl.store.rmf.ClassSerializer; |
32 | 32 |
import org.gvsig.tools.ToolsLocator; |
33 | 33 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
... | ... | |
83 | 83 |
public static final String KEY = "Key"; |
84 | 84 |
public static final String VALUE = "Value"; |
85 | 85 |
|
86 |
private DatasetStatistics stat = null;
|
|
86 |
private DataStoreStatistics stat = null;
|
|
87 | 87 |
|
88 | 88 |
/** |
89 | 89 |
* Registra StatisticsRmfSerializer en los puntos de extension de Serializer |
... | ... | |
102 | 102 |
if (stat != null) |
103 | 103 |
stat.setCalculated(false); |
104 | 104 |
|
105 |
this.stat = (DatasetStatistics)stat;
|
|
105 |
this.stat = (DataStoreStatistics)stat;
|
|
106 | 106 |
} |
107 | 107 |
|
108 | 108 |
/** |
109 | 109 |
* Devuelve el objeto estadisticas de un dataset, en caso de no existir, lo crea. |
110 | 110 |
* @return |
111 | 111 |
*/ |
112 |
private DatasetStatistics getDatasetStatistics() {
|
|
112 |
private DataStoreStatistics getDatasetStatistics() {
|
|
113 | 113 |
if (stat == null) |
114 |
stat = new DatasetStatistics(null);
|
|
114 |
stat = new DataStoreStatistics(null);
|
|
115 | 115 |
|
116 | 116 |
return stat; |
117 | 117 |
} |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/SerialRmfSerializer.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.impl.store.serializer; |
|
23 |
|
|
24 |
import java.io.IOException; |
|
25 |
import java.io.Reader; |
|
26 |
import java.io.StringReader; |
|
27 |
import java.text.ParseException; |
|
28 |
import java.util.ArrayList; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.coverage.exception.ParsingException; |
|
31 |
import org.gvsig.fmap.dal.coverage.store.props.SerialInfo; |
|
32 |
import org.gvsig.raster.impl.datastruct.TimeInfo; |
|
33 |
import org.gvsig.raster.impl.store.properties.DataStoreSerialInfo; |
|
34 |
import org.gvsig.raster.impl.store.rmf.ClassSerializer; |
|
35 |
import org.gvsig.tools.ToolsLocator; |
|
36 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
37 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
38 |
import org.kxml2.io.KXmlParser; |
|
39 |
import org.xmlpull.v1.XmlPullParserException; |
|
40 |
/** |
|
41 |
* <P> |
|
42 |
* Clase para convertir a XML la informaci?n de una serie y obtener esta informaci?n desde XML. |
|
43 |
* Esta clase implementa el interfaz IRmfBlock con los m?todos de escritura y |
|
44 |
* lectura. Estos ser?n utilizados por el gestor de ficheros RMF para escribir y |
|
45 |
* leer datos. |
|
46 |
* </P> |
|
47 |
* <P> |
|
48 |
* La estructura XML es la siguiente: |
|
49 |
* </P> |
|
50 |
* <P> |
|
51 |
* \<Serials\><BR> |
|
52 |
* \<Serial\><BR> |
|
53 |
* \<Name\>katrina\</Name\><BR> |
|
54 |
* \<Description\>Evoluci?n del huracan katrina\</Description\><BR> |
|
55 |
* \<Type\>Single value\</Type\><BR> |
|
56 |
* \<Dates\><BR> |
|
57 |
* \<Date\>28//8//2005-6:10:00\</Date\><BR> |
|
58 |
* \</Dates\><BR> |
|
59 |
* \</Serial\><BR> |
|
60 |
* \</Serials\><BR> |
|
61 |
* </P> |
|
62 |
* |
|
63 |
* @version 23/04/2007 |
|
64 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
65 |
*/ |
|
66 |
public class SerialRmfSerializer extends ClassSerializer { |
|
67 |
//TAGS |
|
68 |
public static final String MAIN_TAG = "Serials"; |
|
69 |
public static final String SERIAL = "Serial"; |
|
70 |
public static final String DESC = "Description"; |
|
71 |
public static final String TYPE = "Type"; |
|
72 |
public static final String DATES = "Dates"; |
|
73 |
public static final String DATE = "Date"; |
|
74 |
public static final String NAME = "Name"; |
|
75 |
private SerialInfo serialInfo = null; |
|
76 |
|
|
77 |
/** |
|
78 |
* Registra GeoPointRmfSerializer en los puntos de extension de Serializer |
|
79 |
*/ |
|
80 |
public static void register() { |
|
81 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
|
82 |
ExtensionPoint point = extensionPoints.get("Serializer"); |
|
83 |
point.append("Series", "", SerialRmfSerializer.class); |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* Constructor. Asigna la lista de puntos a serializar. |
|
88 |
* @param ColorTable tabla a convertir en XML |
|
89 |
*/ |
|
90 |
public SerialRmfSerializer(SerialInfo serialInfo) { |
|
91 |
this.serialInfo = serialInfo; |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* Parsers a date list |
|
96 |
* @param tInfo |
|
97 |
* @param parser |
|
98 |
* @param xml |
|
99 |
* @param tag |
|
100 |
* @throws XmlPullParserException |
|
101 |
* @throws IOException |
|
102 |
* @throws ParsingException |
|
103 |
* @throws NumberFormatException |
|
104 |
*/ |
|
105 |
public void parserDates(TimeInfo tInfo, KXmlParser parser, String parseableTag, String[] errorTags) throws XmlPullParserException, IOException, NumberFormatException, ParsingException { |
|
106 |
boolean end = false; |
|
107 |
boolean init = false; |
|
108 |
int tag = parser.next(); |
|
109 |
while (!end) { |
|
110 |
switch (tag) { |
|
111 |
case KXmlParser.END_DOCUMENT: |
|
112 |
return; |
|
113 |
case KXmlParser.START_TAG: |
|
114 |
if (parser.getName().compareTo(parseableTag) == 0) |
|
115 |
init = true; |
|
116 |
if(init) { |
|
117 |
String d = parserString(parser, DATE, errorTags); |
|
118 |
try { |
|
119 |
tInfo.addDate(d); |
|
120 |
} catch (ParseException e) { |
|
121 |
} |
|
122 |
} |
|
123 |
break; |
|
124 |
case KXmlParser.END_TAG: |
|
125 |
if (parser.getName().compareTo(parseableTag) == 0) |
|
126 |
end = true; |
|
127 |
break; |
|
128 |
case KXmlParser.TEXT: |
|
129 |
break; |
|
130 |
} |
|
131 |
if (!end) |
|
132 |
tag = parser.next(); |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
136 |
/** |
|
137 |
* Parsers a serial structure |
|
138 |
* @param tInfo |
|
139 |
* @param parser |
|
140 |
* @param xml |
|
141 |
* @param tag |
|
142 |
* @throws XmlPullParserException |
|
143 |
* @throws IOException |
|
144 |
* @throws ParsingException |
|
145 |
* @throws NumberFormatException |
|
146 |
*/ |
|
147 |
public void parserSerial(TimeInfo tInfo, KXmlParser parser, String xml, int tag) throws XmlPullParserException, IOException, NumberFormatException, ParsingException { |
|
148 |
String name = parserString(parser, NAME, null); |
|
149 |
String desc = parserString(parser, DESC, null); |
|
150 |
String type = parserString(parser, TYPE, null); |
|
151 |
tInfo.setSerialName(name); |
|
152 |
tInfo.setDescription(desc); |
|
153 |
tInfo.setTimeType(type); |
|
154 |
parserDates(tInfo, parser, DATES, null); |
|
155 |
} |
|
156 |
|
|
157 |
/* |
|
158 |
* (non-Javadoc) |
|
159 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#read(java.lang.String) |
|
160 |
*/ |
|
161 |
public void read(String xml) throws ParsingException { |
|
162 |
ArrayList<TimeInfo> list = new ArrayList<TimeInfo>(); |
|
163 |
TimeInfo tInfo = null; |
|
164 |
boolean init = false; |
|
165 |
int nPoint = -1; |
|
166 |
boolean tagOk = false; |
|
167 |
|
|
168 |
KXmlParser parser = new KXmlParser(); |
|
169 |
Reader reader = new StringReader(xml); |
|
170 |
try { |
|
171 |
parser.setInput(reader); |
|
172 |
} catch (XmlPullParserException e) { |
|
173 |
throw new ParsingException(xml); |
|
174 |
} |
|
175 |
try { |
|
176 |
int tag = parser.nextTag(); |
|
177 |
|
|
178 |
if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){ |
|
179 |
parser.require(KXmlParser.START_TAG, null, MAIN_TAG); |
|
180 |
while(tag != KXmlParser.END_DOCUMENT) { |
|
181 |
switch(tag) { |
|
182 |
case KXmlParser.START_TAG: |
|
183 |
if (parser.getName().compareTo(MAIN_TAG) == 0) |
|
184 |
init = true; |
|
185 |
if(init) { |
|
186 |
if (parser.getName().compareTo(SERIAL) == 0) { |
|
187 |
tInfo = new TimeInfo(); |
|
188 |
tagOk = true; |
|
189 |
nPoint++; |
|
190 |
} |
|
191 |
} |
|
192 |
break; |
|
193 |
case KXmlParser.END_TAG: |
|
194 |
break; |
|
195 |
case KXmlParser.TEXT: |
|
196 |
if(tagOk) { |
|
197 |
parserSerial(tInfo, parser, xml, tag); |
|
198 |
tagOk = false; |
|
199 |
list.add(tInfo); |
|
200 |
} |
|
201 |
break; |
|
202 |
} |
|
203 |
tag = parser.next(); |
|
204 |
} |
|
205 |
parser.require(KXmlParser.END_DOCUMENT, null, null); |
|
206 |
} |
|
207 |
|
|
208 |
} catch (XmlPullParserException e) { |
|
209 |
throw new ParsingException(xml); |
|
210 |
} catch (IOException e) { |
|
211 |
throw new ParsingException(xml); |
|
212 |
} |
|
213 |
|
|
214 |
serialInfo = new DataStoreSerialInfo(); |
|
215 |
((DataStoreSerialInfo)serialInfo).setSerial(list); |
|
216 |
} |
|
217 |
|
|
218 |
/* |
|
219 |
* (non-Javadoc) |
|
220 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#write() |
|
221 |
*/ |
|
222 |
public String write() { |
|
223 |
StringBuffer b = new StringBuffer(); |
|
224 |
DataStoreSerialInfo si = (DataStoreSerialInfo)serialInfo; |
|
225 |
|
|
226 |
b.append("<" + MAIN_TAG + ">\n"); |
|
227 |
for (int i = 0; i < si.getNumberOfSerials(); i++) { |
|
228 |
TimeInfo ti = si.getSerial(i); |
|
229 |
b.append("\t<" + SERIAL + ">\n"); |
|
230 |
putProperty(b, NAME, ti.getSerialName(), 2); |
|
231 |
putProperty(b, DESC, ti.getDescription(), 2); |
|
232 |
putProperty(b, TYPE, ti.getTimeType() + "", 2); |
|
233 |
b.append("\t<" + DATES + ">\n"); |
|
234 |
for (int j = 0; j < ti.getTime().size(); j++) { |
|
235 |
putProperty(b, DATE, ti.getTimeInfo(j), 3); |
|
236 |
} |
|
237 |
b.append("\t<" + DATES + " n=\"" + i + "\">\n"); |
|
238 |
b.append("\t</" + SERIAL + ">\n"); |
|
239 |
} |
|
240 |
b.append("</" + MAIN_TAG + ">\n"); |
|
241 |
return b.toString(); |
|
242 |
} |
|
243 |
|
|
244 |
/* |
|
245 |
* (non-Javadoc) |
|
246 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getResult() |
|
247 |
*/ |
|
248 |
public Object getResult() { |
|
249 |
return serialInfo; |
|
250 |
} |
|
251 |
|
|
252 |
/* |
|
253 |
* (non-Javadoc) |
|
254 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getMainTag() |
|
255 |
*/ |
|
256 |
public String getMainTag() { |
|
257 |
return MAIN_TAG; |
|
258 |
} |
|
259 |
} |
|
0 | 260 |
org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoPointListRmfSerializer.java | ||
---|---|---|
105 | 105 |
public static final String MAPX = "MapX"; |
106 | 106 |
public static final String MAPY = "MapY"; |
107 | 107 |
public static final String ACTIVE = "Active"; |
108 |
public static final String LEFTCP = "LeftCenterPoint"; |
|
109 |
public static final String RIGHTCP = "RightCenterPoint"; |
|
110 |
public static final String X = "X"; |
|
111 |
public static final String Y = "Y"; |
|
112 |
public static final String LEFTVP = "LeftViewPort"; |
|
113 |
public static final String RIGHTVP = "RightViewPort"; |
|
114 | 108 |
public static final String PROJ = "Proj"; |
115 | 109 |
public static final String BBOX = "Bbox"; |
116 | 110 |
public static final String PX = "Px"; |
... | ... | |
120 | 114 |
public static final String PDIM = "Pdim"; |
121 | 115 |
public static final String WIDTH = "Width"; |
122 | 116 |
public static final String HEIGHT = "Height"; |
123 |
public static final String ZOOM = "Zoom"; |
|
124 | 117 |
public static final String LYR = "Layer"; |
125 | 118 |
|
126 | 119 |
private GeoPointList gpList = null; |
... | ... | |
130 | 123 |
* Registra GeoPointRmfSerializer en los puntos de extension de Serializer |
131 | 124 |
*/ |
132 | 125 |
public static void register() { |
133 |
ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager(); |
|
134 |
ExtensionPoint point=extensionPoints.get("Serializer");
|
|
126 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
|
|
127 |
ExtensionPoint point = extensionPoints.get("Serializer");
|
|
135 | 128 |
point.append("GeoPoint", "", GeoPointListRmfSerializer.class); |
136 | 129 |
} |
137 | 130 |
|
... | ... | |
159 | 152 |
} |
160 | 153 |
|
161 | 154 |
/** |
162 |
* Parsea un bloque correspondiente a un punto central |
|
163 |
* @param gp |
|
164 |
* @param parser |
|
165 |
* @param parseableTag |
|
166 |
* @throws NumberFormatException |
|
167 |
* @throws XmlPullParserException |
|
168 |
* @throws IOException |
|
169 |
*/ |
|
170 |
/*private void parserCenterPoint(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
|
171 |
boolean end = false; |
|
172 |
boolean begin = true; |
|
173 |
boolean tagOk = false; |
|
174 |
int tag = parser.next(); |
|
175 |
while (!end) { |
|
176 |
switch(tag) { |
|
177 |
case KXmlParser.START_TAG: |
|
178 |
if(parser.getName() != null){ |
|
179 |
if (parser.getName().compareTo(parseableTag) == 0) { |
|
180 |
tagOk = true; |
|
181 |
begin = false; |
|
182 |
} else { |
|
183 |
if(begin)//Condicion de salida |
|
184 |
return; |
|
185 |
} |
|
186 |
} |
|
187 |
break; |
|
188 |
case KXmlParser.END_TAG: |
|
189 |
if (parser.getName().compareTo(parseableTag) == 0) |
|
190 |
end = true; |
|
191 |
break; |
|
192 |
case KXmlParser.TEXT: |
|
193 |
if(tagOk) { |
|
194 |
if(parseableTag.compareTo("LeftCenterPoint") == 0) { |
|
195 |
double x = Double.valueOf(parserString(parser, X, null)).doubleValue(); |
|
196 |
double y = Double.valueOf(parserString(parser, Y, null)).doubleValue(); |
|
197 |
gp.leftCenterPoint = new Point2D.Double(x, y); |
|
198 |
} |
|
199 |
if(parseableTag.compareTo("RightCenterPoint") == 0) { |
|
200 |
double x = Double.valueOf(parserString(parser, X, null)).doubleValue(); |
|
201 |
double y = Double.valueOf(parserString(parser, Y, null)).doubleValue(); |
|
202 |
gp.rightCenterPoint = new Point2D.Double(x, y); |
|
203 |
} |
|
204 |
tagOk = false; |
|
205 |
} |
|
206 |
break; |
|
207 |
} |
|
208 |
if (!end) |
|
209 |
tag = parser.next(); |
|
210 |
} |
|
211 |
}*/ |
|
212 |
|
|
213 |
/** |
|
214 |
* Parsea un bloque correspondiente a un punto central |
|
215 |
* @param gp |
|
216 |
* @param parser |
|
217 |
* @param parseableTag |
|
218 |
* @throws NumberFormatException |
|
219 |
* @throws XmlPullParserException |
|
220 |
* @throws IOException |
|
221 |
*/ |
|
222 |
/*private void parserBoundingBox(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
|
223 |
boolean end = false; |
|
224 |
boolean tagOk = false; |
|
225 |
int tag = parser.next(); |
|
226 |
while (!end) { |
|
227 |
switch(tag) { |
|
228 |
case KXmlParser.START_TAG: |
|
229 |
if(parser.getName() != null){ |
|
230 |
if (parser.getName().compareTo(BBOX) == 0) |
|
231 |
tagOk = true; |
|
232 |
} |
|
233 |
break; |
|
234 |
case KXmlParser.END_TAG: |
|
235 |
if (parser.getName().compareTo(BBOX) == 0) |
|
236 |
end = true; |
|
237 |
break; |
|
238 |
case KXmlParser.TEXT: |
|
239 |
if(tagOk) { |
|
240 |
if(parseableTag.compareTo("LeftViewPort") == 0) { |
|
241 |
double x = Double.valueOf(parserString(parser, PX, null)).doubleValue(); |
|
242 |
double y = Double.valueOf(parserString(parser, PY, null)).doubleValue(); |
|
243 |
double w = Double.valueOf(parserString(parser, WCWIDTH, null)).doubleValue(); |
|
244 |
double h = Double.valueOf(parserString(parser, WCHEIGHT, null)).doubleValue(); |
|
245 |
gp.leftViewPort.setExtent(new Extent(x, y, x + w, y - h)); |
|
246 |
} |
|
247 |
if(parseableTag.compareTo("RightViewPort") == 0) { |
|
248 |
double x = Double.valueOf(parserString(parser, PX, null)).doubleValue(); |
|
249 |
double y = Double.valueOf(parserString(parser, PY, null)).doubleValue(); |
|
250 |
double w = Double.valueOf(parserString(parser, WCWIDTH, null)).doubleValue(); |
|
251 |
double h = Double.valueOf(parserString(parser, WCHEIGHT, null)).doubleValue(); |
|
252 |
gp.rightViewPort.setExtent(new Extent(x, y, x + w, y - h)); |
|
253 |
} |
|
254 |
tagOk = false; |
|
255 |
} |
|
256 |
break; |
|
257 |
} |
|
258 |
if (!end) |
|
259 |
tag = parser.next(); |
|
260 |
} |
|
261 |
}*/ |
|
262 |
|
|
263 |
/** |
|
264 |
* Parsea un bloque correspondiente a un punto central |
|
265 |
* @param gp |
|
266 |
* @param parser |
|
267 |
* @param parseableTag |
|
268 |
* @throws NumberFormatException |
|
269 |
* @throws XmlPullParserException |
|
270 |
* @throws IOException |
|
271 |
*/ |
|
272 |
/*private void parserDimension(GeoPoint gp, KXmlParser parser, String parseableTag) throws NumberFormatException, XmlPullParserException, IOException { |
|
273 |
boolean end = false; |
|
274 |
boolean tagOk = false; |
|
275 |
int tag = parser.next(); |
|
276 |
while (!end) { |
Also available in: Unified diff