Revision 2813

View differences:

tags/Root_jCMS04/libraries/libCq CMS for java.old/doc-files/overview.html
1
<html>
2
	<body>Overview 1
3
</body>
4
</html>
5

  
0 6

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/javadoc.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project default="javadoc">
3
    <target name="javadoc">
4
        <javadoc destdir="doc" access="package" source="1.4" use="true" notree="false" nonavbar="false" noindex="false" splitindex="true" author="true" version="true" nodeprecatedlist="false" nodeprecated="false" packagenames="org.cresques.cts.gt2,org.cresques.io,org.cresques.geo.cover,org.cresques.ui,org.cresques.geo,org.cresques.cts,org.cresques.ui.cmd,org.cresques.px.gml,org.cresques.px.dxf,org.cresques.px" sourcepath="src" classpath="lib/jmgeoraster.jar;lib/geojava.jar;bin;C:\java\lib\ermapper.jar;lib/gt2cts.jar" overview="C:\eclipse\workspace\Cq CMS for Java\doc-files\overview.html" doctitle="Cresques Mapping Suite for Java v0.1">
5
            <link href="file:/C:/j2sdk1.4.2_03/docs/api/"/>
6
            <link href="jar:file:/C:/java/lib/ermapperdoc.jar!/Javadoc"/>
7
        </javadoc>
8
    </target>
9
</project>
0 10

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/.cvsignore
1
doc-files
2
Thumbs.db
0 3

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src-dvp/org/cresques/io/SitnaMapServerClient.java
1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.io;
48

  
49
import org.cresques.px.Extent;
50

  
51
/**
52
 * Consulta el servidor de mapas de Sitna de Navarra.
53
 * (hecho por tracasa)
54
 * ver http://sitna.tracasa.es/navegar/?lang=cas
55
 * Implementa una llamada del tipo:
56
 * http://sitna.tracasa.es/navegar/asp/mime.aspx?
57
 *   TIPO=0&Xmin=450321.428571429&Ymin=628000&
58
 *   Xmax=780678.571428571&Ymax=813000&PixAncho=500&PixAlto=280
59
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
60
 */
61
public class SitnaMapServerClient extends MapServerClient {
62
	public final static int CAPA_ORTOCOLOR_2K_03  = 0;
63
	public final static int CAPA_ORTOFOTO_7500  = 1;
64
	public final static int CAPA_GUIA_URBANA	= 2;
65
	
66
	public final static String [] nomCapas = {
67
		"Ortofoto Color 1:5.000 - A?o 2.003",
68
		"Ortofoto Color 1:5.000 - A?os 98-00",
69
		"Ortofoto Color 1:2.000",
70
		"Ortofoto Color 1:1.000",
71
		"Mapa de Relieve Color (25 m)",
72
		"Mapa de Relieve B/N (7,5 m)",
73
		"Cartograf?a Topogr?fica",
74
		"Catastro",
75
		"Catastro + Ortofoto 1:5.000",
76
		"LANDSAT-5 27/05/91 Falso Color",
77
		"LANDSAT-5 27/05/91 Pseudocolor",
78
		"LANDSAT-5 12/06/91 Falso Color",
79
		"LANDSAT-5 12/06/91 Pseudocolor",
80
		"LANDSAT-5 15/08/91 Falso Color",
81
		"LANDSAT-5 15/08/91 Pseudocolor",
82
		"LANDSAT-5 13/05/92 Falso Color",
83
		"LANDSAT-5 13/05/92 Pseudocolor",
84
		"LANDSAT-5 17/08/92 Falso Color",
85
		"LANDSAT-5 17/08/92 Pseudocolor",
86
		"LANDSAT-5 01/06/93 Falso Color",
87
		"LANDSAT-5 01/06/93 Pseudocolor",
88
		"LANDSAT-5 20/08/93 Falso Color",
89
		"LANDSAT-5 20/08/93 Pseudocolor",
90
		"LANDSAT-5 03/05/94 Falso Color",
91
		"LANDSAT-5 03/05/94 Pseudocolor",
92
		"LANDSAT-5 23/08/94 Falso Color",
93
		"LANDSAT-5 23/08/94 Pseudocolor",
94
		"LANDSAT-5 04/04/95 Falso Color",
95
		"LANDSAT-5 04/04/95 Pseudocolor",
96
		"LANDSAT-5 10/08/95 Falso Color",
97
		"LANDSAT-5 10/08/95 Pseudocolor",
98
		"LANDSAT-5 24/05/96 Falso Color",
99
		"LANDSAT-5 24/05/96 Pseudocolor",
100
		"LANDSAT-5 11/07/96 Falso Color",
101
		"LANDSAT-5 11/07/96 Pseudocolor",
102
		"LANDSAT-5 08/03/97 Falso Color",
103
		"LANDSAT-5 08/03/97 Pseudocolor",
104
		"LANDSAT-5 27/03/98 Falso Color",
105
		"LANDSAT-5 27/03/98 Pseudocolor",
106
		"LANDSAT-5 30/03/99 Falso Color",
107
		"LANDSAT-5 30/03/99 Pseudocolor",
108
		"LANDSAT-5 21/08/99 Falso Color",
109
		"LANDSAT-5 21/08/99 Pseudocolor",
110
		"LANDSAT-7 08/03/00 Falso Color",
111
		"LANDSAT-7 08/03/00 Pseudocolor",
112
		"LANDSAT-5 07/08/00 Falso Color",
113
		"LANDSAT-5 07/08/00 Pseudocolor",
114
		"LANDSAT-7 28/04/01 Falso Color",
115
		"LANDSAT-7 28/04/01 Pseudocolor",
116
		"LANDSAT-5 31/07/03 Falso Color",
117
		"LANDSAT-5 31/07/03 Pseudocolor",
118
		"IRS-1C 13/04/97 Falso Color",
119
		"IRS-1C 13/04/97 Pseudocolor",
120
		"IRS-1C 04/09/97  Falso Color",
121
		"IRS-1C 04/09/97 Pseudocolor",
122
		"IRS-1C 19/06/98 Falso Color",
123
		"IRS-1C 19/06/98 Pseudocolor",
124
		"IRS-1C 06/08/98 Falso Color",
125
		"IRS-1C 06/08/98 Pseudocolor",
126
		"IRS-1D 15/06/99 Falso Color",
127
		"IRS-1D 15/06/99 Pseudocolor",
128
		"IRS-1C 08/06/00 Falso Color",
129
		"IRS-1C 08/06/00 Pseudocolor",
130
		"IRS-1D 23/08/01 Falso Color",
131
		"IRS-1D 23/08/01 Pseudocolor",
132
		"IRS-1D 05/04/02 Falso Color",
133
		"IRS-1D 05/04/02 Pseudocolor",
134
		"IRS-1C 26/09/02 Falso Color",
135
		"IRS-1C 26/09/02 Pseudocolor",
136
		"IRS-1D 10/05/03 Falso Color",
137
		"IRS-1D 10/05/03 Pseudocolor"};
138
	
139
	private int capas		= CAPA_ORTOCOLOR_2K_03;
140
	
141
	public SitnaMapServerClient(String serverName) {
142
		super(serverName);
143
		urlBase = "http://sitna.tracasa.es/navegar/asp/mime.aspx";
144
		setExtent(new Extent(450321.428571429, 813000, 780678.571428571, 628000));
145
		setMaxViewSize(700,420);
146
	}
147
	
148
	public void setCapas(int c) { capas = c; }
149
	
150
	public String getUrl() {
151
		String url = urlBase+"?"+
152
			"TIPO="+capas+"&"+
153
			"Xmin="+xMin+"&"+ "Ymin="+yMax+"&"+
154
			"Xmax="+xMax+"&"+ "Ymax="+yMin+"&"+
155
			"PixAncho="+ancho+"&"+"PixAlto="+alto;;
156
		return url;
157
	}
158
}
0 159

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src-dvp/org/cresques/io/CatastroMapServerClient.java
1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.io;
48

  
49
import java.security.Security;
50

  
51
import org.cresques.px.Extent;
52

  
53
/**
54
 * Consulta el servidor de mapas de grafcan.
55
 * Implementa una llamada del tipo:
56
 * http://www.dgtcan.com/MapServer/Mapa.asp?
57
 *   XMin=219900&YMax=3151900&XMax=221000&YMin=3151300&
58
 *   Ancho=1000&Alto=1000&NumeroCapas=6&Capas=2&Servicio=NavGRAFCAN2
59
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
60
 */
61
public class CatastroMapServerClient extends MapServerClient {
62
	public final static int CAPA_ORTOFOTO    = 2;
63
	public final static int CAPA_CARTOGRAFIA = 1;
64
	
65
	private int numeroCapas	= 6;
66
	private int capas		= CAPA_CARTOGRAFIA;
67
	private String servicio = "Catastro MinHac";
68
	private String formato = "png";
69
	private String transparente = "N";
70
	private String urlServer;
71
	
72
	public CatastroMapServerClient(String serverName) {
73
		super(serverName);
74
		urlServer = "https://ovc.catastro.minhac.es";
75
		urlBase = urlServer+"/Cartografia/GeneraMapa.aspx";
76
/**/	setExtent(new Extent(717473,4381656,738612,4350973));
77
		setServicio("SDE46.");
78
		setCapas(242); 
79
		System.setProperty("java.protocol.handler.pkgs",
80
			"com.sun.net.ssl.internal.www.protocol");
81
		Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
82
	}
83
	
84
	public void setCapas(int c) { capas = c; }
85

  
86
	public void setNumeroCapas(int c) { numeroCapas = c; }
87
	
88
	public void setServicio(String s) { servicio = s; }
89
	
90
	public void setTransparente(boolean t) {
91
		if (t) transparente = "S"; else transparente = "N";
92
	}
93
	
94
	/**
95
	 * @return Returns the transparente.
96
	 */
97
	public boolean getTransparente() {
98
		return transparente.startsWith("S");
99
	}
100
	public String getBaseUrl() {
101
		return urlServer;
102
	}
103
	
104
	public String getUrl() {
105
		String url = urlBase+"?"+
106
			"prefijo="+servicio+"&mapa="+capas+"&formato="+formato+ "&"+
107
			"XMin="+xMin+"&"+ "YMin="+Math.min(yMin, yMax)+"&"+ 
108
			"XMax="+xMax+"&"+ "YMax="+Math.max(yMin, yMax)+"&"+
109
			"AnchoPixels="+ancho+"&"+"AltoPixels="+alto+"&"+
110
			"Transparente="+transparente;
111
		return url;
112
	}
113
	/**
114
	 * @return Returns the capas.
115
	 */
116
	public int getCapas() {
117
		return capas;
118
	}
119
	/**
120
	 * @return Returns the servicio.
121
	 */
122
	public String getServicio() {
123
		return servicio;
124
	}
125
	/**
126
	 * @return Returns the urlServer.
127
	 */
128
	public String getUrlServer() {
129
		return urlServer;
130
	}
131
}
0 132

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src-dvp/org/cresques/io/GrafCanMapServerClient.java
1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.io;
48

  
49
import org.cresques.px.Extent;
50

  
51
/**
52
 * Consulta el servidor de mapas de grafcan.
53
 * Implementa una llamada del tipo:
54
 * http://www.dgtcan.com/MapServer/Mapa.asp?
55
 *   XMin=219900&YMax=3151900&XMax=221000&YMin=3151300&
56
 *   Ancho=1000&Alto=1000&NumeroCapas=6&Capas=2&Servicio=NavGRAFCAN2
57
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
58
 */
59
public class GrafCanMapServerClient extends MapServerClient {
60
	public final static int CAPA_ORTOFOTO    = 2;
61
	public final static int CAPA_CARTOGRAFIA = 1;
62
	
63
	private int numeroCapas	= 6;
64
	private int capas		= CAPA_CARTOGRAFIA;
65
	private String servicio = "NavGRAFCAN2";
66
	
67
	public GrafCanMapServerClient(String serverName) {
68
		super(serverName);
69
		urlBase = "http://www.dgtcan.com/MapServer/Mapa.asp";
70
/**/	setExtent(new Extent(180020,3270000,660000,3035000));
71
	}
72
	
73
	public void setCapas(int c) { capas = c; }
74
	
75
	public void setNumeroCapas(int c) { numeroCapas = c; }
76
	
77
	public void setServicio(String s) { servicio = s; }
78
	
79
	public String getUrl() {
80
		String url = urlBase+"?"+
81
			"XMin="+xMin+"&"+ "XMax="+xMax+"&"+
82
			"YMin="+yMin+"&"+ "YMax="+yMax+"&"+
83
			"Ancho="+ancho+"&"+"Alto="+alto+"&"+
84
			"NumeroCapas="+numeroCapas+"&"+"Capas="+capas+"&"+
85
			"Servicio="+servicio;
86
		return url;
87
	}
88
}
0 89

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src-dvp/org/cresques/io/BsbFile.java
1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.io;
48

  
49
import java.awt.Color;
50
import java.awt.Image;
51
import java.awt.geom.Point2D;
52
import java.awt.image.BufferedImage;
53
import java.io.IOException;
54
import java.util.Vector;
55

  
56
import org.cresques.cts.ICoordTrans;
57
import org.cresques.cts.IProjection;
58
import org.cresques.io.GeoFile;
59
import org.cresques.io.GeoRasterFile;
60
import org.cresques.px.Extent;
61

  
62
import es.gva.cit.jbsb.BsbException;
63

  
64
/**
65
 * Soporte 'nativo' para Bsb.
66
 * Este conjunto de funcionalidades est? tomado de manera casi literal
67
 * del soporte para ECW de ermapper.<br>
68
 * Probablemente esto deber?a formar parte del JNI que recubre a la
69
 * librer?a en C extraida de gdal.<br>
70
 * Lo pongo aqu? a manera de ejemplo de como atacar un formato binario
71
 * desde Java.<br><br>   
72
 * @author Luis W. Sevilla.
73
 */
74

  
75
class BsbNative extends es.gva.cit.jbsb.Bsb {
76
	// Polilinea con extent
77
	class Contour extends Vector {
78
		public double minX = Double.MAX_VALUE, minY = Double.MAX_VALUE;
79
		public double maxX = -Double.MAX_VALUE, maxY = -Double.MAX_VALUE;
80
		public Contour() {
81
			super();
82
		}
83
		public void add(Point2D pt) {
84
			super.add(pt);
85
			if (pt.getX() > maxX) maxX = pt.getX();
86
			if (pt.getX() < minX) minX = pt.getX();
87
			if (pt.getY() > maxY) maxY = pt.getY();
88
			if (pt.getY() < minY) minY = pt.getY();
89
		}
90
	}
91
	private int [] paleta = null;
92
	/**
93
	 * Contorno en coordenadas geogr?ficas. (y Extent del raster).
94
	 */
95
	public Contour esq = new Contour();
96
	public int width = 0, height = 0;
97
	public double originX = 0D, originY = 0D;
98
	public String version = "";
99
	
100
	public BsbNative(String fName) throws BsbException {
101
		super();
102
		try {
103
			init(fName);
104
		} catch (IOException e) {
105
			// TODO Auto-generated catch block
106
			e.printStackTrace();
107
		}
108
	}
109
	
110
	private void init(String fName) throws BsbException, IOException {
111
		bsbOpen(fName);
112
		width = g_psInfo.nXSize;
113
		height = g_psInfo.nYSize;
114
		Vector pal = new Vector();
115
		String buf = null;
116
  		for (int i=0; i<g_psInfo.papszHeader.length; i++) {
117
  			buf = g_psInfo.papszHeader[i];
118
	  		if (buf.length()<1) continue;
119
	  		if (buf.startsWith("RGB/")) {
120
	  			String [] dat = buf.split(",");
121
	  			pal.add(new Color(Integer.parseInt(dat[1]),
122
	  				Integer.parseInt(dat[2]),
123
					Integer.parseInt(dat[3])));
124
	  		} else if (buf.startsWith("VER/")) {
125
	  			version = buf.substring(4);
126
	  		} /*else if (buf.startsWith("PLY/")) { // Marco de hoja
127
	  			String [] dat = buf.split(",");
128
	  			esq.add(new Point2D.Double(Double.parseDouble(dat[2]),
129
	  					Double.parseDouble(dat[1])));
130
	  		}*/
131
  		}
132
  		if (true) { //version.startsWith("1")) {
133
  			esq.add(new Point2D.Double(0D,height));
134
  			esq.add(new Point2D.Double(0D,0D));
135
  			esq.add(new Point2D.Double(width,0D));
136
  			esq.add(new Point2D.Double(width,height));
137
  		}
138
  		paleta = new int[pal.size()];
139
  		for (int i=0; i<pal.size(); i++)
140
  			paleta[i] = ((Color) pal.get(i)).getRGB();
141

  
142
  		originX = esq.minX;
143
  		originY = esq.maxY;
144
	}
145
	
146
	double lastReadLine = -1;
147
	int currentViewWidth = -1;
148
	int currentViewHeight = -1;
149
	double currentViewX = 0D;
150
	double viewportScale = 0D;
151
	double step = 0D;
152
	
153
	public Point2D worldToRaster(Point2D pt) {
154
		double x = (((double) width)/(esq.maxX-esq.minX))*(pt.getX()-esq.minX);
155
		double y = (((double) height)/(esq.maxY-esq.minY))*(esq.maxY-pt.getY());
156
		Point2D ptRes = new Point2D.Double(x, y);
157
		return ptRes;
158
	}
159
	
160
	public int setView(double dWorldTLX, double dWorldTLY,
161
            double dWorldBRX, double dWorldBRY,
162
            int nWidth, int nHeight) {
163
		int err = 0;
164
		Point2D tl = worldToRaster(new Point2D.Double(dWorldTLX, dWorldTLY));
165
		Point2D br = worldToRaster(new Point2D.Double(dWorldBRX, dWorldBRY));
166
		// Calcula cual es la primera l?nea a leer;
167
		currentViewWidth = nWidth;
168
		currentViewHeight = nHeight;
169

  
170
		currentViewX = tl.getX();
171
		viewportScale = (double) currentViewWidth/(br.getX()-tl.getX());
172
		step = 1D/viewportScale;
173
		lastReadLine = tl.getY();
174

  
175
		System.out.println("BsbFile: TL=("+dWorldTLX+","+dWorldTLY+
176
			"); BR=("+dWorldBRX+","+dWorldBRY+")\n"+
177
			"BsbFile: escala="+viewportScale+"; lastReadLine="+lastReadLine);
178
		return err;
179
	}
180
	
181
	public int readLineRGBA(int [] line) throws BsbException {
182
		int err = 0;
183
  		bsbReadLine((int) lastReadLine);
184

  
185
  		lastReadLine += step;
186
  		
187
  		byte [] l = g_buffer.pabyScanLineBuf;
188
  		int white = Color.BLUE.getRGB();
189
  		float j =(float) currentViewX;
190
  		for (int i=0; i<currentViewWidth && j<l.length; i++, j+=step) {
191
  			line[i] = paleta[l[(int) j]-1];
192
  		}
193
		//for (int i=0; i<currentViewWidth; i++) line[i] = 128+128*256+128*256*256;
194

  
195
		return err;
196
	}
197

  
198
	void pintaInfo() {
199
  		System.out.println("Fichero BSB: Info ("+g_psInfo.papszHeader.length+" l?neas):");
200
  		for (int i=0; i<g_psInfo.papszHeader.length; i++) {
201
	  		if (g_psInfo.papszHeader[i].length()<1) continue;
202
	  		System.out.println("info["+i+"] = "+g_psInfo.papszHeader[i]);
203
  		}
204
	}
205
	
206
	void pintaPaleta() {
207
  		System.out.println("Fichero BSB: Paleta ("+paleta.length+" colores):");
208
		for (int i=0; i<paleta.length; i++)
209
			System.out.println("color("+i+")="+paleta[i]);
210
	}
211
}
212

  
213
/**
214
 * @author Luis W. Sevilla
215
 */
216
public class BsbFile extends GeoRasterFile {
217
	private BsbNative file = null;
218

  
219
	private Extent v = null;
220
	
221
	
222
	static {
223
		GeoRasterFile.registerExtension("nos", BsbFile.class);
224
		GeoRasterFile.registerExtension("kap", BsbFile.class);
225
	}
226
	public BsbFile(IProjection proj, String fName) {
227
		super(proj, fName);
228
		extent = new Extent();
229
		try {
230
			file = new BsbNative(fName);
231
			showOnOpen();
232
			load();
233
		} catch(BsbException e){
234
		  	System.out.println("Error en BSBOpen");
235
		  	e.printStackTrace();
236
		  	file = null;
237
		}
238
	}
239
	
240
	public GeoFile load() {
241
		/*double minX, minY, maxX, maxY;
242
		minX = minY = 0D;
243
		maxX = (double) width;
244
		maxY = (double) height;*/
245
		extent = new Extent(file.esq.minX, file.esq.minY, file.esq.maxX, file.esq.maxY);
246
		return this;
247
	}
248
	public void setView(Extent e) { v = new Extent(e); }
249
	public Extent getView() { return v; }
250
	
251
	public int getWidth() {	return file.width; }
252
	public int getHeight() { return file.height;}
253

  
254
	/* (non-Javadoc)
255
	 * @see org.cresques.io.GeoRasterFile#reProject(org.cresques.cts.ICoordTrans)
256
	 */
257
	public void reProject(ICoordTrans rp) {
258
		// TODO Auto-generated method stub
259
		
260
	}
261
	/* (non-Javadoc)
262
	 * @see org.cresques.io.GeoRasterFile#setTransparency(boolean)
263
	 */
264
	public void setTransparency(boolean t) {
265
		// TODO Auto-generated method stub
266
	}
267
	public void setTransparency(int t) {
268
		// TODO Auto-generated method stub
269
	}
270
	/* (non-Javadoc)
271
	 * @see org.cresques.io.GeoRasterFile#updateImage(int, int, org.cresques.cts.ICoordTrans)
272
	 */
273
	public Image updateImage(int width, int height, ICoordTrans rp) {
274
		double dFileAspect, dWindowAspect;
275
		int line, pRGBArray[] = null;
276
		Image image = null;
277

  
278
		// Work out the correct aspect for the setView call.
279
		dFileAspect = (double)v.width()/(double)v.height();
280
		dWindowAspect = (double)width /(double)height;
281

  
282
		if (dFileAspect > dWindowAspect) {
283
		  height =(int)((double)width/dFileAspect);
284
		} else {
285
		  width = (int)((double)height*dFileAspect);
286
		}
287
		
288
		// Set the view
289
		file.setView(v.minX(), v.maxY(), v.maxX(), v.minY(),
290
			width, height);
291
		
292
		image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
293
		pRGBArray = new int[width];
294
		try {
295
			for (line=0; line < height; line++) {
296
				file.readLineRGBA(pRGBArray);
297
				((BufferedImage)image).setRGB(0, line, width, 1, pRGBArray, 0, width);
298
			}
299
		} catch (Exception e) {
300
			// TODO Auto-generated catch block
301
			e.printStackTrace();
302
		}
303
		
304
		return image;
305
	}
306
	
307
	public Image updateImage(int width, int height, ICoordTrans rp, Image img, int origBand, int destBand){
308
		
309
		return null;
310
	}
311
	
312
	private void showOnOpen() {
313
  		// Report en la apertura (quitar)
314
  		System.out.println("Fichero BSB '"+getName()+"' abierto.");
315
  		System.out.println("Version = "+file.version);
316
  		System.out.println("   Size = ("+file.width+","+file.height+")");
317
  		file.pintaInfo();
318
  		file.pintaPaleta();
319

  
320
	}
321

  
322
	/* (non-Javadoc)
323
	 * @see org.cresques.io.GeoRasterFile#close()
324
	 */
325
	public void close() {
326
	}
327

  
328
	/* (non-Javadoc)
329
	 * @see org.cresques.io.GeoRasterFile#updateImage(int, int, org.cresques.cts.ICoordTrans, java.awt.Image, int)
330
	 */
331
	public Image updateImage(int width, int height, ICoordTrans rp, Image img, int flags) {
332
		// TODO Auto-generated method stub
333
		return null;
334
	}
335

  
336
	/* (non-Javadoc)
337
	 * @see org.cresques.io.GeoRasterFile#getData(int, int, int)
338
	 */
339
	public Object getData(int x, int y, int band) {
340
		// TODO Auto-generated method stub
341
		return null;
342
	}
343
	
344
	/**
345
	 * Devuelve los datos de una ventana solicitada
346
	 * @param ulX	coordenada X superior izda.
347
	 * @param ulY	coordenada Y superior derecha.
348
	 * @param sizeX	tama?o en X de la ventana.
349
	 * @param sizeY tama?o en Y de la ventana.
350
	 * @param band	Banda solicitada.
351
	 */
352
	public byte[] getWindow(int ulX, int ulY, int sizeX, int sizeY, int band){
353

  
354
		return null;
355
	}
356
	
357
	/**
358
	 * Devuelve el tama?o de bloque
359
	 * @return Tama?o de bloque
360
	 */
361
	public int getBlockSize(){
362
     //TODO Nacho: Implementar getBlockSize de EcwFile
363
	  return 1;
364
	}
365
}
366

  
367

  
0 368

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src-dvp/org/cresques/io/AliaMapServerClient.java
1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.io;
48

  
49
import org.cresques.px.Extent;
50

  
51
/**
52
 * Consulta el servidor de mapas de Alia de Sevilla.
53
 * (hecho por tracasa)
54
 * ver http://sevilla.tracasa.es/navegar/?lang=cas
55
 * Implementa una llamada del tipo:
56
 * http://sevilla.tracasa.es/navegar/asp/mime.aspx?
57
 *   TIPO=0&Xmin=225916.666666667&Ymin=4133000&
58
 *   Xmax=254583.333333333&Ymax=4150000&PixAncho=430&PixAlto=255
59
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
60
 */
61
public class AliaMapServerClient extends MapServerClient {
62
	public final static int CAPA_ORTOFOTO_2000  = 0;
63
	public final static int CAPA_ORTOFOTO_7500  = 1;
64
	public final static int CAPA_GUIA_URBANA	= 2;
65
	
66
	public final static String [] nomCapas = {
67
		"Ortofoto 1:2.000 (Noviembre 2.001)",
68
		"Ortofoto 1:7.500 (Enero 1.999)",
69
		"Gu&iacute;a Urbana (Marzo 1.999)"};
70
	
71
	private int capas		= CAPA_ORTOFOTO_2000;
72
	
73
	public AliaMapServerClient(String serverName) {
74
		super(serverName);
75
		urlBase = "http://sevilla.tracasa.es/navegar/asp/mime.aspx";
76
		setExtent(new Extent(225916.67, 4150000.0, 254583.3, 4133000.0));
77
		setMaxViewSize(650,400);
78
	}
79
	
80
	public void setCapas(int c) { capas = c; }
81
	
82
	public String getUrl() {
83
		String url = urlBase+"?"+
84
			"TIPO="+capas+"&"+
85
			"Xmin="+xMin+"&"+ "Ymin="+yMax+"&"+
86
			"Xmax="+xMax+"&"+ "Ymax="+yMin+"&"+
87
			"PixAncho="+ancho+"&"+"PixAlto="+alto;;
88
		return url;
89
	}
90
}
0 91

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/.cdtproject
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse-cdt version="2.0"?>
3

  
4
<cdtproject>
5
<data/>
6
</cdtproject>
0 7

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/ant.xml
1
<project name="CMS for Java" default="dist" basedir=".">
2
    <description>
3
        Genera el jar con CMS y sus dependencias
4
    </description>
5
  <!-- set global properties for this build -->
6
  <property name="src" location="src"/>
7
  <property name="build" location="bin"/>
8
  <property name="dist"  location="dist"/>
9
  <property name="jar" value="cms"/>
10
  <!--property name="fmapdir" value="../FMAP"/-->
11
  <property name="targetDir1" location="../FMAP/lib"/>
12
  <property name="targetDir" location="../FMap 03/lib"/>
13
  <property name="targetDir2" location="."/>
14

  
15
  <target name="init">
16
    <!-- Create the time stamp -->
17
    <tstamp/>
18
    <!-- Create the build directory structure used by compile -->
19
    <mkdir dir="${build}"/>
20
  </target>
21

  
22
  <target name="compile" depends="init"
23
        description="compile the source " >
24
    <!-- Compile the java code from ${src} into ${build} 
25
    <javac srcdir="${src}" destdir="${build}"/>-->
26
  </target>
27

  
28
  <target name="dist" depends="compile"
29
        description="generate the distribution" >
30
    <!-- Create the distribution directory -->
31
    <mkdir dir="${dist}"/>
32

  
33
    <!-- Put everything in ${build} into the cms-${DSTAMP}.jar file --> 
34
    <jar jarfile="${dist}/${jar}.jar" basedir="${build}"/>
35
    <jar jarfile="${dist}/${jar}.jar" basedir="." includes = "images/*.gif" update="true" />
36
    <copy todir="${dist}">
37
    	<fileset dir="./lib" includes="*.jar"/>
38
    </copy>
39
    <copy todir="${targetDir1}/">
40
    	<fileset dir="${dist}" includes="**/**"/>
41
    </copy>
42
    <copy todir="${targetDir2}/">
43
    	<fileset dir="${dist}" includes="${jar}.jar"/>
44
    </copy>
45
    <move todir="${targetDir}/">
46
    	<fileset dir="${dist}" includes="**/**"/>
47
    </move>
48
  </target>
49

  
50
  <target name="clean"
51
        description="clean up" >
52
    <!-- Delete the ${build} and ${dist} directory trees -->
53
    <delete dir="${build}"/>
54
    <delete dir="${dist}"/>
55
  </target>
56
</project>
57

  
0 58

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>Cq CMS for Java</name>
4
	<comment></comment>
5
	<projects>
6
		<project>CIT MapView</project>
7
		<project>CqMDT</project>
8
		<project>jmGRasterLib</project>
9
	</projects>
10
	<buildSpec>
11
		<buildCommand>
12
			<name>org.eclipse.jdt.core.javabuilder</name>
13
			<arguments>
14
			</arguments>
15
		</buildCommand>
16
	</buildSpec>
17
	<natures>
18
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
19
		<nature>org.eclipse.jdt.core.javanature</nature>
20
		<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
21
	</natures>
22
</projectDescription>
0 23

  
tags/Root_jCMS04/libraries/libCq CMS for java.old/src/org/cresques/cts/ProjectionPool.java
1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23
 */
24
package org.cresques.cts;
25

  
26
import org.cresques.cts.gt2.CSDatum;
27
import org.cresques.cts.gt2.CSGaussPt;
28
import org.cresques.cts.gt2.CSLambertCC;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff