Revision 5824 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/fmap/drivers/geotools/WFSFilter.java
WFSFilter.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.fmap.drivers.geotools; |
2 | 2 |
|
3 |
import java.util.Hashtable; |
|
3 | 4 |
import java.util.Vector; |
4 | 5 |
|
5 | 6 |
import org.geotools.filter.CompareFilter; |
... | ... | |
9 | 10 |
|
10 | 11 |
import com.iver.andami.PluginServices; |
11 | 12 |
import com.iver.cit.gvsig.fmap.layers.WFSLayerNode; |
13 |
import com.vividsolutions.jts.geom.Geometry; |
|
14 |
import com.vividsolutions.jts.geom.GeometryCollection; |
|
15 |
import com.vividsolutions.jts.geom.LineString; |
|
16 |
import com.vividsolutions.jts.geom.MultiLineString; |
|
17 |
import com.vividsolutions.jts.geom.MultiPoint; |
|
18 |
import com.vividsolutions.jts.geom.MultiPolygon; |
|
19 |
import com.vividsolutions.jts.geom.Point; |
|
20 |
import com.vividsolutions.jts.geom.Polygon; |
|
12 | 21 |
|
13 | 22 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
14 | 23 |
* |
... | ... | |
54 | 63 |
* |
55 | 64 |
* $Id$ |
56 | 65 |
* $Log$ |
57 |
* Revision 1.3 2006-05-25 15:32:01 jorpiell |
|
66 |
* Revision 1.4 2006-06-14 07:57:19 jorpiell |
|
67 |
* Ya no se usa la estrategia ni se usa geotools para hacer el getFeature. Ahora se usa ?nicamente para el parseo de GML |
|
68 |
* |
|
69 |
* Revision 1.3 2006/05/25 15:32:01 jorpiell |
|
58 | 70 |
* Se ha a?adido la funcionalidad para eliminar el namespace de los tipos de atributos |
59 | 71 |
* |
60 | 72 |
* Revision 1.2 2006/05/25 10:32:21 jorpiell |
... | ... | |
155 | 167 |
return sAttribute; |
156 | 168 |
} |
157 | 169 |
|
170 |
public static Class getAttributeJavaType(WFSAttribute attribute){ |
|
171 |
String sType = getAttributeType(attribute); |
|
172 |
Class clazz = GmlToJavaConversion.get(sType); |
|
173 |
if (clazz == null){ |
|
174 |
clazz = String.class; |
|
175 |
} |
|
176 |
return clazz; |
|
177 |
} |
|
158 | 178 |
|
179 |
public static class GmlToJavaConversion{ |
|
180 |
private static Hashtable typeMap = new Hashtable(); |
|
181 |
|
|
182 |
static { |
|
183 |
typeMap.put("STRING", String.class); |
|
184 |
typeMap.put("\"\"", String.class); |
|
185 |
typeMap.put("INTEGER", Integer.class); |
|
186 |
typeMap.put("INT", Integer.class); |
|
187 |
typeMap.put("0", Integer.class); |
|
188 |
typeMap.put("DOUBLE", Double.class); |
|
189 |
typeMap.put("0.0", Double.class); |
|
190 |
typeMap.put("FLOAT", Float.class); |
|
191 |
typeMap.put("0.0F", Float.class); |
|
192 |
typeMap.put("GEOMETRY", Geometry.class); |
|
193 |
typeMap.put("GEOMETRYPROPERTYTYPE", Geometry.class); |
|
194 |
typeMap.put("POINT", Point.class); |
|
195 |
typeMap.put("POINTPROPERTYTYPE", Point.class); |
|
196 |
typeMap.put("LINESTRING", LineString.class); |
|
197 |
typeMap.put("LINESTRINGPROPERTYTYPE", LineString.class); |
|
198 |
typeMap.put("POLYGON", Polygon.class); |
|
199 |
typeMap.put("POLYGONPROPERTYTYPE", Polygon.class); |
|
200 |
typeMap.put("MULTIPOINT", MultiPoint.class); |
|
201 |
typeMap.put("MULTIPOINTPROPERTYTYPE", MultiPoint.class); |
|
202 |
typeMap.put("MULTILINESTRING", MultiLineString.class); |
|
203 |
typeMap.put("MULTILINESTRINGPROPERTYTYPE", MultiLineString.class); |
|
204 |
typeMap.put("MULTIPOLYGON", MultiPolygon.class); |
|
205 |
typeMap.put("MULTIPOLYGONPROPERTYTYPE", MultiPolygon.class); |
|
206 |
typeMap.put("MULTIGEOMETRYPROPERTYTYPE", GeometryCollection.class); |
|
207 |
typeMap.put("GEOMETRYCOLLECTION", GeometryCollection.class); |
|
208 |
typeMap.put("GEOMETRYASSOCIATIONTYPE", Geometry.class); |
|
209 |
} |
|
210 |
|
|
211 |
public static Class get(String key){ |
|
212 |
return (Class)typeMap.get(key.toUpperCase()); |
|
213 |
} |
|
214 |
} |
|
159 | 215 |
} |
Also available in: Unified diff