Revision 33483

View differences:

tags/v2_0_0_Build_2011/extensions/extGeoreferencing/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3
	<formats>
4
		<format>dir</format>
5
	</formats>
6
	<fileSets>
7
	<!-- Extructure for the extension -->
8
		<fileSet>
9
			<directory>config</directory>
10
			<outputDirectory>${extension.install.dir.name}</outputDirectory>
11
		</fileSet>
12
		<fileSet>
13
			<directory>data</directory>
14
			<outputDirectory>${extension.install.dir.name}/data</outputDirectory>
15
		</fileSet>
16
		<fileSet>
17
			<directory>images</directory>
18
			<outputDirectory>/${extension.install.dir.name}/images</outputDirectory>
19
		</fileSet>
20
	</fileSets>
21
	<files>
22
		<file>
23
			<source>build.number</source>
24
			<outputDirectory>${extension.install.dir.name}
25
			</outputDirectory>
26
		</file>
27
	</files>
28
	
29
	<dependencySets>
30
		<dependencySet>
31
			<outputDirectory>${extension.install.dir.name}/${library-dir}</outputDirectory>
32
			<includes>
33
				<include>org.gvsig:org.gvsig.georeferencing</include>
34
			</includes>
35
		</dependencySet>
36
		<dependencySet>
37
			<outputDirectory>${extension.install.dir.name}/${library-dir}</outputDirectory>
38
			<includes>
39
				<include>gov.nist.math:jama</include>
40
				<include>flanagan:flanagan</include>
41
			</includes>
42
		</dependencySet>
43
	</dependencySets>
44
</assembly>
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TGeotransformProcessRMS.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50
import org.gvsig.raster.datastruct.GeoPointList;
51

  
52
/**
53
 * Test que prueba la el proceso de geotransfornmcion dados una serie de puntos de
54
 * control.  Compara las coordenadas aproximadas tras el calculo de los polinomios de transformaci?n.
55
 * El punto en coordenadas mapa que se evalua es (1500,2500). Se comprueban los errores obtenidos tras el proceso 
56
 * con los calculados manualmente.
57
 * 
58
 * @author aMu?oz (alejandro.munoz@uclm.es)
59
 * */
60

  
61
public class TGeotransformProcessRMS extends TestCase {
62

  
63
	private GeoPoint gpcs[] = new GeoPoint[3];
64
	private double geoPoints[][] ={{ 1369.000000  	,	2985.750000	},
65
									 { 1673.500000  	,   2803.250000	},
66
									 { 2092.500000 	,   2933.250000	},
67
										 }; 
68
									 
69
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
70
									{ 803.000000     ,  2235.500000 },
71
									{ 1165.500000    ,  2285.250000	},
72
									};
73
	public void start() {
74
		this.testStack();
75
	}
76
	
77
	
78
	public void testStack() {
79
		System.err.println("TGeotransformProcessRMS running...");
80
		
81
		for(int i=0;i<geoPoints.length;i++)
82
		{
83
			Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
84
			Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
85
			gpcs[i]= new GeoPoint(pP,pW);
86
		}
87
		
88
		GeoTransformProcess proceso = new GeoTransformProcess();
89
		proceso.addParam("gpcs",gpcs);
90
		proceso.addParam("orden", new Integer(1));
91
		proceso.run();
92
		
93
		GeoTransformDataResult resultado= (GeoTransformDataResult) proceso.getResult();
94
		double coordPixel[]= resultado.getCoordPixel(1500,2500);
95
		
96
		// Aproximacion manual conocidos los coeficientes
97
		double x_value= -957.700+0.822655*1500+0.1369789*2500;
98
		double y_value= 155.357-0.13683*1500+0.82373*2500;
99
		assertEquals(coordPixel[0],x_value, 0.1);
100
		assertEquals(coordPixel[1],y_value, 0.1);
101
		
102
		
103
		// Se evaluan los RMS de los tres puntos de partida y se comparan con los obtenidos 
104
		// tras la transformaci?m.
105
		double x_1= -957.700+0.822655*1369+0.1369789*2985.75;
106
		double x_2= -957.700+0.822655*1673.5+0.1369789*2803.25;
107
		double x_3= -957.700+0.822655*2092.5+0.1369789*2933.25;
108
		
109
		double y_1= 155.357-0.13683*1369+0.82373*2985.75;
110
		double y_2= 155.357-0.13683*1673.5+0.82373*2803.25;
111
		double y_3= 155.357-0.13683*2092.5+0.82373*2933.25;
112
		
113
		assertEquals(x_1,resultado.getCoordPixel(1369.000000 ,2985.750000)[0],0.1);
114
		assertEquals(y_1,resultado.getCoordPixel(1369.000000 ,2985.750000)[1],0.1);
115
		
116
		assertEquals(x_2,resultado.getCoordPixel(1673.500000, 2803.250000)[0],0.1);
117
		assertEquals(y_2,resultado.getCoordPixel(1673.500000, 2803.250000)[1],0.1);
118
		
119
		assertEquals(x_3,resultado.getCoordPixel(2092.500000 , 2933.250000)[0],0.1);
120
		assertEquals(y_3,resultado.getCoordPixel(2092.500000 , 2933.250000)[1],0.1);
121
		
122
	
123
		GeoPointList list = resultado.getGpcs();
124

  
125
		// Comparativa del error en x
126
		assertEquals(Math.pow(x_1 - gpcs[0].pixelPoint.getX(), 2), list.get(0).getErrorX(), 0.001);
127
		assertEquals(Math.pow(x_2 - gpcs[1].pixelPoint.getX(), 2), list.get(1).getErrorX(), 0.001);
128
		assertEquals(Math.pow(x_3 - gpcs[2].pixelPoint.getX(), 2), list.get(2).getErrorX(), 0.001);
129

  
130
		// Comparativa del error en y
131
		assertEquals(Math.pow(y_1 - gpcs[0].pixelPoint.getY(), 2), list.get(0).getErrorY(), 0.001);
132
		assertEquals(Math.pow(y_2 - gpcs[1].pixelPoint.getY(), 2), list.get(1).getErrorY(), 0.001);
133
		assertEquals(Math.pow(y_3 - gpcs[2].pixelPoint.getY(), 2), list.get(2).getErrorY(), 0.001);	
134
				
135
		double rms1=Math.sqrt( Math.pow(x_1 - gpcs[0].pixelPoint.getX(), 2)+ Math.pow(y_1 - gpcs[0].pixelPoint.getY(), 2));
136
		double rms2=Math.sqrt( Math.pow(x_2 - gpcs[1].pixelPoint.getX(), 2)+ Math.pow(y_2 - gpcs[1].pixelPoint.getY(), 2));
137
		double rms3=Math.sqrt( Math.pow(x_3 - gpcs[2].pixelPoint.getX(), 2)+ Math.pow(y_3 - gpcs[2].pixelPoint.getY(), 2));
138
		
139
		assertEquals((rms1+rms2+rms3)/3, resultado.getRmsTotal(),0.01);
140
		
141
		
142
	}
143
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/AllGeoTransformTest.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import junit.framework.Test;
44
import junit.framework.TestCase;
45
import junit.framework.TestSuite;
46

  
47
public class AllGeoTransformTest extends TestCase {
48
	
49
	public static Test suite() {
50
		TestSuite suite = new TestSuite("Test GeoTransformProcess");
51
		//$JUnit-BEGIN$
52
		
53
		suite.addTestSuite(TestGeoTransformProcess.class);
54
		suite.addTestSuite(TGeoTransformProcessPixelToMapXTest.class);
55
		suite.addTestSuite(TGeoTransformProcessPixelToMapYTest.class);
56
		suite.addTestSuite(TGeoTransformProcessMapToPixelXTest.class);
57
		suite.addTestSuite(TGeoTransformProcessMapToPixelYTest.class);
58
		suite.addTestSuite(TGeotransformProcessRMS.class);
59
		//$JUnit-END$
60
		return suite;
61
	}
62

  
63
}
64

  
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TGeoTransformProcessMapToPixelXTest.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50

  
51
import Jama.Matrix;
52

  
53
/**Test que prueba la el proceso de geotransfornmcion dados una serie de puntos de
54
 * control.  Compara los coeficientes obtenidos para el polinomio de transformacion  
55
 * (de coordenadas mapa a coordenadas pixel para las X), con los obtenidos 
56
 * manualmente, resolviendo por el m?todo de Cramer.
57
 * 
58
 * 
59
 * @author aMu?oz (alejandro.munoz@uclm.es)
60
 * */
61

  
62
public class TGeoTransformProcessMapToPixelXTest extends TestCase {
63

  
64
	private GeoPoint gpcs[] = new GeoPoint[3];
65
	private double geoPoints[][] ={{ 1369.000000  	,	2985.750000	},
66
								   { 1673.500000  	,   2803.250000	},
67
								   { 2092.500000 	,   2933.250000	},
68
							       }; 
69
								   
70
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
71
									{ 803.000000     ,  2235.500000 },
72
									{ 1165.500000    ,  2285.250000	},
73
									};
74
	public void start() {
75
		this.testStack();
76
	}
77
	
78
	
79
	public void testStack() {
80
		System.err.println("TGeoTransformProcessMapToPixelXTest running...");
81
		
82
		for(int i=0;i<geoPoints.length;i++)
83
		{
84
			Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
85
			Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
86
			gpcs[i]= new GeoPoint(pP,pW);
87
		}
88
		
89
		GeoTransformProcess proceso = new GeoTransformProcess();
90
		proceso.addParam("gpcs",gpcs);
91
		proceso.addParam("orden", new Integer(1));
92
		proceso.run();
93
		
94
		GeoTransformDataResult resultado= (GeoTransformDataResult) proceso.getResult();
95
		
96
		// Estimacion de los coeficientes de forma manual, siquiento la teoria del manual de Jose Gonzalez
97
		 
98
		// Matriz para el ejmplo correspondiente a la figura 2.20
99
		double M[][]={
100
					{3,			5135,			8722.25},
101
					{5135,		9053319.5,		14916556.225},
102
					{8722.25,	14916556.225,	25376869.1875}
103
					};
104
		Matrix m_M = new Matrix(M);
105
		double det= m_M.det();
106
		
107
		
108
		double A0[][]={
109
					{2546.0,			5135,			8722.25},
110
					{4573226.75,	9053319.5,		14916556.225},
111
					{7393983.25,	14916556.225,	25376869.1875}
112
		};
113
		Matrix m_A0= new Matrix (A0);
114
		double coef0= m_A0.det()/det;
115
		
116
		
117
		
118
		double A1[][]={
119
				{3,			2546.0,		  8722.25},
120
				{5135,		4573226.75,	  14916556.225},
121
				{8722.25,	7393983.25,	  25376869.1875}
122
		};
123
		Matrix m_A1= new Matrix (A1);
124
		double coef1= m_A1.det()/det;
125
		
126
		double A2[][]={
127
					{3,			5135,			2546.0},
128
					{5135,		9053319.5,		4573226.75},
129
					{8722.25,	14916556.225,	7393983.25}
130
				};
131
			
132
		Matrix m_A2= new Matrix (A2);
133
		double coef2= m_A2.det()/det;
134
		
135
		// Comprobacion de los coeficientes obtenidos tras el proceso con los determinados de forma manual
136
		
137
		assertEquals(coef0, resultado.getMapToPixelCoefX()[0],0.1);
138
		assertEquals(coef1, resultado.getMapToPixelCoefX()[1],0.1);
139
		assertEquals(coef2, resultado.getMapToPixelCoefX()[2],0.1);
140
		
141
	}
142
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TGeoTransformProcessPixelToMapXTest.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50

  
51
import Jama.Matrix;
52

  
53
/**Test que prueba la el proceso de geotransfornmcion dados una serie de puntos de
54
 * control.  Compara los coeficientes obtenidos para el polinomio de transformacion  
55
 * (de coordenadas pixel a coordenadas mapa para las X), con los obtenidos 
56
 * manualmente, resolviendo por el m?todo de Cramer.
57
 * 
58
 * 
59
 * @author aMu?oz (alejandro.munoz@uclm.es)
60
 * */
61

  
62
public class TGeoTransformProcessPixelToMapXTest extends TestCase {
63

  
64
	private GeoPoint gpcs[] = new GeoPoint[3];
65
	private double geoPoints[][] ={{ 1369.000000  	,	2985.750000	},
66
								   { 1673.500000  	,   2803.250000	},
67
								   { 2092.500000 	,   2933.250000	},
68
							       }; 
69
								   
70
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
71
									{ 803.000000     ,  2235.500000 },
72
									{ 1165.500000    ,  2285.250000	},
73
									};
74
	public void start() {
75
		this.testStack();
76
	}
77
	
78
	
79
	public void testStack() {
80
		System.err.println("TGeoTransformProcessPixelToMapXTest running...");
81
		
82
		for(int i=0;i<geoPoints.length;i++)
83
		{
84
			Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
85
			Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
86
			gpcs[i]= new GeoPoint(pP,pW);
87
		}
88
		
89
		GeoTransformProcess proceso = new GeoTransformProcess();
90
		proceso.addParam("gpcs",gpcs);
91
		proceso.addParam("orden", new Integer(1));
92
		proceso.run();
93
		
94
		GeoTransformDataResult resultado= (GeoTransformDataResult) proceso.getResult();
95
		
96
		// Estimacion de los coeficientes de forma manual, siquiento la teoria del manual de Jose Gonzalez
97
		 
98
		// Matriz para el ejmplo correspondiente a la figura 2.20
99
		double M[][]={
100
				{3,			2546,			6948.25},
101
				{2546,		2336705.5,		5860446.625},
102
				{6948.25,	5860446.625,	16112584.0625}
103
					};
104
		Matrix m_M = new Matrix(M);
105
		double det= m_M.det();
106
		
107
		
108
		double A0[][]={
109
				{5135,				2546,			6948.25},
110
				{4573226.75,		2336705.5,		5860446.625},
111
				{11846242.375,	    5860446.625,	16112584.0625}
112
		};
113
		Matrix m_A0= new Matrix (A0);
114
		double coef0= m_A0.det()/det;
115
		
116
		
117
		
118
		double A1[][]={
119
				{3,			5135,			6948.25},
120
				{2546,		4573226.75,		5860446.625},
121
				{6948.25,	11846242.375,	16112584.0625}
122
		};
123
		Matrix m_A1= new Matrix (A1);
124
		double coef1= m_A1.det()/det;
125
		
126
		double A2[][]={
127
				{3,			2546,			5135},
128
				{2546,		2336705.5,		4573226.75},
129
				{6948.25,	5860446.625,	   11846242.375}
130
				};
131
			
132
		Matrix m_A2= new Matrix (A2);
133
		double coef2= m_A2.det()/det;
134
		
135
		// Comprobacion de los coeficientes obtenidos tras el proceso con los determinados de forma manual
136
		
137
		assertEquals(coef0, resultado.getPixelToMapCoefX()[0],0.1);
138
		assertEquals(coef1, resultado.getPixelToMapCoefX()[1],0.1);
139
		assertEquals(coef2, resultado.getPixelToMapCoefX()[2],0.1);
140
		
141
	}
142
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TGeoTransformProcessMapToPixelYTest.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50

  
51
import Jama.Matrix;
52

  
53
/**Test que prueba la el proceso de geotransfornmcion dados una serie de puntos de
54
 * control.  Compara los coeficientes obtenidos para el polinomio de transformacion  
55
 * (de coordenadas mapa a coordenadas pixel para las Y), con los obtenidos 
56
 * manualmente, resolviendo por el m?todo de Cramer.
57
 * 
58
 * 
59
 * @author aMu?oz (alejandro.munoz@uclm.es)
60
 * */
61

  
62
public class TGeoTransformProcessMapToPixelYTest extends TestCase {
63

  
64
	private GeoPoint gpcs[] = new GeoPoint[3];
65
	private double geoPoints[][] ={{ 1369.000000  	,	2985.750000	},
66
								   { 1673.500000  	,   2803.250000	},
67
								   { 2092.500000 	,   2933.250000	},
68
							       }; 
69
								   
70
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
71
									{ 803.000000     ,  2235.500000 },
72
									{ 1165.500000    ,  2285.250000	},
73
									};
74
	public void start() {
75
		this.testStack();
76
	}
77
	
78
	
79
	public void testStack() {
80
		System.err.println("TGeoTransformProcessMapToPixelYTest running...");
81
		
82
		for(int i=0;i<geoPoints.length;i++)
83
		{
84
			Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
85
			Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
86
			gpcs[i]= new GeoPoint(pP,pW);
87
		}
88
		
89
		GeoTransformProcess proceso = new GeoTransformProcess();
90
		proceso.addParam("gpcs",gpcs);
91
		proceso.addParam("orden", new Integer(1));
92
		proceso.run();
93
		
94
		GeoTransformDataResult resultado= (GeoTransformDataResult) proceso.getResult();
95
		
96
		// Estimacion de los coeficientes de forma manual, siquiento la teoria del manual de Jose Gonzalez
97
		 
98
		// Matriz para el ejmplo correspondiente a la figura 2.20
99
		double M[][]={
100
					{3,			5135,			8722.25},
101
					{5135,		9053319.5,		14916556.225},
102
					{8722.25,	14916556.225,	25376869.1875}
103
					};
104
		Matrix m_M = new Matrix(M);
105
		double det= m_M.det();
106
		
107
		
108
		double A0[][]={
109
					{6948.25,			5135,			8722.25},
110
					{11846242.375,	9053319.5,		14916556.225},
111
					{20217783.0625,	14916556.225,	25376869.1875}
112
		};
113
		Matrix m_A0= new Matrix (A0);
114
		double coef0= m_A0.det()/det;
115
		
116
		
117
		
118
		double A1[][]={
119
				{3,			6948.25,		  8722.25},
120
				{5135,		11846242.375,	  14916556.225},
121
				{8722.25,	20217783.0625,	  25376869.1875}
122
		};
123
		Matrix m_A1= new Matrix (A1);
124
		double coef1= m_A1.det()/det;
125
		
126
		double A2[][]={
127
					{3,			5135,			6948.25},
128
					{5135,		9053319.5,		11846242.375},
129
					{8722.25,	14916556.225,	20217783.0625}
130
				};
131
			
132
		Matrix m_A2= new Matrix (A2);
133
		double coef2= m_A2.det()/det;
134
		
135
		// Comprobacion de los coeficientes obtenidos tras el proceso con los determinados de forma manual
136
		
137
		assertEquals(coef0, resultado.getMapToPixelCoefY()[0],0.1);
138
		assertEquals(coef1, resultado.getMapToPixelCoefY()[1],0.1);
139
		assertEquals(coef2, resultado.getMapToPixelCoefY()[2],0.1);
140
		
141
	}
142
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TGeoTransformProcessPixelToMapYTest.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
 *   Campus Universitario s/n
35
 *   02071 Alabacete
36
 *   Spain
37
 *
38
 *   +34 967 599 200
39
 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50

  
51
import Jama.Matrix;
52

  
53
/**Test que prueba la el proceso de geotransfornmcion dados una serie de puntos de
54
 * control.  Compara los coeficientes obtenidos para el polinomio de transformacion  
55
 * (de coordenadas pixel a coordenadas mapa para las Y), con los obtenidos 
56
 * manualmente, resolviendo por el m?todo de Cramer.
57
 * 
58
 * 
59
 * @author aMu?oz (alejandro.munoz@uclm.es)
60
 * */
61

  
62
public class TGeoTransformProcessPixelToMapYTest extends TestCase {
63

  
64
	private GeoPoint gpcs[] = new GeoPoint[3];
65
	private double geoPoints[][] ={{ 1369.000000  	,	2985.750000	},
66
								   { 1673.500000  	,   2803.250000	},
67
								   { 2092.500000 	,   2933.250000	},
68
							       }; 
69
								   
70
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
71
									{ 803.000000     ,  2235.500000 },
72
									{ 1165.500000    ,  2285.250000	},
73
									};
74
	public void start() {
75
		this.testStack();
76
	}
77
	
78
	
79
	public void testStack() {
80
		System.err.println("TGeoTransformProcessPixelToMapYTest running...");
81
		
82
		for(int i=0;i<geoPoints.length;i++)
83
		{
84
			Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
85
			Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
86
			gpcs[i]= new GeoPoint(pP,pW);
87
		}
88
		
89
		GeoTransformProcess proceso = new GeoTransformProcess();
90
		proceso.addParam("gpcs",gpcs);
91
		proceso.addParam("orden", new Integer(1));
92
		proceso.run();
93
		
94
		GeoTransformDataResult resultado= (GeoTransformDataResult) proceso.getResult();
95
		
96
		// Estimacion de los coeficientes de forma manual, siquiento la teoria del manual de Jose Gonzalez
97
		// Matriz para el ejmplo correspondiente a la figura 2.20 del documento.
98
		double M[][]={
99
					{3,			2546,			6948.25},
100
					{2546,		2336705.5,		5860446.625},
101
					{6948.25,	5860446.625,	16112584.0625}
102
					};
103
		Matrix m_M = new Matrix(M);
104
		double det= m_M.det();
105
		
106
		
107
		double A0[][]={
108
				{8722.25,			2546,			6948.25},
109
				{7393983.25,		2336705.5,		5860446.625},
110
				{20217783.062,		5860446.625,	16112584.0625}
111
		};
112
		Matrix m_A0= new Matrix (A0);
113
		double coef0= m_A0.det()/det;
114
		
115
		
116
		
117
		double A1[][]={
118
				{3,			8722.25,		  6948.25},
119
				{2546,		7393983.25,	  	  5860446.625},
120
				{6948.25,	20217783.062,	  16112584.0625}
121
		};
122
		Matrix m_A1= new Matrix (A1);
123
		double coef1= m_A1.det()/det;
124
		
125
		double A2[][]={
126
				{3,			2546,			8722.25,		  },
127
				{2546,		2336705.5,		7393983.25,	  	  },
128
				{6948.25,	5860446.625,	20217783.062,	  }
129
				};
130
			
131
		Matrix m_A2= new Matrix (A2);
132
		double coef2= m_A2.det()/det;
133
		
134
		// Comprobacion de los coeficientes obtenidos tras el proceso con los determinados de forma manual
135
		
136
		assertEquals(coef0, resultado.getPixelToMapCoefY()[0],0.1);
137
		assertEquals(coef1, resultado.getPixelToMapCoefY()[1],0.1);
138
		assertEquals(coef2, resultado.getPixelToMapCoefY()[2],0.1);
139
		
140
	}
141
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/process/TestGeoTransformProcess.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
	 *
3
	 * Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
4
	 *
5
	 * This program is free software; you can redistribute it and/or
6
	 * modify it under the terms of the GNU General Public License
7
	 * as published by the Free Software Foundation; either version 2
8
	 * of the License, or (at your option) any later version.
9
	 *
10
	 * This program is distributed in the hope that it will be useful,
11
	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
	 * GNU General Public License for more details.
14
	 *
15
	 * You should have received a copy of the GNU General Public License
16
	 * along with this program; if not, write to the Free Software
17
	 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
	 *
19
	 * For more information, contact:
20
	 *
21
	 *  Generalitat Valenciana
22
	 *   Conselleria d'Infraestructures i Transport
23
	 *   Av. Blasco Iba?ez, 50
24
	 *   46010 VALENCIA
25
	 *   SPAIN
26
	 *
27
	 *      +34 963862235
28
	 *   gvsig@gva.es
29
	 *      www.gvsig.gva.es
30
	 *
31
	 *    or
32
	 *
33
	 *   Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha)
34
	 *   Campus Universitario s/n
35
	 *   02071 Alabacete
36
	 *   Spain
37
	 *
38
	 *   +34 967 599 200
39
	 */
40

  
41
package org.gvsig.georeferencing.process;
42

  
43
import java.awt.geom.Point2D;
44

  
45
import junit.framework.TestCase;
46

  
47
import org.gvsig.georeferencing.process.geotransform.GeoTransformDataResult;
48
import org.gvsig.georeferencing.process.geotransform.GeoTransformProcess;
49
import org.gvsig.raster.datastruct.GeoPoint;
50

  
51
import Jama.Matrix;
52

  
53
/**
54
 *  Test para el proceso de transformacion.
55
 *  
56
 *  El test prueba transformacion de orden dos calculados a partir de una lista de diez puntos.
57
 *  Los resultados de la transformacion son comparados con los calculos realizados de forma manual.
58
 *  Se compara la evaluacion de los polinomios para los cuatro primeros puntos de la lista tanto para 
59
 *  la funcion directa como la inversa. Se compara el rms obtenido en cada punto.
60
 *   
61
 *  @author Alejandro Mu?oz Sanchez
62
 * 
63
 * */
64

  
65
public class TestGeoTransformProcess  extends TestCase{
66

  
67
	private GeoPoint gpcs[] = new GeoPoint[10];
68
	private GeoTransformDataResult transformData;
69
	
70
	private double geoPoints[][] ={	{ 1369.000000  	,	2985.750000	},
71
									{ 1673.500000  	,   2803.250000	},
72
									{ 2092.500000 	,   2933.250000	},
73
									{ 2354.000000  	,   3211.000000	},
74
									{ 2731.500000    ,  3193.500000	},
75
									{ 3054.500000    ,  3079.500000	},
76
									{ 3009.250000    , 	3380.500000	},
77
									{ 3057.250000    ,  3552.750000	},
78
									{ 2944.750000    ,  3584.750000	},
79
									{ 2892.500000    ,  3444.000000	},}; 
80

  
81
								   
82
	private double imagePoints[][]={{ 577.500000     ,	2427.500000 },
83
									{ 803.000000     ,  2235.500000 },
84
									{ 1165.500000    ,  2285.250000	},
85
									{ 1419.250000    ,  2478.750000 },
86
									{ 1727.000000    ,  2412.250000 },
87
									{ 1977.500000    ,  2274.250000	},
88
									{ 1981.500000    ,  2528.250000	},
89
									{ 2044.000000    ,  2663.750000 },
90
									{ 1955.750000    ,  2705.500000 }, 
91
									{ 1893.500000    , 	2596.250000},};
92
	
93
	public void start() {
94
		this.setUp();
95
		this.testStack();
96
	}
97
	
98
	
99
	public void setUp(){
100
	}
101
	
102
	public void testStack(){
103
		for(int i=0;i<geoPoints.length;i++)
104
			{
105
				Point2D  pW = new Point2D.Double(geoPoints[i][0],geoPoints[i][1]);
106
				Point2D  pP = new Point2D.Double(imagePoints[i][0],imagePoints[i][1]);
107
				gpcs[i]= new GeoPoint(pP,pW);
108
			}
109
	
110
		GeoTransformProcess order2Transform = new GeoTransformProcess();
111
		order2Transform.addParam("gpcs",gpcs );
112
		order2Transform.addParam("orden",new Integer(2));
113
		order2Transform.run();	
114
		transformData= (GeoTransformDataResult)order2Transform.getResult();
115

  
116
		
117
// 		Resolucion del sistema  calculado manualmente
118
		double data[][]={
119
				{10,			15544.5,			24607.25,		 26758589.88,			38703411.06	,			60795805.19	  	},		
120
				{15544.5,		26758589.88,		38703411.06,	 48625448159.44,		67148886519.52,			96748134874.2 	},
121
				{24607.25,		38703411.06,		6.07958051875E7, 67148886519.52,		96748134874.2,			150805605253.3	},
122
				{26758589.88,	48625448159.44,		67148886519.52,	 90973349316414.1,		1.22623111101991E014,	1.69145826718794E014},
123
				{38703411.06,	67148886519.52,		96748134874.2,	 1.22623111101991E014,	1.69145826718794E014,	2.42781993510560E014},
124
				{60795805.19,	96748134874.2, 		150805605253.3,	 1.69145826718794E014,	2.42781993510560E014,	3.7555377732236494E14}	
125
		};
126
		double[][] result={{25178.75},{42119706.94}, {62445537.63}, {75433589688.61}, {105416642600.75}, {155494570974.03} };
127
		double[][] result2={{32168.25},{5.10484513125E07}, {7.9534535625E07}, {8.899835767423438E10}, {1.276577668393125E11}, {1.9743243258296875E11} };
128
		
129
		
130
//		 Resolucion del sistema  calculado manualmente
131
		double data2[][]={
132
				{10,				25178.75,				32168.25,		 		 6.68261699375E7,			8.2157005375E7	,			1.041305340625E8 },		
133
				{25178.75,			6.68261699375E7,		8.2157005375E7,	 		 1.8389906361945312E11,		2.2036071049725E11,			2.69580937964375E11 },
134
				{32168.25,			8.2157005375E7,			1.041305340625E8, 		 2.2036071049725E11,		2.69580937964375E11,		3.391527268821094E11},
135
				{6.68261699375E7,	1.8389906361945312E11,	2.2036071049725E11,	 	 5.185110007030175E14,		6.109291412182252E14,		7.302233191555645E14},
136
				{8.2157005375E7,	2.2036071049725E11,		2.69580937964375E11,	 6.109291412182252E14,		7.302233191555645E14,		8.893696706241302E14},
137
				{1.041305340625E8,	2.69580937964375E11, 	3.391527268821094E11,	 7.302233191555645E14,		8.893696706241302E14,		1.1112299175456508E15}	
138
		};
139
		
140
		double[][] result3={{24607.25},{6.2445537625E7}, {7.9534535625E7}, {1.6674342953621875E11}, {2.0468178349823438E11}, {2.5867104246403125E11} };
141
		double[][] result4={{15544.5},{4.21197069375E7}, {5.10484513125E7}, {1.1748417342507812E11}, {1.3954105605085938E11}, {1.6852035242098438E11} };
142
		
143
		
144
		Matrix matrix= new Matrix(data);
145
		Matrix matrix2= new Matrix(data2);
146
		
147
		Matrix coef=matrix.solve(new Matrix(result)); 
148
		Matrix coef2= matrix.solve(new Matrix(result2));
149
		Matrix coef3= matrix2.solve(new Matrix(result3));
150
		Matrix coef4= matrix2.solve(new Matrix(result4));
151
		
152
		// Comparacion de los coeficientes con los calculados manualmente
153
		for(int i=0; i<transformData.getPixelToMapCoefX().length; i++){
154
			assertEquals(coef.get(i,0),transformData.getPixelToMapCoefX()[i],0.2);
155
			assertEquals(coef2.get(i,0),transformData.getPixelToMapCoefY()[i],0.2);
156
			assertEquals(coef3.get(i,0),transformData.getMapToPixelCoefY()[i],0.2);
157
			assertEquals(coef4.get(i,0),transformData.getMapToPixelCoefX()[i],0.2);
158
		}
159
		
160
		// Evaluacion del polinomio en los cuatro primeros puntos de la lista
161
		double evaluate[][]= {{577.49,2427.49},{803 , 2235.5},{1165.49,2285.25},{1419.25,2478.75}};
162
		for(int i=0; i<4; i++)
163
		{
164
			evaluate[i]=transformData.getCoordPixel(gpcs[i].mapPoint.getX(),gpcs[i].mapPoint.getY());
165
			assertEquals(evaluate[i][0],gpcs[i].getEvaluateX(),0.3);
166
			assertEquals(evaluate[i][1],gpcs[i].getEvaluateY(),0.3);
167
		
168
		}
169
		
170
		double  rms []= {2.5846147599746093E-4,	1.4315791732756158E-4, 1.4937615015849659E-4,4.836399323913263E-4};
171
		for(int i=0; i<4; i++)
172
			assertEquals(gpcs[i].getRms(),rms[i],0.1);
173
		
174
	}	
175
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/TestGeorefOptionsDialog.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.georeferencing;
20

  
21
import javax.swing.JFrame;
22
import javax.swing.UIManager;
23

  
24
import org.gvsig.georeferencing.ui.options.GeorefOptionsPanel;
25
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
26
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
27
/**
28
 * Test para el panel de geolocalizaci?n
29
 *
30
 * @version 30/07/2007
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 */
33
public class TestGeorefOptionsDialog implements ButtonsPanelListener {
34
	private JFrame 			frame = new JFrame();
35

  
36
	public TestGeorefOptionsDialog() {
37
		super();
38
		initialize();
39
	}
40

  
41
	public static void main(String[] args) {
42
		try {
43
			UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
44
		} catch( Exception e ) {
45
			System.err.println( "No se puede cambiar al LookAndFeel");
46
		}
47
		new TestGeorefOptionsDialog();
48
	}
49

  
50
	private void initialize() {
51
		GeorefOptionsPanel glp = new GeorefOptionsPanel(3, this);
52
		frame.setContentPane(glp);
53

  
54
		frame.setSize(new java.awt.Dimension(420, 380));
55
		frame.setResizable(true);
56
		frame.setTitle("Georeferenciaci?n");
57
		frame.setVisible(true);
58
		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
59
	}
60

  
61
	public void actionButtonPressed(ButtonsPanelEvent e) {
62
	}
63
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/TestGeorefLauncherDialog.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.georeferencing;
20

  
21
import javax.swing.JFrame;
22
import javax.swing.UIManager;
23

  
24
import org.gvsig.georeferencing.ui.launcher.GeorefLauncherPanel;
25
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelEvent;
26
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
27
/**
28
 * Test para el panel de geolocalizaci?n
29
 *
30
 * @version 30/07/2007
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 */
33
public class TestGeorefLauncherDialog implements ButtonsPanelListener {
34
	private JFrame 			frame = new JFrame();
35

  
36
	public TestGeorefLauncherDialog() {
37
		super();
38
		initialize();
39
	}
40

  
41
	public static void main(String[] args) {
42
		try {
43
			UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
44
		} catch( Exception e ) {
45
			System.err.println( "No se puede cambiar al LookAndFeel");
46
		}
47
		new TestGeorefLauncherDialog();
48
	}
49

  
50
	private void initialize() {
51
		GeorefLauncherPanel glp = new GeorefLauncherPanel(new String[]{"vista1", "vista2"}, 3, this);
52
		frame.setContentPane(glp);
53

  
54
		frame.setSize(new java.awt.Dimension(420, 380));
55
		frame.setResizable(true);
56
		frame.setTitle("Georeferenciaci?n");
57
		frame.setVisible(true);
58
		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
59
	}
60

  
61
	public void actionButtonPressed(ButtonsPanelEvent e) {
62
	}
63
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/src-test/org/gvsig/georeferencing/TestViewDialog.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.georeferencing;
20

  
21
import javax.swing.JFrame;
22
import javax.swing.UIManager;
23

  
24
import org.gvsig.fmap.geom.primitive.Envelope;
25
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
26
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
27
import org.gvsig.georeferencing.ui.zoom.InvalidRequestException;
28
import org.gvsig.georeferencing.ui.zoom.ViewRasterRequestManager;
29
import org.gvsig.georeferencing.ui.zoom.tools.ToolEvent;
30
import org.gvsig.georeferencing.ui.zoom.tools.ToolListener;
31
import org.gvsig.georeferencing.view.ViewDialog;
32
import org.gvsig.utils.swing.threads.Cancellable;
33

  
34

  
35
/**
36
 * Test para la vista de georreferenciaci?n con peticiones a la capa.
37
 *
38
 * @version 30/07/2007
39
 * @author Nacho Brodin (nachobrodin@gmail.com)
40
 */
41
public class TestViewDialog implements ToolListener {
42
	private JFrame 	   frame = new JFrame();
43
	private String     path = "/home/nacho/images/500k_2.ecw";
44
	//private String     path = "/home/nacho/images/orto5mv30f290126cor03.sid";
45
	//private String     path = "/home/nacho/images/wcs16bits.tif";
46
	//private String     path = "/home/nacho/images/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
47
	private int        w = 500, h = 500;
48

  
49
	public TestViewDialog() {
50
		super();
51
		initialize();
52
	}
53

  
54
	public static void main(String[] args) {
55
		try {
56
			UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
57
		} catch( Exception e ) {
58
			System.err.println( "No se puede cambiar al LookAndFeel");
59
		}
60
		new TestViewDialog();
61
	}
62

  
63
	private void initialize() {
64
		FLyrRasterSE layer = null;
65
		try {
66
			layer = FLyrRasterSE.createLayer("mylyr", path, null);
67
		} catch (LoadLayerException e) {
68
			e.printStackTrace();
69
		}
70

  
71
		//Creamos el componente
72
		ViewDialog view = new ViewDialog(0, 0, w, h, this);
73
		view.setShowInfo(true);
74
		//Gestor de peticiones a la capa (IExtensionRequest)
75
		ViewRasterRequestManager viewRequestManager = new ViewRasterRequestManager(view, layer);
76
		//Asignamos al componente cual ser? su gestor de peticiones. Cada vez que se pulse un zoom el componente har?
77
		//una llamada request a su gestor de peticiones
78
		view.setExtensionRequest(viewRequestManager);
79
		view.setCursorSize(w / 2, h / 2);
80

  
81
		frame.setContentPane(view);
82

  
83
		frame.setSize(new java.awt.Dimension(w, h));
84
		frame.setResizable(true);
85
		frame.setTitle("zoom");
86
		frame.setVisible(true);
87
		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
88

  
89
		try {
90
			Envelope env=layer.getFullEnvelope();
91
			viewRequestManager.initRequest(env);
92
		} catch (InvalidRequestException e1) {
93
			System.out.println("Error asignando la vista");
94
		}
95
	}
96

  
97
	class CancellableClass implements Cancellable{
98
		private boolean cancel = false;
99
		public void setCanceled(boolean canceled) {
100
			this.cancel = canceled;
101
		}
102

  
103
		public boolean isCanceled() {
104
			return this.cancel;
105
		}
106
	}
107

  
108
	public void endAction(ToolEvent ev) {
109
	}
110

  
111
	public void offTool(ToolEvent ev) {
112
	}
113

  
114
	public void onTool(ToolEvent ev) {
115
	}
116

  
117
}
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/config/text_it.properties
1
#Translations for language [it]
2
#Tue Nov 07 12:30:01 CET 2006
3
activar=Attiva
4
brillo=Luminosit\u00e1
5
brillo_y_contraste=Luminosit\u00e0 e Contrasto
6
compress=Compressione
7
confirmacion=Conferma
8
contraste=Contrasto
9
eliminar_extremos=Elimina gli estremi
10
endinfo=Statistiche di finalizzazione
11
error_file_exists=Il file esiste gi\u00e0. Sovrascriverlo?
12
error_file_not_writable=Non \u00e8 possibile scrivere il file di output.
13
espere=Attendere, per favore
14
file=File
15
height=Altezza
16
lineal_directo=Lineare diretto
17
linf_der=X in basso a destra
18
lsup_izq=X in alto a sinistra
19
msg_save_raster=L'operazione verr\u00e0 cancellata. Continuare?
20
mtspixel=Mts/pixel
21
no=No
22
onSharpening=Attiva pansharpening
23
previsualizacion=Anteprima
24
props=Propriet\u00e0
25
realce=Ottimizzazione
26
realces=Ottimizzazione
27
recorte_colas=Ritaglio degli estremi
28
resolution=Risoluzione
29
salvar_raster=Salva raster
30
scale=Scala
31
seleccionar_fichero=Seleziona file
32
select=Seleziona
33
selectBandaRefinado=Selettore Bande Pancromatica
34
size=Dimensione
35
tarea_en_progreso=Lavoro in progresso
36
time=Tempo
37
width=Larghezza
38
yes=Si
tags/v2_0_0_Build_2011/extensions/extGeoreferencing/config/text.properties
1
#Translations for language [es]
2
#Tue Jan 20 18:42:35 CET 2009
3
abrir_memoria=Abrir en memoria
4
accumulated=Acumulado
5
activar=Activar
6
activar_uso_nodata=Activar el uso de NoData
7
add-point=A\u00f1adir punto
8
add_errors_csv=A\u00f1adir los errores al fichero CSV
9
affine_algorithm=Transformaci\u00f3n af\u00edn
10
Agudeza=Agudeza
11
ajustar_limites=Ajustar l\u00edmites
12
algorithm=Algoritmo
13
ancho_x_alto=Ancho x Alto
14
aplicar_capa=Aplicar en capa
15
aplicar_transf=Aplica transformaci\u00f3n introducida en las cajas de texto
16
aplicar_vista_previa=Aplicar en vista previa
17
apply=Aplicar
18
archivo=Archivo
19
ask_end_georef=\u00bfDes\u00e9a finalizar la aplicaci\u00f3n de georreferenciaci\u00f3n?
20
ask_load_view=\u00bfDes\u00e9a cargar el raster resultante en la vista? 
21
ask_save_transformation=\u00bfDes\u00e9a salvar la transformaci\u00f3n resultante\n como predeterminada para el raster?
22
aviso_salir_salvando=Se han producido cambios en la georreferenciaci\u00f3n de la imagen. \u00bfDesea salvarlos y sobreescribir la georrefenciaci\u00f3n del fichero?
23
aviso_write_transform=Se va a sobreescribir la georreferenciaci\u00f3n actual del fichero.\u00bfDesea continuar?
24
b_splines=B-Spline
25
back_transf=Ir a transformaci\u00f3n anterior
26
background_color=Color de fondo
27
band=Banda
28
bicubico=Bic\u00fabico
29
bilinear=Bilinear
30
borrar_libreria=Borrar librer\u00eda
31
boton_limpiar=Limpiar
32
cache=Cache
33
calculando_histograma=Calculando histograma
34
calculando_transformacion=
35
cancelando=Cancelando
36
cancelando_espere=Cancelando. Espere, por favor ...
37
capa=Capa
38
capa_nueva=Capa nueva
39
carga_capas=Carga de capas
40
cargar_en_toc=Cargar las capas en el TOC
41
celda=Celda
42
cellsize=Tama\u00f1o de pixel
43
center_view=Centrar las vistas al punto seleccionado.
44
color_interpretation_continue=Se va a cambiar la interpretaci\u00f3n de color por defecto para su raster. \u00bfDesea continuar?
45
combinacion_no_asignable=No es posible guardar esa combinaci\u00f3n de bandas por defecto.\n Una banda solo puede tener una interpretaci\u00f3n de color.
46
Compare=Compare
47
confirmacion=Confirmaci\u00f3n
48
confirmar=Confirmar
49
coor_center=Centro
50
coor_down=Abajo
51
coor_geograficas=Coordenadas geogr\u00e1ficas
52
coor_left=Izquierda
53
coor_right=Derecha
54
coor_up=Arriba
55
coordenadas_pixel=Coordenadas Pixel
56
coordenadas_reales=Coordenadas Reales
57
coordenadas_recorte=Coordenadas
58
corners=Esquinas
59
crear_1_capa_por_banda=Crear una capa por banda
60
datos_visualizados=Datos visualizados
61
degree=grados
62
desea_borrar_librerias=\u00bfDeseas borrar las librer\u00edas seleccionadas?
63
desea_guardar_cambios=\u00bfDesea guardar los cambios?
64
distancia_inversa=Distancia Inversa
65
el_fichero=El archivo
66
eliminar_puntos=Esta operaci\u00f3n eliminar\u00e1 todos los puntos \nque haya actualmente en su tabla.\n\u00bfDesea continuar?
67
enabled=Activo
68
end_georef=Finalizar georreferenciaci\u00f3n.
69
end_test_georef=Fin del test
70
error_abrir_fichero=Error al abrir el archivo
71
error_carga_capa=Error en la carga de la capa.
72
error_clone_layer=Error al clonar la capa
73
error_creando_filtro=Error creando uno de los filtros
74
error_escritura=No se pudo guardar el proyecto
75
error_extensiones_soportadas=Error al obtener la lista de extensiones soportadas. No se puede exportar la capa.
76
error_file_not_found=Fichero no encontrado.
77
error_file_not_valid=El fichero seleccionado no parece ser valido.
78
error_file_not_writable=No es posible crear el fichero de salida.
79
error_georef=No se ha podido aplicar la georreferenciaci\u00f3n
80
error_lectura=No se pudo abrir el proyecto
81
error_load_layer=No se ha podido cargar la capa en el TOC. Intentelo manualmente.
82
error_lookingfor_view=Vista seleccionada no encontrada.\n No se puede cargar la vista de georreferenciaci\u00f3n.
83
error_point_file=El fichero de puntos seleccionado no es v\u00e1lido.
84
error_props_show=La capa est\u00e1 en un estado inconsistente. Es posible que deba esperar a que acabe la operaci\u00f3n en curso.
85
error_props_tabs=El panel de propiedades se cerr\u00f3 por falta de pesta\u00f1as.
86
error_rowtable=Error a\u00f1adiendo fila a la tabla
87
error_salvando_rmf=Error escribiendo el fichero rmf
88
error_leyendo_rmf=Error leyendo rmf. Compruebe que existe\n el fichero y tenga permisos de lectura y escritura.
89
error_set_view=Error asignando los par\u00e1metros para cargar la vista.
90
error_setview_preview=Error asignando la vista en la previsualizaci\u00f3n.
91
error_transformacion=Error en los par\u00e1metros de transformaci\u00f3n
92
error_transformacion1=No se puede calcular la transformaci\u00f3n inversa de alg\u00fan punto proporcionado
93
error_writer=
94
error_writer_notsupportedextension=
95
escale=Escala
96
espere=Por favor, espere
97
esta_formato_desconocido=est\u00e1 en un formato no reconocido.
98
export_libreria=Exportar librer\u00eda
99
file=Archivo
100
files=Archivos
101
filtro_de=Filtro de
102
first_transf=Ir a la primera transformaci\u00f3n
103
formato=Formato
104
full_view=Zoom completo
105
fullExtent=Extent completo de la capa raster
106
general=General
107
generando_histograma=Generando histograma, por favor, espere
108
generar_fichero=Generar fichero
109
generar_overviews=Generar overviews
110
geolocation=Geolocalizaci\u00f3n
111
georef_algorithm=Algoritmo de georreferenciaci\u00f3n
112
georef_file=Fichero de georreferenciaci\u00f3n
113
georef_loading=Cargando m\u00f3dulo de georreferenciaci\u00f3n
114
georef_type=Tipo de georreferenciaci\u00f3n
115
georref=Georreferenciado
116
georreferenciacion=Georreferenciaci\u00f3n
117
georreferenciacion_process=Proceso de Georreferenciaci\u00f3n
118
georreferencing_log_message=Georreferenciando imagen. Esta operacion puede tardar varios minutos. Por favor, espere...
119
global=Global
120
green=Verde
121
guardando_capa=Guardando capa
122
guardar_como_predeterminado=\u00bfRealmente desea guardar la tabla de color actual como tabla predeterminada del fichero?
123
guardar_en_disco=Guardar en disco autom\u00e1ticamente
124
guardar_predeterminado=Guardar como predeterminado
125
height=Alto
126
histograma=Histograma
127
imagen_completa=Completo
128
import_libreria=Importar librer\u00eda
129
incremento_overview=Incremento en la generaci\u00f3n de overviews
130
incremento_recorte=Porcentaje del proceso
131
informacion_adicional=Informacion adicional
132
interpolacion=Interpolaci\u00f3n
133
interpolado=Interpolado
134
interpolando=Interpolando
135
LadoVentana=Lado de la ventana
136
layer_not_loaded=No hay cargada una capa valida. Por favor, seleccione una capa raster.
137
layer_without_georref=La capa no tiene georreferenciaci\u00f3n.<BR> \u00bfDesea introducirla manualmente?
138
limites=L\u00edmites
139
lineas=Lineas
140
linf_der=Inf Der
141
ll=Inferior izquierda
142
load_from_ascii=Cargar puntos de control desde un fichero de texto CSV
143
load_from_xml=Cargar desde fichero XML (.rmf)
144
loadlayer_aplicar=Al cargar un MDT, aplicarle
145
logaritmic=Logar\u00edtmico
146
lr=Inferior derecha
147
lsup_izq=Sup Izq
148
maximo=M\u00e1ximo
149
metadata=Metadatos
150
minimo=M\u00ednimo
151
more_points=Es necesario m\u00e1s puntos de control\n para el orden del polinomio seleccionado.\n N\u00famero m\u00ednimo de puntos\:
152
move-point=Mover punto
153
move_image=Desplazamiento
154
msg_save_raster=Se va a cancelar la operaci\u00f3n. \u00bfDesea continuar?
155
n_intervalos=N\u00famero de intervalos
156
next_transf=Ir a transformaci\u00f3n siguiente
157
no_existe_fichero=No existe el archivo
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff