svn-gvsig-desktop / tags / v1_1_Build_1012 / extensions / extWFS2 / src / com / iver / cit / gvsig / fmap / drivers / wfs / WFSFeaturesIterator.java @ 12987
History | View | Annotate | Download (4.61 KB)
1 |
package com.iver.cit.gvsig.fmap.drivers.wfs; |
---|---|
2 |
|
3 |
import org.cresques.cts.ICoordTrans; |
4 |
import org.gvsig.remoteClient.gml.IGMLFeaturesIterator; |
5 |
import org.gvsig.remoteClient.gml.exceptions.GMLException; |
6 |
|
7 |
import com.iver.cit.gvsig.fmap.DriverException; |
8 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
9 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
10 |
import com.iver.cit.gvsig.fmap.drivers.gml.FMAPGeometryFactory.FeatureWithAttributes; |
11 |
|
12 |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
14 |
*
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
16 |
*
|
17 |
* This program is free software; you can redistribute it and/or
|
18 |
* modify it under the terms of the GNU General Public License
|
19 |
* as published by the Free Software Foundation; either version 2
|
20 |
* of the License, or (at your option) any later version.
|
21 |
*
|
22 |
* This program is distributed in the hope that it will be useful,
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25 |
* GNU General Public License for more details.
|
26 |
*
|
27 |
* You should have received a copy of the GNU General Public License
|
28 |
* along with this program; if not, write to the Free Software
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
30 |
*
|
31 |
* For more information, contact:
|
32 |
*
|
33 |
* Generalitat Valenciana
|
34 |
* Conselleria d'Infraestructures i Transport
|
35 |
* Av. Blasco Ib??ez, 50
|
36 |
* 46010 VALENCIA
|
37 |
* SPAIN
|
38 |
*
|
39 |
* +34 963862235
|
40 |
* gvsig@gva.es
|
41 |
* www.gvsig.gva.es
|
42 |
*
|
43 |
* or
|
44 |
*
|
45 |
* IVER T.I. S.A
|
46 |
* Salamanca 50
|
47 |
* 46005 Valencia
|
48 |
* Spain
|
49 |
*
|
50 |
* +34 963163400
|
51 |
* dac@iver.es
|
52 |
*/
|
53 |
/* CVS MESSAGES:
|
54 |
*
|
55 |
* $Id: WFSFeaturesIterator.java 9916 2007-01-25 16:11:35Z jorpiell $
|
56 |
* $Log$
|
57 |
* Revision 1.1.2.5 2007-01-25 16:11:15 jorpiell
|
58 |
* Se han cambiado los imports que hac?an referencia a remoteServices. Esto es as?, porque se han renombrado las clases del driver de GML
|
59 |
*
|
60 |
* Revision 1.1.2.4 2006/11/17 11:28:45 ppiqueras
|
61 |
* Corregidos bugs y a?adida nueva funcionalidad.
|
62 |
*
|
63 |
* Revision 1.3 2006/10/02 09:09:45 jorpiell
|
64 |
* Cambios del 10 copiados al head
|
65 |
*
|
66 |
* Revision 1.1.2.2 2006/09/26 07:36:23 jorpiell
|
67 |
* El WFS no reproyectaba porque no se le asignaba a la capa un sistema de referencia. Ahora ya se hace.
|
68 |
*
|
69 |
* Revision 1.1.2.1 2006/09/19 12:28:32 jorpiell
|
70 |
* Ya no se depende de geotools
|
71 |
*
|
72 |
* Revision 1.1 2006/09/18 12:07:31 jorpiell
|
73 |
* Se ha sustituido geotools por el driver de remoteservices
|
74 |
*
|
75 |
* Revision 1.10 2006/08/29 07:56:12 cesar
|
76 |
* Rename the *View* family of classes to *Window* (ie: SingletonView to SingletonWindow, ViewInfo to WindowInfo, etc)
|
77 |
*
|
78 |
* Revision 1.9 2006/07/24 07:30:33 jorpiell
|
79 |
* Se han eliminado las partes duplicadas y se est? usando el parser de GML de FMAP.
|
80 |
*
|
81 |
* Revision 1.8 2006/07/05 12:05:54 jorpiell
|
82 |
* Se ha modificado para que avise si se han recuperado las mismas features que marca el campo buffer
|
83 |
*
|
84 |
* Revision 1.6 2006/06/21 12:35:45 jorpiell
|
85 |
* Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
|
86 |
*
|
87 |
* Revision 1.5 2006/06/15 11:17:06 jorpiell
|
88 |
* Se ha encontrado la forma de comprobar cuando se prodicia un error de parseo al hacer un hasnext (en la feature). Se atrapa y se lanza la excepci?n hacia arriba
|
89 |
*
|
90 |
* Revision 1.4 2006/06/15 07:50:58 jorpiell
|
91 |
* A?adida la funcionalidad de reproyectar y hechos algunos cambios en la interfaz
|
92 |
*
|
93 |
* Revision 1.3 2006/05/23 13:21:12 jorpiell
|
94 |
* Modificado el datasource para capturar las excepciones de parseo
|
95 |
*
|
96 |
* Revision 1.2 2006/05/22 10:10:07 jorpiell
|
97 |
* El iteartor crea un vector y lo inicializa en el primer recorrido que se hace sobre ?l. A partir de ah? se devuelve un elemento del vector en los posteriores recorridos
|
98 |
*
|
99 |
* Revision 1.1 2006/05/19 12:47:12 jorpiell
|
100 |
* Creado el iteardor de Features
|
101 |
*
|
102 |
*
|
103 |
*/
|
104 |
/**
|
105 |
* @author Jorge Piera Llodr? (piera_jor@gva.es)
|
106 |
*/
|
107 |
public class WFSFeaturesIterator implements IFeatureIterator{ |
108 |
private ICoordTrans coordTrans = null; |
109 |
private IGMLFeaturesIterator iterator = null; |
110 |
|
111 |
public WFSFeaturesIterator(IGMLFeaturesIterator iterator,String sProjection){ |
112 |
this.iterator = iterator;
|
113 |
} |
114 |
|
115 |
public boolean hasNext() throws DriverException { |
116 |
System.out.println("ir"); |
117 |
try {
|
118 |
return iterator.hasNext();
|
119 |
} catch (GMLException e) {
|
120 |
throw new DriverException(e.getMessage()); |
121 |
} |
122 |
} |
123 |
|
124 |
public IFeature next() throws DriverException { |
125 |
try {
|
126 |
return ((FeatureWithAttributes)iterator.next()).getFeature();
|
127 |
} catch (GMLException e) {
|
128 |
throw new DriverException(e.getMessage()); |
129 |
} |
130 |
} |
131 |
|
132 |
public void closeIterator() throws DriverException { |
133 |
|
134 |
} |
135 |
|
136 |
|
137 |
} |