Revision 27361 trunk/libraries/libRaster/src/org/gvsig/raster/grid/GridWriter.java
GridWriter.java | ||
---|---|---|
52 | 52 |
rasterBuf = RasterBuffer.getBuffer(dataType, iNX, iNY, bands.length, true); |
53 | 53 |
} |
54 | 54 |
|
55 |
public void assign(byte value) throws RasterBufferInvalidAccessException { |
|
55 |
public void assign(byte value) throws RasterBufferInvalidAccessException, InterruptedException {
|
|
56 | 56 |
try{ |
57 | 57 |
rasterBuf.assign(bandToOperate, value); |
58 | 58 |
}catch(ArrayIndexOutOfBoundsException e){ |
... | ... | |
62 | 62 |
} |
63 | 63 |
} |
64 | 64 |
|
65 |
public void assign(short value) throws RasterBufferInvalidAccessException { |
|
65 |
public void assign(short value) throws RasterBufferInvalidAccessException, InterruptedException {
|
|
66 | 66 |
try{ |
67 | 67 |
rasterBuf.assign(bandToOperate, value); |
68 | 68 |
}catch(ArrayIndexOutOfBoundsException e){ |
... | ... | |
72 | 72 |
} |
73 | 73 |
} |
74 | 74 |
|
75 |
public void assign(int value) throws RasterBufferInvalidAccessException { |
|
75 |
public void assign(int value) throws RasterBufferInvalidAccessException, InterruptedException {
|
|
76 | 76 |
try{ |
77 | 77 |
rasterBuf.assign(bandToOperate, value); |
78 | 78 |
}catch(ArrayIndexOutOfBoundsException e){ |
... | ... | |
82 | 82 |
} |
83 | 83 |
} |
84 | 84 |
|
85 |
public void assign(float value) throws RasterBufferInvalidAccessException { |
|
85 |
public void assign(float value) throws RasterBufferInvalidAccessException, InterruptedException {
|
|
86 | 86 |
try{ |
87 | 87 |
rasterBuf.assign(bandToOperate, value); |
88 | 88 |
}catch(ArrayIndexOutOfBoundsException e){ |
... | ... | |
92 | 92 |
} |
93 | 93 |
} |
94 | 94 |
|
95 |
public void assign(double value) throws RasterBufferInvalidAccessException { |
|
95 |
public void assign(double value) throws RasterBufferInvalidAccessException, InterruptedException {
|
|
96 | 96 |
try{ |
97 | 97 |
rasterBuf.assign(bandToOperate, value); |
98 | 98 |
}catch(ArrayIndexOutOfBoundsException e){ |
... | ... | |
106 | 106 |
return extent; |
107 | 107 |
} |
108 | 108 |
|
109 |
public void setCellValue( int iX, int iY, byte value) throws OutOfGridException { |
|
109 |
public void setCellValue( int iX, int iY, byte value) throws OutOfGridException, InterruptedException {
|
|
110 | 110 |
if (isCellInGrid(iX, iY)) |
111 | 111 |
rasterBuf.setElem(iY, iX, bandToOperate, value); |
112 | 112 |
else |
113 | 113 |
throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid."); |
114 | 114 |
} |
115 | 115 |
|
116 |
public void setCellValue( int iX, int iY, short value) throws OutOfGridException { |
|
116 |
public void setCellValue( int iX, int iY, short value) throws OutOfGridException, InterruptedException {
|
|
117 | 117 |
if (isCellInGrid(iX, iY)) |
118 | 118 |
rasterBuf.setElem(iY, iX, bandToOperate, value); |
119 | 119 |
else |
120 | 120 |
throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid."); |
121 | 121 |
} |
122 | 122 |
|
123 |
public void setCellValue( int iX, int iY, int value) throws OutOfGridException { |
|
123 |
public void setCellValue( int iX, int iY, int value) throws OutOfGridException, InterruptedException {
|
|
124 | 124 |
if (isCellInGrid(iX, iY)) |
125 | 125 |
rasterBuf.setElem(iY, iX, bandToOperate, value); |
126 | 126 |
else |
127 | 127 |
throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid."); |
128 | 128 |
} |
129 | 129 |
|
130 |
public void setCellValue( int iX, int iY, float value) throws OutOfGridException { |
|
130 |
public void setCellValue( int iX, int iY, float value) throws OutOfGridException, InterruptedException {
|
|
131 | 131 |
if (isCellInGrid(iX, iY)) |
132 | 132 |
rasterBuf.setElem(iY, iX, bandToOperate, value); |
133 | 133 |
else |
134 | 134 |
throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid."); |
135 | 135 |
} |
136 | 136 |
|
137 |
public void setCellValue( int iX, int iY, double value) throws OutOfGridException { |
|
137 |
public void setCellValue( int iX, int iY, double value) throws OutOfGridException, InterruptedException {
|
|
138 | 138 |
if (isCellInGrid(iX, iY)) |
139 | 139 |
rasterBuf.setElem(iY, iX, bandToOperate, value); |
140 | 140 |
else |
141 | 141 |
throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid."); |
142 | 142 |
} |
143 | 143 |
|
144 |
public void setNoData( int iX, int iY) { |
|
144 |
public void setNoData( int iX, int iY) throws InterruptedException {
|
|
145 | 145 |
if (isCellInGrid(iX,iY)) { |
146 | 146 |
switch(rasterBuf.getDataType()) { |
147 | 147 |
case IBuffer.TYPE_BYTE: rasterBuf.setElem(iY, iX, bandToOperate, (byte)rasterBuf.getNoDataValue());break; |
... | ... | |
161 | 161 |
* @param sFile Nombre del fichero |
162 | 162 |
* @throws IOException |
163 | 163 |
* @throws NumberFormatException |
164 |
* @throws InterruptedException |
|
164 | 165 |
*/ |
165 | 166 |
public void ExportToArcViewASCIIFile(String sFile) |
166 |
throws IOException, NumberFormatException { |
|
167 |
throws IOException, NumberFormatException, InterruptedException {
|
|
167 | 168 |
ExportToArcViewASCIIFile(sFile, bandToOperate); |
168 | 169 |
} |
169 | 170 |
|
... | ... | |
175 | 176 |
* @throws NumberFormatException |
176 | 177 |
*/ |
177 | 178 |
public void ExportToArcViewASCIIFile(String sFile, int band) |
178 |
throws IOException, NumberFormatException { |
|
179 |
throws IOException, NumberFormatException, InterruptedException {
|
|
179 | 180 |
|
180 | 181 |
BufferedWriter fout = new BufferedWriter(new FileWriter(sFile)); |
181 | 182 |
|
Also available in: Unified diff