root / trunk / extensions / extWCS / src / com / iver / cit / gvsig / gui / WCSDataSourceAdapter.java @ 1877
History | View | Annotate | Download (2.97 KB)
1 | 1877 | luisw | /*
|
---|---|---|---|
2 | * Created on 09-sep-2004
|
||
3 | *
|
||
4 | * To change the template for this generated file go to
|
||
5 | * Window>Preferences>Java>Code Generation>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 com.iver.cit.gvsig.gui; |
||
48 | |||
49 | import java.awt.geom.Rectangle2D; |
||
50 | import java.io.IOException; |
||
51 | import java.net.URL; |
||
52 | import java.util.ArrayList; |
||
53 | |||
54 | import com.iver.cit.gvsig.fmap.drivers.wcs.FMapWCSDriver; |
||
55 | import com.iver.cit.gvsig.gui.wcs.WCSWizardData; |
||
56 | import com.iver.cit.gvsig.gui.wcs.WCSWizardDataSource; |
||
57 | |||
58 | |||
59 | /**
|
||
60 | * Adapta las capa wms de Fmap a los datasource del WMSWizard
|
||
61 | *
|
||
62 | * @author Jaume Dom?nguez Faus - jaume.dominguez@iver.es
|
||
63 | */
|
||
64 | public class WCSDataSourceAdapter implements WCSWizardDataSource { |
||
65 | private FMapWCSDriver client;
|
||
66 | |||
67 | /* (non-Javadoc)
|
||
68 | * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#detalles(java.net.URL)
|
||
69 | */
|
||
70 | public WCSWizardData detalles(URL host) { |
||
71 | System.out.println("WCS>>> creant el client per al servidor '"+host.toString()+"'"); |
||
72 | client = new FMapWCSDriver(host.toString());
|
||
73 | System.out.println("WCS>>> client creat"); |
||
74 | |||
75 | try {
|
||
76 | System.out.println("WCS>>> client.connect()"); |
||
77 | client.connect(); // <-- GetCapabilities + DescribeCoverage
|
||
78 | System.out.println("WCS>>> connectat"); |
||
79 | |||
80 | } catch (IOException e) { |
||
81 | // TODO Veure qu? es fa amb les excepcions
|
||
82 | System.out.println("Exception al intentar connectar WCS"); |
||
83 | e.printStackTrace(); |
||
84 | } |
||
85 | WCSWizardData data = new WCSWizardData();
|
||
86 | data.setTitle(client.getLabel()); |
||
87 | data.setDescription(client.getDescription()); |
||
88 | data.setCoverageNames(client.getCoverageNames()); |
||
89 | |||
90 | return data;
|
||
91 | } |
||
92 | |||
93 | /* (non-Javadoc)
|
||
94 | * @see com.iver.cit.gvsig.gui.wms.WizardDataSource#getBoundingBox(java.lang.String[], java.lang.String)
|
||
95 | */
|
||
96 | public Rectangle2D getBoundingBox(String[] layerName, String srs) { |
||
97 | // TODO Auto-generated method stub
|
||
98 | return null; |
||
99 | } |
||
100 | |||
101 | } |