root / branches / v02_desarrollo / libraries / libCq CMS for java.old / src-dvp / org / cresques / io / CatastroMapServerClient.java @ 1394
History | View | Annotate | Download (1.85 KB)
1 |
/*
|
---|---|
2 |
* Created on 12-dic-2004
|
3 |
*/
|
4 |
package org.cresques.io; |
5 |
|
6 |
import java.security.Security; |
7 |
|
8 |
import org.cresques.px.Extent; |
9 |
|
10 |
/**
|
11 |
* Consulta el servidor de mapas de grafcan.
|
12 |
* Implementa una llamada del tipo:
|
13 |
* http://www.dgtcan.com/MapServer/Mapa.asp?
|
14 |
* XMin=219900&YMax=3151900&XMax=221000&YMin=3151300&
|
15 |
* Ancho=1000&Alto=1000&NumeroCapas=6&Capas=2&Servicio=NavGRAFCAN2
|
16 |
* @author Luis W. Sevilla (sevilla_lui@gva.es)
|
17 |
*/
|
18 |
public class CatastroMapServerClient extends MapServerClient { |
19 |
public final static int CAPA_ORTOFOTO = 2; |
20 |
public final static int CAPA_CARTOGRAFIA = 1; |
21 |
|
22 |
private int numeroCapas = 6; |
23 |
private int capas = CAPA_CARTOGRAFIA; |
24 |
private String servicio = "Catastro MinHac"; |
25 |
private String formato = "png"; |
26 |
private String transparente = "N"; |
27 |
private String urlServer; |
28 |
|
29 |
public CatastroMapServerClient(String serverName) { |
30 |
super(serverName);
|
31 |
urlServer = "https://ovc.catastro.minhac.es";
|
32 |
urlBase = urlServer+"/Cartografia/GeneraMapa.aspx";
|
33 |
/**/ setExtent(new Extent(717473,4381656,738612,4350973)); |
34 |
setServicio("SDE46.");
|
35 |
setCapas(242);
|
36 |
System.setProperty("java.protocol.handler.pkgs", |
37 |
"com.sun.net.ssl.internal.www.protocol");
|
38 |
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); |
39 |
} |
40 |
|
41 |
public void setCapas(int c) { capas = c; } |
42 |
|
43 |
public void setNumeroCapas(int c) { numeroCapas = c; } |
44 |
|
45 |
public void setServicio(String s) { servicio = s; } |
46 |
|
47 |
public void setTransparente(boolean t) { |
48 |
if (t) transparente = "S"; else transparente = "N"; |
49 |
} |
50 |
|
51 |
public String getBaseUrl() { |
52 |
return urlServer;
|
53 |
} |
54 |
|
55 |
public String getUrl() { |
56 |
String url = urlBase+"?"+ |
57 |
"prefijo="+servicio+"&mapa="+capas+"&formato="+formato+ "&"+ |
58 |
"XMin="+xMin+"&"+ "YMin="+Math.min(yMin, yMax)+"&"+ |
59 |
"XMax="+xMax+"&"+ "YMax="+Math.max(yMin, yMax)+"&"+ |
60 |
"AnchoPixels="+ancho+"&"+"AltoPixels="+alto+"&"+ |
61 |
"Transparente="+transparente;
|
62 |
return url;
|
63 |
} |
64 |
} |