Revision 33768

View differences:

tags/v2_0_0_Build_2020/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>package.info</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_2020/extensions/extGeoreferencing/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue Oct 26 12:06:54 CEST 2010
3
buildNumber=2020
tags/v2_0_0_Build_2020/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_2020/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_2020/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_2020/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_2020/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_2020/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_2020/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_2020/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_2020/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_2020/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_2020/extensions/extGeoreferencing/config/text_en.properties
1
#Translations for language [en]
2
#Tue Jan 20 18:42:35 CET 2009
3
abrir_memoria=Open in memory
4
accumulated=Acumulate
5
activar=Activate
6
add-point=Add point
7
add_errors_csv=Add errors to CSV file
8
affine_algorithm=Afin transformation
9
Agudeza=Sharpness
10
ajustar_limites=Limits adjust
11
algorithm=Algorithm
12
ancho_x_alto=Width x Height
13
aplicar_capa=Apply on layer
14
aplicar_transf=Set transformation
15
aplicar_vista_previa=Apply on preview
16
apply=Apply
17
archivo=File
18
ask_end_georef=Do you want to close georeferencing aplication?
19
ask_load_view=Would you like to load georeferenced layer in the view? 
20
ask_save_transformation=Would you like to save the new transformation\n as default for this raster?
21
aviso_salir_salvando=There is changes in georeferencing data. Would you like to save and overwrite raster layer's georeferencing data?
22
aviso_write_transform=The raster layer georeferencing is going to be changed. Would you like to go on?
23
b_splines=B-Spline
24
back_transf=Go to last transformation
25
background_color=Background color
26
band=Band
27
bicubico=Bicubic
28
bilinear=Bilinear
29
borrar_libreria=Delete library
30
boton_limpiar=Clean
31
cache=Cache
32
calculando_histograma=Calculating histogram
33
calculando_transformacion=
34
cancelando=Cancelling
35
cancelando_espere=Cancelling. Wait a moment, please...
36
capa=Layer
37
capa_nueva=New Layer
38
carga_capas=Load layers
39
cargar_en_toc=Load layers
40
celda=Cell
41
cellsize=Pixel size
42
center_view=Center view to selected point
43
Compare=Compare
44
confirmacion=Confirm that...
45
confirmar=Confirm
46
coor_center=Center
47
coor_down=Down
48
coor_geograficas=Geographic coordinates
49
coor_left=Left
50
coor_right=Right
51
coor_up=Up
52
coordenadas_pixel=Pixel coordinates
53
coordenadas_reales=Real coordinates
54
coordenadas_recorte=Coordinates
55
corners=Corners
56
datos_visualizados=Visualize data
57
degree=sexagesimal degrees
58
desea_borrar_librerias=Would you like to delete libraries?
59
desea_guardar_cambios=Would you like to save changes?
60
distancia_inversa=Inverse distance
61
eliminar_puntos=This operation will delete all points \n in point table.\n Would you like to go on?
62
enabled=Active
63
end_georef=Exit to georeferencing
64
end_test_georef=End test
65
error_abrir_fichero=Error opening file
66
error_carga_capa=Error loading layer
67
error_clone_layer=Error copying layer
68
error_creando_filtro=Error creating filter
69
error_escritura=It's not possible to write in this path
70
error_file_not_found=File not found
71
error_file_not_valid=File not valid
72
error_file_not_writable=Could not create output file.
73
error_georef=It wasn't possible set georeferencing information
74
error_lectura=It's not possible to read in this path
75
error_load_layer=It was not possible load layer. We can try it by hand
76
error_lookingfor_view=Selected view not found.\n It's not possible to load georeferencing view
77
error_point_file=Selected points file is not valid
78
error_rowtable=Error adding row to the table
79
error_salvando_rmf=Error writing in rmf file
80
error_set_view=Error setting load view parameters
81
error_setview_preview=Error setting preview
82
error_transformacion=Error in transformation parameters
83
error_transformacion1=It's not possible to calc inverse transformation of any point
84
error_writer=
85
error_writer_notsupportedextension=
86
error_leyendo_rmf=Error reaing rmf file.\n The file must exist and be readable.
87
escale=Scale
88
espere=\=Wait a moment, please...
89
export_libreria=Export library
90
file=File
91
files=Files
92
filtro_de=Filter of
93
first_transf=Go to first transformation
94
formato=Format
95
full_view=Full zoom
96
fullExtent=Full layer extent
97
general=General
98
generando_histograma=Generating histogram. Wait a moment, please ...
99
generar_fichero=Create file
100
geolocation=Geolocalization
101
georef_algorithm=Georeferencing algorithm
102
georef_file=Georeferencing file
103
georef_loading=Loading georeferencig module
104
georef_type=Georeferencing type
105
georref=Georeferencing
106
georreferenciacion=Georeferencing
107
georreferenciacion_process=Georeferencing process
108
georreferencing_log_message=
109
global=Global
110
green=Green
111
guardando_capa=Saving layer
112
guardar_como_predeterminado=Would you like to save current color table as default of this layer?
113
guardar_en_disco=Save on disk automatically
114
guardar_predeterminado=Save as default
115
height=Height
116
histograma=Histogram
117
imagen_completa=Full image
118
import_libreria=Import library
119
incremento_recorte=Progress increment
120
informacion_adicional=Aditional information
121
interpolacion=Interpolation
122
interpolado=Interpolated
123
interpolando=Interpolating
124
LadoVentana=Window side
125
layer_not_loaded=There isn't a valid layer. Select a raster layer, please
126
layer_without_georref=This layer has not geographic information.<BR> Would you like to introduce it manually?
127
limites=Limits
128
lineas=Lines
129
linf_der=lower right X
130
ll=Lower left
131
load_from_ascii=Load control points from CSV file
132
load_from_xml=Load from XML file (.rmf)
133
logaritmic=Logarithmic
134
lr=Lower right
135
lsup_izq=Upper left
136
maximo=Maximum
137
metadata=Metadata
138
minimo=Minimum
139
more_points=It's necessary to introduce more control points\n for selected polinomy order.\n Minimun number of points\:
140
move-point=Move point
141
move_image=Move image
142
msg_save_raster=The operation will be canceled. Would you like to continue?
143
n_intervalos=Number of intervals
144
next_transf=Go to next transformation
145
no_existe_fichero=File doesn't exists
146
no_rows=There isn't entries in point table
147
no_rows_selected=There aren't selected entries in points table
148
no_selected_points=It isn't possible center view to a point.\n There aren't selected points 
149
no_view_found=The selected view is not active.\n Select other view, please.
150
nombre=Name
151
nombre_capa=Name of the layer
152
nombre_capas=Layer names
153
normal=Normal
154
num_clases=Number of classes
155
options=Options
156
origin=Origin
157
otras_opciones=Options
158
out_pixel_size=Output pixel size
159
output_file=Output file
160
points_panel=
161
polynomial_algorithm=Polinomial transformation
162
prev_zoom=Last zoom
163
preview_not_available=Preview is not available
164
proceso_georreferenciacion=Georeferencing process
165
process=Process
166
px=Pix X
167
py=Pix Y
168
rango_de_escalas=Scale range
169
raster_error_file_exists=File already exists. Would you like to overwrite it?
170
raster_not_created=Raster result has not created.\n You should execute the process before loading on view.
171
rasterizando=Rasterizing
172
recalc_stats=Recalc statistics
173
recorte=Clipping
174
reset_transf=Inicializate with disk transformation
175
resolucion_espacial=Resolution
176
restablecer=Restore
177
rotX=X Rotation
178
rotY=Y Rotation
179
ruta=Directory
180
rutas=Paths
181
rx=Rot X
182
ry=Rot Y
183
salvando_imagen=Saving image
184
salvar_transf=Save current transformation as default
185
save_gcp_to_xml=Save control points in raster metadata file
186
save_to_ascii=Save control points in CSV file
187
save_to_xml=Save to XML (.grf)
188
seleccion_bandas=Bands
189
seleccionar_capas_raster=Select raster layers
190
seleccionar_directorio=Select directory
191
seleccionar_fichero=Select file
192
select=Select
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff