root / trunk / extensions / extRemoteSensing / src-test / org / gvsig / remotesensing / processtest / TGridMathProcessTest.java @ 16993
History | View | Annotate | Download (1.79 KB)
1 |
package org.gvsig.remotesensing.processtest; |
---|---|
2 |
|
3 |
import java.util.HashMap; |
4 |
|
5 |
import junit.framework.TestCase; |
6 |
|
7 |
import org.gvsig.raster.RasterLibrary; |
8 |
import org.gvsig.raster.buffer.BufferFactory; |
9 |
import org.gvsig.raster.buffer.RasterBufferInvalidException; |
10 |
import org.gvsig.raster.dataset.NotSupportedExtensionException; |
11 |
import org.gvsig.raster.dataset.RasterDataset; |
12 |
import org.gvsig.raster.dataset.RasterDriverException; |
13 |
import org.gvsig.raster.grid.Grid; |
14 |
import org.gvsig.remotesensing.gridmath.GridMathProcess; |
15 |
import org.gvsig.remotesensing.gridmath.gui.CalculatorPanel; |
16 |
import org.nfunk.jep.JEP; |
17 |
|
18 |
|
19 |
import com.iver.cit.gvsig.fmap.MapContext; |
20 |
|
21 |
|
22 |
public class TGridMathProcessTest extends TestCase { |
23 |
|
24 |
private String baseDir = "./test-images/"; |
25 |
private String path1 = baseDir + "bhtmref.img"; |
26 |
private RasterDataset f1 = null; |
27 |
private BufferFactory ds1 = null; |
28 |
|
29 |
static{
|
30 |
RasterLibrary.wakeUp(); |
31 |
} |
32 |
|
33 |
public void start() { |
34 |
this.setUp();
|
35 |
this.testStack();
|
36 |
} |
37 |
|
38 |
public void setUp() { |
39 |
System.err.println("TGridMathProcessTest running..."); |
40 |
try {
|
41 |
f1 = RasterDataset.open(null, path1);
|
42 |
} catch (NotSupportedExtensionException e) {
|
43 |
e.printStackTrace(); |
44 |
} |
45 |
ds1 = new BufferFactory(f1);
|
46 |
|
47 |
} |
48 |
public void testStack() { |
49 |
try {
|
50 |
|
51 |
JEP j= new JEP();
|
52 |
// public GridMathProcess(String expression, HashMap params,GridExtent resultExtent,MapContext mapContext,String filePath)
|
53 |
Grid g = new Grid(ds1,new int[]{1}); |
54 |
Grid g2 = new Grid(ds1,new int[]{2}); |
55 |
CalculatorPanel cp= new CalculatorPanel(null,null); |
56 |
cp.getQWindowsHash().put("b1", g);
|
57 |
cp.getQWindowsHash().put("b2", g2);
|
58 |
// GridMathProcess proceso= new GridMathProcess("b1+b2", cp.getQWindowsHash(),g.getGridExtent(),null,"filename");
|
59 |
// proceso.run();
|
60 |
|
61 |
} catch (RasterBufferInvalidException e1) {
|
62 |
e1.printStackTrace(); |
63 |
} |
64 |
} |
65 |
|
66 |
|
67 |
|
68 |
} |