gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.main / src / test / java / org / gvsig / fmap / dal / coverage / grid / TestGridInstanciation.java @ 2443
History | View | Annotate | Download (2.63 KB)
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.grid; |
23 |
|
24 |
import org.gvsig.fmap.dal.coverage.BaseTestCase; |
25 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
26 |
import org.gvsig.fmap.dal.coverage.datastruct.GridExtent; |
27 |
import org.gvsig.fmap.dal.coverage.exception.GridException; |
28 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
29 |
import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException; |
30 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
31 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
32 |
import org.gvsig.raster.impl.grid.GridExtentImpl; |
33 |
import org.gvsig.raster.impl.grid.GridImpl; |
34 |
|
35 |
/**
|
36 |
*
|
37 |
* 10/06/2008
|
38 |
* @author Nacho Brodin nachobrodin@gmail.com
|
39 |
*/
|
40 |
public class TestGridInstanciation extends BaseTestCase { |
41 |
private String path1 = baseDir + "miniRaster28x25F32.tif"; |
42 |
private String outImage = "prueba.asc"; |
43 |
private RasterDataStore f1 = null; |
44 |
private Grid grid = null; |
45 |
|
46 |
public void start() throws Exception { |
47 |
this.setUp();
|
48 |
this.testStack();
|
49 |
} |
50 |
|
51 |
protected void doSetUp() throws Exception { |
52 |
System.err.println("GridInstanciationTest running..."); |
53 |
|
54 |
try {
|
55 |
super.doSetUp();
|
56 |
} catch (Exception e) { |
57 |
e.printStackTrace(); |
58 |
} |
59 |
|
60 |
try {
|
61 |
f1 = manager.open(path1); |
62 |
Extent ext = f1.getExtent(); |
63 |
GridExtent windowExtent = new GridExtentImpl(ext, 5, -5); |
64 |
grid = new GridImpl(f1, new int[]{0, 1, 2}, windowExtent); |
65 |
|
66 |
grid.loadWriterData(); |
67 |
grid.exportToArcViewASCIIFile(outImage); |
68 |
} catch (NotSupportedExtensionException e) {
|
69 |
e.printStackTrace(); |
70 |
} catch (RasterDriverException e) {
|
71 |
e.printStackTrace(); |
72 |
} catch (RasterBufferInvalidException e) {
|
73 |
e.printStackTrace(); |
74 |
} catch (GridException e) {
|
75 |
e.printStackTrace(); |
76 |
} |
77 |
} |
78 |
|
79 |
public void testStack() { |
80 |
|
81 |
} |
82 |
} |