Revision 1752 org.gvsig.raster.georeferencing/trunk/org.gvsig.raster.georeferencing/org.gvsig.raster.georeferencing.lib/org.gvsig.raster.georeferencing.lib.impl/src/main/java/org/gvsig/raster/georeferencing/lib/impl/GeoreferencingProcess.java
GeoreferencingProcess.java | ||
---|---|---|
171 | 171 |
if(xCellSize >= 0 && yCellSize >= 0) { |
172 | 172 |
w = (int)((xmax - xmin) / xCellSize); |
173 | 173 |
h = (int)((ymax - ymin) / yCellSize); |
174 |
} else {
|
|
174 |
} |
|
175 | 175 |
|
176 |
} |
|
177 |
|
|
178 | 176 |
int dataType = store.getDataType()[0]; |
179 | 177 |
|
180 |
Buffer bufResult = RasterLocator.getManager().createBuffer( |
|
181 |
dataType, |
|
182 |
w, |
|
183 |
h, |
|
184 |
store.getBandCount(), |
|
185 |
true); |
|
178 |
Buffer bufResult = RasterLocator.getManager().createBuffer(dataType, w, h, store.getBandCount(), true); |
|
186 | 179 |
|
187 | 180 |
NoData nd = RasterLocator.getManager().getDataStructFactory().createDefaultNoData( |
188 | 181 |
store.getBandCount(), dataType); |
... | ... | |
195 | 188 |
for(int row = 0; row < bufResult.getHeight(); row++) { |
196 | 189 |
for(int col = 0; col < bufResult.getWidth(); col++) { |
197 | 190 |
coord = transform.getCoordPixel(col * xCellSize + xmin, ymax - row * yCellSize); |
198 |
// if(coord[0] < 0) |
|
199 |
// coord[0] = 0; |
|
200 |
// if(coord[1] < 0) |
|
201 |
// coord[1] = 0; |
|
202 |
// if(coord[0] > bufInput.getWidth() - 1) |
|
203 |
// coord[0] = bufInput.getWidth() - 1; |
|
204 |
// if(coord[1] > bufInput.getHeight() - 1) |
|
205 |
// coord[1] = bufInput.getHeight() - 1; |
|
206 |
|
|
207 | 191 |
for (int iBand = 0; iBand < store.getBandCount(); iBand++) { |
208 | 192 |
if( (coord[0] < 0) || (coord[1] < 0) || |
209 | 193 |
(coord[0] > bufInput.getWidth() - 1) || |
... | ... | |
254 | 238 |
return map; |
255 | 239 |
} |
256 | 240 |
|
241 |
/** |
|
242 |
* Saves the result in a file |
|
243 |
* @param sFilename |
|
244 |
* @param buf |
|
245 |
* @param xcellsize |
|
246 |
* @param ycellsize |
|
247 |
* @param minX |
|
248 |
* @param maxY |
|
249 |
* @return |
|
250 |
*/ |
|
257 | 251 |
public boolean export(final String sFilename, Buffer buf, double xcellsize, double ycellsize, double minX, double maxY) { |
258 | 252 |
|
259 | 253 |
try { |
Also available in: Unified diff