Revision 7716

View differences:

trunk/libraries/libRemoteServices/test/org/gvsig/remoteClient/gml/GMLReaderTest.java
59 59
 *
60 60
 * $Id$
61 61
 * $Log$
62
 * Revision 1.2  2006-09-18 12:08:55  jorpiell
62
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
63
 * Cambios del 10 copiados al head
64
 *
65
 * Revision 1.1.2.2  2006/09/25 11:35:15  jorpiell
66
 * Se tienen en cuanta tablas a distintos niveles. En caso de anidamiento se cogen los resultados de la primera tabla que aparezca.
67
 *
68
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
69
 * Ya no se depende de geotools
70
 *
71
 * Revision 1.2  2006/09/18 12:08:55  jorpiell
63 72
 * Se han hecho algunas modificaciones que necesitaba el WFS
64 73
 *
65 74
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
......
72 81
 */
73 82
public class GMLReaderTest extends TestCase {
74 83
	private static String gmlFileWFS = "test/WFS-dmsolutionsGetFeature.xml";
84
	private static String gmlFileWFSDuplicados = "test/WFS-AtlasAvesGetFeature.xml";
75 85
	private static String gmlFileWFSSercartlin = "test/WFS-sercartlinGetFeature.xml";
76 86
	private static String gmlFilePoints = "test/GML-points.gml";
77 87
	private static String gmlFileLines = "test/GML-lines.gml";
......
87 97
		parseFile(gmlFileWFSSercartlin);	
88 98
	}
89 99
	
100
	public void testWFSDuplicados() throws Exception{
101
		parseFile(gmlFileWFSDuplicados);	
102
	}
103
	
90 104
	public void testParsePoints() throws Exception{
91 105
		parseFile(gmlFilePoints);
92 106
	}
trunk/libraries/libRemoteServices/test/WFS-AtlasAvesGetFeature.xml
1
<?xml version='1.0' encoding="ISO-8859-1" ?>
2
<wfs:FeatureCollection
3
   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
4
   xmlns:wfs="http://www.opengis.net/wfs"
5
   xmlns:gml="http://www.opengis.net/gml"
6
   xmlns:ogc="http://www.opengis.net/ogc"
7
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
   xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengeospatial.net/wfs/1.0.0/WFS-basic.xsd 
9
                       http://mapserver.gis.umn.edu/mapserver http://161.111.161.171/cgi-bin/AtlasAves.exe?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=Blyr&amp;OUTPUTFORMAT=XMLSCHEMA">
10
      <gml:boundedBy>
11
      	<gml:Box srsName="EPSG:25830">
12
      		<gml:coordinates>3430.373535,4000000.000000 1000500.937500,4864042.000000</gml:coordinates>
13
      	</gml:Box>
14
      </gml:boundedBy>
15
    <gml:featureMember>
16
      <ms:Blyr>
17
        <gml:boundedBy>
18
        	<gml:Box srsName="EPSG:25830">
19
        		<gml:coordinates>135968.093750,4403976.000000 189009.265625,4457156.500000</gml:coordinates>
20
        	</gml:Box>
21
        </gml:boundedBy>
22
        <ms:msGeometry>
23
        <gml:Polygon srsName="EPSG:25830">
24
          <gml:outerBoundaryIs>
25
            <gml:LinearRing>
26
              <gml:coordinates>135968.093750,4406969.500000 139161.390625,4457156.500000 189009.265625,4453718.000000 185795.625000,4403976.000000 135968.093750,4406969.500000 </gml:coordinates>
27
            </gml:LinearRing>
28
          </gml:outerBoundaryIs>
29
        </gml:Polygon>
30
        </ms:msGeometry>
31
        <ms:cuadricula>PE4</ms:cuadricula>
32
        <ms:BiodivIndex>
33
          <ms:Numero_total_de_especies_en_2500_km2>117</ms:Numero_total_de_especies_en_2500_km2>
34
          <ms:Beta-diversidad>59.5</ms:Beta-diversidad>
35
          <ms:Numero_de_especies_SPEC_1y2y3>21</ms:Numero_de_especies_SPEC_1y2y3>
36
          <ms:Numero_medio_de_especies_en_100_km2_dentro_de_su_bloque_de_2500_km2>57.5</ms:Numero_medio_de_especies_en_100_km2_dentro_de_su_bloque_de_2500_km2>
37
        </ms:BiodivIndex>
38
        <ms:BiodivIndex>
39
          <ms:Numero_total_de_especies_en_2500_km2>1176666</ms:Numero_total_de_especies_en_2500_km2>
40
          <ms:Beta-diversidad>59.5</ms:Beta-diversidad>
41
          <ms:Numero_de_especies_SPEC_1y2y3>21</ms:Numero_de_especies_SPEC_1y2y3>
42
          <ms:Numero_medio_de_especies_en_100_km2_dentro_de_su_bloque_de_2500_km2>57.5</ms:Numero_medio_de_especies_en_100_km2_dentro_de_su_bloque_de_2500_km2>
43
        </ms:BiodivIndex>
44
      </ms:Blyr>
45
    </gml:featureMember>   
46
</wfs:FeatureCollection>
47

  
0 48

  
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/schemas/XMLComplexType.java
47 47
 *
48 48
 * $Id$
49 49
 * $Log$
50
 * Revision 1.3  2006-09-18 12:08:55  jorpiell
50
 * Revision 1.4  2006-10-02 08:33:49  jorpiell
51
 * Cambios del 10 copiados al head
52
 *
53
 * Revision 1.2.2.1  2006/09/19 12:23:15  jorpiell
54
 * Ya no se depende de geotools
55
 *
56
 * Revision 1.3  2006/09/18 12:08:55  jorpiell
51 57
 * Se han hecho algunas modificaciones que necesitaba el WFS
52 58
 *
53 59
 * Revision 1.2  2006/08/29 08:43:13  jorpiell
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/schemas/XMLSimpleType.java
51 51
 *
52 52
 * $Id$
53 53
 * $Log$
54
 * Revision 1.2  2006-09-18 12:08:55  jorpiell
54
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
55
 * Cambios del 10 copiados al head
56
 *
57
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
58
 * Ya no se depende de geotools
59
 *
60
 * Revision 1.2  2006/09/18 12:08:55  jorpiell
55 61
 * Se han hecho algunas modificaciones que necesitaba el WFS
56 62
 *
57 63
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/schemas/XMLSchemaParser.java
61 61
 *
62 62
 * $Id$
63 63
 * $Log$
64
 * Revision 1.2  2006-09-18 12:08:55  jorpiell
64
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
65
 * Cambios del 10 copiados al head
66
 *
67
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
68
 * Ya no se depende de geotools
69
 *
70
 * Revision 1.2  2006/09/18 12:08:55  jorpiell
65 71
 * Se han hecho algunas modificaciones que necesitaba el WFS
66 72
 *
67 73
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/v2/GMLFeaturesIterator_v2.java
2 2

  
3 3
import java.io.IOException;
4 4
import java.util.ArrayList;
5
import java.util.Hashtable;
5 6
import java.util.Vector;
6 7

  
7 8
import org.gvsig.remoteClient.gml.GMLException;
......
62 63
 *
63 64
 * $Id$
64 65
 * $Log$
65
 * Revision 1.2  2006-09-18 12:08:55  jorpiell
66
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
67
 * Cambios del 10 copiados al head
68
 *
69
 * Revision 1.1.2.2  2006/09/25 11:35:15  jorpiell
70
 * Se tienen en cuanta tablas a distintos niveles. En caso de anidamiento se cogen los resultados de la primera tabla que aparezca.
71
 *
72
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
73
 * Ya no se depende de geotools
74
 *
75
 * Revision 1.2  2006/09/18 12:08:55  jorpiell
66 76
 * Se han hecho algunas modificaciones que necesitaba el WFS
67 77
 *
68 78
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
......
168 178
		int currentTag;
169 179
		boolean end = false;
170 180
		ArrayList params = new ArrayList();
171
		ArrayList values = new ArrayList();;
181
		ArrayList values = new ArrayList();
182
		Hashtable duplicates = new Hashtable();
172 183
		Object geom = null;
173 184
		
174 185
		XMLElement element = XMLElementsFactory.getElement(elementName);
......
182 193
						String attName = getParser().getName();
183 194
						XMLElement attribute = elementType.getElement(attName);
184 195
						if (attribute != null){
185
							if (attribute.getType().getType() == IXMLType.SIMPLE){
186
								params.add(attName);
187
								getParser().next();
188
								values.add(((XMLSimpleType)attribute.getType()).getObject(getParser().getText()));
189
							}else if (attribute.getType().getType() == IXMLType.GML_GEOMETRY){
190
								geom = GMLUtilsParser.parseGeometry(getParser(),attName,getFactory());
191
							}else if (attribute.getType().getType() == IXMLType.COMPLEX){
192
								//Not in GML v2
196
							if (attribute.getType() != null){
197
								if (attribute.getType().getType() == IXMLType.SIMPLE){
198
									if (duplicates.get(attName) == null){
199
										params.add(attName);
200
										duplicates.put(attName,attName);
201
										getParser().next();
202
										values.add(((XMLSimpleType)attribute.getType()).getObject(getParser().getText()));
203
									}
204
								}else if (attribute.getType().getType() == IXMLType.GML_GEOMETRY){
205
									geom = GMLUtilsParser.parseGeometry(getParser(),attName,getFactory());
206
								}else if (attribute.getType().getType() == IXMLType.COMPLEX){
207
									//Not in GML v2
208
								}
193 209
							}
194 210
						}
195 211
						break;
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/gml/factories/XMLTypesFactory.java
52 52
 *
53 53
 * $Id$
54 54
 * $Log$
55
 * Revision 1.2  2006-09-18 12:08:55  jorpiell
55
 * Revision 1.3  2006-10-02 08:33:49  jorpiell
56
 * Cambios del 10 copiados al head
57
 *
58
 * Revision 1.1.2.1  2006/09/19 12:23:15  jorpiell
59
 * Ya no se depende de geotools
60
 *
61
 * Revision 1.2  2006/09/18 12:08:55  jorpiell
56 62
 * Se han hecho algunas modificaciones que necesitaba el WFS
57 63
 *
58 64
 * Revision 1.1  2006/08/10 12:00:49  jorpiell

Also available in: Unified diff