3 <script src="../../lib/OpenLayers.js"></script>
4 <script type="text/javascript">
6 function test_Format_GML_constructor(t) {
9 var options = {'foo': 'bar'};
10 var format = new OpenLayers.Format.GML(options);
11 t.ok(format instanceof OpenLayers.Format.GML,
12 "new OpenLayers.Format.GML returns object" );
13 t.eq(format.foo, "bar", "constructor sets options correctly");
14 t.eq(typeof format.read, "function", "format has a read function");
15 t.eq(typeof format.write, "function", "format has a write function");
17 function test_Format_GML_getFid(t) {
19 var parser = new OpenLayers.Format.GML();
20 data = parser.read(test_content[1]);
21 t.eq(data[0].fid, '221', 'fid on polygons set correctly (with whitespace)');
22 t.eq(data[1].fid, '8', 'fid on linestrings set correctly with whitespace');
24 function test_Format_GML_no_clobber(t) {
26 var parser = new OpenLayers.Format.GML();
27 data = parser.read(test_content[1]);
28 t.eq(window.i, undefined,
29 "i is undefined in window scope after reading.");
31 function test_Format_GML_read_3d(t) {
33 var parser = new OpenLayers.Format.GML();
34 data = parser.read(test_content[0]);
35 t.eq(data[0].geometry.getBounds().toBBOX(), "-1254041.389712,250906.951598,-634517.119991,762236.29408", "Reading 3d content returns geometry with correct bounds (no 0,0)");
36 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Reading 3d content returns polygon geometry");
38 function test_Format_GML_write_geoms(t) {
40 var parser = new OpenLayers.Format.GML();
42 var point = shell_start + serialize_geoms['point'] + shell_end;
43 data = parser.read(point);
44 var output = parser.write(data);
45 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
46 t.eq(output, point, "Point geometry round trips correctly.");
48 var linestring = shell_start + serialize_geoms['linestring'] + shell_end;
49 data = parser.read(linestring);
50 var output = parser.write(data);
51 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
52 t.eq(output, linestring, "Line geometry round trips correctly.");
54 var polygon = shell_start + serialize_geoms['polygon'] + shell_end;
55 data = parser.read(polygon);
56 var output = parser.write(data);
57 output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
58 t.eq(output, polygon, "Poly geometry round trips correctly.");
60 var multipoint = shell_start + serialize_geoms['multipoint'] + shell_end;
61 data = parser.read(multipoint);
62 var output = parser.write(data);
63 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
64 t.eq(output, multipoint, "MultiPoint geometry round trips correctly.");
66 var multilinestring = shell_start + serialize_geoms['multilinestring'] + shell_end;
67 data = parser.read(multilinestring);
68 var output = parser.write(data);
69 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
70 t.eq(output, multilinestring, "MultiLine geometry round trips correctly.");
73 function test_Format_GML_read_point_geom(t) {
76 var point = shell_start + geoms['point'] + shell_end;
77 var parser = new OpenLayers.Format.GML();
78 data = parser.read(point);
79 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Point", "Point GML returns correct classname");
80 t.eq(data[0].geometry.x, 1, "x coord correct");
81 t.eq(data[0].geometry.y, 2, "y coord correct");
83 function test_Format_GML_read_linestring_geom(t) {
86 var line = shell_start + geoms['linestring'] + shell_end;
87 var parser = new OpenLayers.Format.GML();
88 data = parser.read(line);
89 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.LineString", "LineString GML returns correct classname");
90 t.eq(data[0].geometry.components[0].x, 1, "first x coord correct");
91 t.eq(data[0].geometry.components[0].y, 2, "first y coord correct");
92 t.eq(data[0].geometry.components[1].x, 4, "second x coord correct");
93 t.eq(data[0].geometry.components[1].y, 5, "second y coord correct");
95 function test_Format_GML_read_polygon_geom(t) {
98 var polygon = shell_start + geoms['polygon'] + shell_end;
99 var parser = new OpenLayers.Format.GML();
100 data = parser.read(polygon);
101 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Polygon GML returns correct classname");
102 t.eq(data[0].geometry.components[0].components[0].x, 1, "first x coord correct");
103 t.eq(data[0].geometry.components[0].components[0].y, 2, "first y coord correct");
104 t.eq(data[0].geometry.components[0].components[1].x, 4, "second x coord correct");
105 t.eq(data[0].geometry.components[0].components[1].y, 5, "second y coord correct");
106 t.eq(data[0].geometry.components[0].components.length, 4, "coords length correct");
107 t.eq(data[0].geometry.components.length, 1, "rings length correct");
109 function test_Format_GML_read_multipoint_geom(t) {
112 var multipoint = shell_start + geoms['multipoint'] + shell_end;
113 var parser = new OpenLayers.Format.GML();
114 data = parser.read(multipoint);
115 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.MultiPoint", "MultiPoint GML returns correct classname");
116 t.eq(data[0].geometry.components[0].x, 1, "x coord correct");
117 t.eq(data[0].geometry.components[0].y, 2, "y coord correct");
118 t.eq(data[0].geometry.components.length, 2, "length correct");
119 t.eq(data[0].geometry.components[1].x, 4, "x coord correct");
120 t.eq(data[0].geometry.components[1].y, 5, "y coord correct");
122 function test_Format_GML_read_multilinestring_geom(t) {
125 var multilinestring = shell_start + geoms['multilinestring'] + shell_end;
126 var parser = new OpenLayers.Format.GML();
127 data = parser.read(multilinestring);
128 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.MultiLineString", "MultiLineString GML returns correct classname");
129 t.eq(data[0].geometry.components[0].components[0].x, 1, "x coord correct");
130 t.eq(data[0].geometry.components[0].components[0].y, 2, "y coord correct");
131 t.eq(data[0].geometry.components[0].components.length, 2, "length correct");
132 t.eq(data[0].geometry.components[0].components[1].x, 4, "x coord correct");
133 t.eq(data[0].geometry.components[0].components[1].y, 5, "y coord correct");
136 function test_Format_GML_read_polygon_with_holes_geom(t) {
139 var polygon_with_holes = shell_start + geoms['polygon_with_holes'] + shell_end;
140 var parser = new OpenLayers.Format.GML();
141 data = parser.read(polygon_with_holes);
142 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Polygon GML returns correct classname");
143 t.eq(data[0].geometry.components[0].components[0].x, 1, "first x coord correct");
144 t.eq(data[0].geometry.components[0].components[0].y, 2, "first y coord correct");
145 t.eq(data[0].geometry.components[0].components[1].x, 4, "second x coord correct");
146 t.eq(data[0].geometry.components[0].components[1].y, 5, "second y coord correct");
147 t.eq(data[0].geometry.components[0].components.length, 4, "coords length correct");
148 t.eq(data[0].geometry.components[1].components[0].x, 11, "first x coord correct");
149 t.eq(data[0].geometry.components[1].components[0].y, 12, "first y coord correct");
150 t.eq(data[0].geometry.components[1].components[1].x, 14, "second x coord correct");
151 t.eq(data[0].geometry.components[1].components[1].y, 15, "second y coord correct");
152 t.eq(data[0].geometry.components[1].components.length, 4, "coords length correct");
153 t.eq(data[0].geometry.components.length, 2, "rings length correct");
155 function test_Format_GML_read_attributes(t) {
157 var parser = new OpenLayers.Format.GML();
158 data = parser.read(test_content[0]);
159 t.eq(data[0].attributes['NAME'], "WY", "Simple Attribute data is read correctly.");
160 t.eq(data[0].attributes['LONGNAME'], "Wyoming", "Attribute data is read from CDATA node correctly.");
161 t.ok(data[0].attributes['EMPTYATTR'] === null, "Attribute set to null for empty element.");
163 function test_Format_GML_read_envelope_geom(t) {
166 var envelope = shell_start + geoms['envelope'] + shell_end;
167 var parser = new OpenLayers.Format.GML();
168 data = parser.read(envelope);
169 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Envelope GML returns correct classname");
170 t.eq(data[0].geometry.components[0].components[0].x, 0, "first x coord correct");
171 t.eq(data[0].geometry.components[0].components[0].y, 1, "first y coord correct");
172 t.eq(data[0].geometry.components[0].components[1].x, 20, "second x coord correct");
173 t.eq(data[0].geometry.components[0].components[1].y, 1, "second y coord correct");
174 t.eq(data[0].geometry.components[0].components[2].x, 20, "third x coord correct");
175 t.eq(data[0].geometry.components[0].components[2].y, 21, "third y coord correct");
176 t.eq(data[0].geometry.components[0].components[3].x, 0, "fouth x coord correct");
177 t.eq(data[0].geometry.components[0].components[3].y, 21, "fourth y coord correct");
178 t.eq(data[0].geometry.components[0].components[4].x, 0, "fifth x coord correct");
179 t.eq(data[0].geometry.components[0].components[4].y, 1, "fifth y coord correct");
180 t.eq(data[0].geometry.components[0].components.length, 5, "coords length correct");
181 t.eq(data[0].geometry.components.length, 1, "rings length correct");
183 ///////////////////////////////////////////////////////////////
184 // tests the y x order of gml point
185 /////////////////////////////////////////////////////////////
186 function test_Format_GML_read_point_geom_yx(t) {
189 var point = shell_start + geoms_yx['point'] + shell_end;
190 var parser = new OpenLayers.Format.GML({'xy':false});
191 data = parser.read(point);
192 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Point", "Point GML returns correct classname");
193 t.eq(data[0].geometry.x, 1, "x coord correct");
194 t.eq(data[0].geometry.y, 2, "y coord correct");
196 function test_Format_GML_read_linestring_geom_yx(t) {
199 var line = shell_start + geoms_yx['linestring'] + shell_end;
200 var parser = new OpenLayers.Format.GML({'xy':false});
201 data = parser.read(line);
202 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.LineString", "LineString GML returns correct classname");
203 t.eq(data[0].geometry.components[0].x, 1, "first x coord correct");
204 t.eq(data[0].geometry.components[0].y, 2, "first y coord correct");
205 t.eq(data[0].geometry.components[1].x, 4, "second x coord correct");
206 t.eq(data[0].geometry.components[1].y, 5, "second y coord correct");
208 function test_Format_GML_read_polygon_geom_yx(t) {
211 var polygon = shell_start + geoms_yx['polygon'] + shell_end;
212 var parser = new OpenLayers.Format.GML({'xy':false});
213 data = parser.read(polygon);
214 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Polygon GML returns correct classname");
215 t.eq(data[0].geometry.components[0].components[0].x, 1, "first x coord correct");
216 t.eq(data[0].geometry.components[0].components[0].y, 2, "first y coord correct");
217 t.eq(data[0].geometry.components[0].components[1].x, 4, "second x coord correct");
218 t.eq(data[0].geometry.components[0].components[1].y, 5, "second y coord correct");
219 t.eq(data[0].geometry.components[0].components.length, 4, "coords length correct");
220 t.eq(data[0].geometry.components.length, 1, "rings length correct");
222 function test_Format_GML_read_multipoint_geom_yx(t) {
225 var multipoint = shell_start + geoms_yx['multipoint'] + shell_end;
226 var parser = new OpenLayers.Format.GML({'xy':false});
227 data = parser.read(multipoint);
228 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.MultiPoint", "MultiPoint GML returns correct classname");
229 t.eq(data[0].geometry.components[0].x, 1, "x coord correct");
230 t.eq(data[0].geometry.components[0].y, 2, "y coord correct");
231 t.eq(data[0].geometry.components.length, 2, "length correct");
232 t.eq(data[0].geometry.components[1].x, 4, "x coord correct");
233 t.eq(data[0].geometry.components[1].y, 5, "y coord correct");
235 function test_Format_GML_read_multilinestring_geom_yx(t) {
238 var multilinestring = shell_start + geoms_yx['multilinestring'] + shell_end;
239 var parser = new OpenLayers.Format.GML({'xy':false});
240 data = parser.read(multilinestring);
241 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.MultiLineString", "MultiLineString GML returns correct classname");
242 t.eq(data[0].geometry.components[0].components[0].x, 1, "x coord correct");
243 t.eq(data[0].geometry.components[0].components[0].y, 2, "y coord correct");
244 t.eq(data[0].geometry.components[0].components.length, 2, "length correct");
245 t.eq(data[0].geometry.components[0].components[1].x, 4, "x coord correct");
246 t.eq(data[0].geometry.components[0].components[1].y, 5, "y coord correct");
249 function test_Format_GML_read_polygon_with_holes_geom_yx(t) {
252 var polygon_with_holes = shell_start + geoms_yx['polygon_with_holes'] + shell_end;
253 var parser = new OpenLayers.Format.GML({'xy':false});
254 data = parser.read(polygon_with_holes);
255 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Polygon GML returns correct classname");
256 t.eq(data[0].geometry.components[0].components[0].x, 1, "first x coord correct");
257 t.eq(data[0].geometry.components[0].components[0].y, 2, "first y coord correct");
258 t.eq(data[0].geometry.components[0].components[1].x, 4, "second x coord correct");
259 t.eq(data[0].geometry.components[0].components[1].y, 5, "second y coord correct");
260 t.eq(data[0].geometry.components[0].components.length, 4, "coords length correct");
261 t.eq(data[0].geometry.components[1].components[0].x, 11, "first x coord correct");
262 t.eq(data[0].geometry.components[1].components[0].y, 12, "first y coord correct");
263 t.eq(data[0].geometry.components[1].components[1].x, 14, "second x coord correct");
264 t.eq(data[0].geometry.components[1].components[1].y, 15, "second y coord correct");
265 t.eq(data[0].geometry.components[1].components.length, 4, "coords length correct");
266 t.eq(data[0].geometry.components.length, 2, "rings length correct");
269 function test_Format_GML_read_envelope_geom_yx(t) {
272 var envelope = shell_start + geoms_yx['envelope'] + shell_end;
273 var parser = new OpenLayers.Format.GML({'xy':false});
274 data = parser.read(envelope);
275 t.eq(data[0].geometry.CLASS_NAME, "OpenLayers.Geometry.Polygon", "Envelope GML returns correct classname");
276 t.eq(data[0].geometry.components[0].components[0].x, 0, "first x coord correct");
277 t.eq(data[0].geometry.components[0].components[0].y, 1, "first y coord correct");
278 t.eq(data[0].geometry.components[0].components[1].x, 20, "second x coord correct");
279 t.eq(data[0].geometry.components[0].components[1].y, 1, "second y coord correct");
280 t.eq(data[0].geometry.components[0].components[2].x, 20, "third x coord correct");
281 t.eq(data[0].geometry.components[0].components[2].y, 21, "third y coord correct");
282 t.eq(data[0].geometry.components[0].components[3].x, 0, "fouth x coord correct");
283 t.eq(data[0].geometry.components[0].components[3].y, 21, "fourth y coord correct");
284 t.eq(data[0].geometry.components[0].components[4].x, 0, "fifth x coord correct");
285 t.eq(data[0].geometry.components[0].components[4].y, 1, "fifth y coord correct");
286 t.eq(data[0].geometry.components[0].components.length, 5, "coords length correct");
287 t.eq(data[0].geometry.components.length, 1, "rings length correct");
290 function test_Format_GML_write_geoms_yx(t) {
292 var parser = new OpenLayers.Format.GML({'xy':false});
294 var point_xy = shell_start + serialize_geoms['point'] + shell_end;
295 var point = shell_start + serialize_geoms_yx['point'] + shell_end;
296 data = parser.read(point);
297 var output = parser.write(data);
298 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
299 t.eq(output, point_xy, "Point geometry round trips correctly.");
301 var linestring_xy = shell_start + serialize_geoms['linestring'] + shell_end;
302 var linestring = shell_start + serialize_geoms_yx['linestring'] + shell_end;
303 data = parser.read(linestring);
304 var output = parser.write(data);
305 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
306 t.eq(output, linestring_xy, "Line geometry round trips correctly.");
308 var polygon_xy = shell_start + serialize_geoms['polygon'] + shell_end;
309 var polygon = shell_start + serialize_geoms_yx['polygon'] + shell_end;
310 data = parser.read(polygon);
311 var output = parser.write(data);
312 output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
313 t.eq(output, polygon_xy, "Poly geometry round trips correctly.");
315 var multipoint_xy = shell_start + serialize_geoms['multipoint'] + shell_end;
316 var multipoint = shell_start + serialize_geoms_yx['multipoint'] + shell_end;
317 data = parser.read(multipoint);
318 var output = parser.write(data);
319 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
320 t.eq(output, multipoint_xy, "MultiPoint geometry round trips correctly.");
322 var multilinestring_xy = shell_start + serialize_geoms['multilinestring'] + shell_end;
323 var multilinestring = shell_start + serialize_geoms_yx['multilinestring'] + shell_end;
324 data = parser.read(multilinestring);
325 var output = parser.write(data);
326 var output = output.replace(/<\?[^>]*\?>/, ''); // Remove XML Prolog
327 t.eq(output, multilinestring_xy, "MultiLine geometry round trips correctly.");
330 function test_buildGeometryNode_bounds(t) {
332 var parser = new OpenLayers.Format.GML();
333 var bounds = new OpenLayers.Bounds(-180, -90, 180, 90);
336 // test that bounds are written as gml:Box
337 var output = parser.buildGeometryNode(bounds);
338 var expect = '<gml:Box xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="." cs="," ts=" ">-180,-90 180,90</gml:coordinates></gml:Box>';
339 t.xml_eq(output, expect, "[xy true] Bounds correctly written as gml:Box");
342 var test_content = ['<?xml version="1.0" encoding="utf-8" ?>\n<ogr:FeatureCollection\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://ogr.maptools.org/ testoutput.xsd"\n xmlns:ogr="http://ogr.maptools.org/"\n xmlns:gml="http://www.opengis.net/gml">\n <gml:boundedBy>\n <gml:Box>\n <gml:coord><gml:X>-1254041.389711702</gml:X><gml:Y>250906.9515983529</gml:Y></gml:coord>\n <gml:coord><gml:X>-634517.1199908922</gml:X><gml:Y>762236.2940800377</gml:Y></gml:coord>\n </gml:Box>\n </gml:boundedBy> \n <gml:featureMember>\n <ogr:states fid="F0">\n <ogr:geometryProperty><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-634517.11999089224,691849.77929356066,0 -653761.64509297756,471181.53429472551,0 -673343.60852865304,250906.9515983529,0 -1088825.734430399,299284.85108220269,0 -1254041.3897117018,324729.27754874947,0 -1235750.4212498858,434167.33911316615,0 -1190777.7803201093,704392.96327195223,0 -1181607.835811228,762236.29408003774,0 -634517.11999089224,691849.77929356066,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>\n <ogr:NAME>WY</ogr:NAME>\n <ogr:EMPTYATTR/><ogr:LONGNAME><![CDATA[Wyoming]]></ogr:LONGNAME>\n </ogr:states>\n </gml:featureMember>\n</ogr:FeatureCollection>\n',
343 '<wfs:FeatureCollection' +
344 ' xmlns:fs="http://example.com/featureserver"' +
345 ' xmlns:wfs="http://www.opengis.net/wfs"' +
346 ' xmlns:gml="http://www.opengis.net/gml"' +
347 ' xmlns:ogc="http://www.opengis.net/ogc"' +
348 ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
349 ' xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengeospatial.net//wfs/1.0.0/WFS-basic.xsd">' +
352 ' <gml:featureMember>' +
353 ' \n<fs:scribble fid="221">' +
357 ' <gml:outerBoundaryIs><gml:LinearRing>' +
358 ' <gml:coordinates>149.105072021,-35.1816558838 149.100608826,-35.1844024658 149.098892212,-35.1898956299 149.105072021,-35.1816558838</gml:coordinates>' +
359 ' </gml:LinearRing></gml:outerBoundaryIs>' +
363 ' <fs:title>random test features</fs:title>' +
365 '</gml:featureMember> ' +
366 ' <gml:featureMember><fs:scribble fid="8"> <fs:geometry> <gml:Point><gml:coordinates>-81.38671875,27.0703125</gml:coordinates></gml:Point> </fs:geometry> ' +
367 ' <fs:down>south</fs:down><fs:title>Florida</fs:title> </fs:scribble></gml:featureMember>' +
368 '</wfs:FeatureCollection>'
371 var shell_start = '<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"><gml:featureMember xmlns:gml="http://www.opengis.net/gml"><feature:features xmlns:feature="http://mapserver.gis.umn.edu/mapserver" fid="221"><feature:geometry>';
372 if (OpenLayers.Util.getBrowserName() == "opera") {
373 shell_start = '<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"><gml:featureMember xmlns:gml="http://www.opengis.net/gml"><feature:features fid="221" xmlns:feature="http://mapserver.gis.umn.edu/mapserver"><feature:geometry>';
375 var shell_end = '</feature:geometry></feature:features></gml:featureMember></wfs:FeatureCollection>';
376 var serialize_geoms = {
377 'point': '<gml:Point><gml:coordinates decimal="." cs="," ts=" ">1,2</gml:coordinates></gml:Point>',
378 'linestring': '<gml:LineString><gml:coordinates decimal="." cs="," ts=" ">1,2 4,5</gml:coordinates></gml:LineString>',
379 'polygon': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">1,2 4,5 3,6 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>',
380 'multipoint': '<gml:MultiPoint><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">1,2</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">4,5</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint>',
381 'multilinestring': '<gml:MultiLineString><gml:lineStringMember><gml:LineString><gml:coordinates decimal="." cs="," ts=" ">1,2 4,5</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates decimal="." cs="," ts=" ">11,12 14,15</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString>'
384 'point': '<gml:Point><gml:coordinates>1,2,3</gml:coordinates></gml:Point>',
385 'linestring': '<gml:LineString><gml:coordinates>1,2,3 4,5,6</gml:coordinates></gml:LineString>',
386 'polygon': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,2 4,5 3,6 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>',
387 'polygon_with_holes': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,2 4,5 3,6 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>11,12 14,15 13,16 11,12</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon>',
388 'multipoint': '<gml:MultiPoint><gml:Point><gml:coordinates>1,2,3</gml:coordinates></gml:Point><gml:Point><gml:coordinates>4,5,6</gml:coordinates></gml:Point></gml:MultiPoint>',
389 'multilinestring': '<gml:MultiLineString><gml:LineString><gml:coordinates>1,2,3 4,5,6</gml:coordinates></gml:LineString><gml:LineString><gml:coordinates>11,12,13 14,15,16</gml:coordinates></gml:LineString></gml:MultiLineString>',
390 'envelope': '<gml:Envelope><gml:lowerCorner>0 1</gml:lowerCorner><gml:upperCorner>20 21</gml:upperCorner></gml:Envelope>' // ,
391 // 'multipolygon_with_holes': '<gml:MultiPolygon><gml:Polygon><gml:outerBoundaryIs>1,2 4,5 3,6 1,2</gml:outerBoundaryIs><gml:innerBoundaryIs>11,12 14,15 13,16 11,12</gml:innerBoundaryIs></gml:Polygon><gml:Polygon><gml:outerBoundaryIs>101,102 104,105 103,106 101,102</gml:outerBoundaryIs><gml:innerBoundaryIs>111,112 114,115 113,116 111,112</gml:innerBoundaryIs></gml:Polygon></gml:MultiPolygon>'
396 // The following data has the (x y) reordered to (y x), in 3 dimensions it goes from (x y z) to (y x z)
399 var serialize_geoms_yx = {
400 'point': '<gml:Point><gml:coordinates decimal="." cs="," ts=" ">2,1</gml:coordinates></gml:Point>',
401 'linestring': '<gml:LineString><gml:coordinates decimal="." cs="," ts=" ">2,1 5,4</gml:coordinates></gml:LineString>',
402 'polygon': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">2,1 5,4 6,3 2,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>',
403 'multipoint': '<gml:MultiPoint><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">2,1</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates decimal="." cs="," ts=" ">5,4</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint>',
404 'multilinestring': '<gml:MultiLineString><gml:lineStringMember><gml:LineString><gml:coordinates decimal="." cs="," ts=" ">2,1 5,4</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates decimal="." cs="," ts=" ">12,11 15,14</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString>'
407 'point': '<gml:Point><gml:coordinates>2,1,3</gml:coordinates></gml:Point>',
408 'linestring': '<gml:LineString><gml:coordinates>2,1,3 5,4,6</gml:coordinates></gml:LineString>',
409 'polygon': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,1 5,4 6,3 2,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>',
410 'polygon_with_holes': '<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,1 5,4 6,3 2,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>12,11 15,14 16,13 12,11</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon>',
411 'multipoint': '<gml:MultiPoint><gml:Point><gml:coordinates>2,1,3</gml:coordinates></gml:Point><gml:Point><gml:coordinates>5,4,6</gml:coordinates></gml:Point></gml:MultiPoint>',
412 'multilinestring': '<gml:MultiLineString><gml:LineString><gml:coordinates>2,1,3 5,4,6</gml:coordinates></gml:LineString><gml:LineString><gml:coordinates>12,11,13 15,14,16</gml:coordinates></gml:LineString></gml:MultiLineString>',
413 'envelope': '<gml:Envelope><gml:lowerCorner>1 0</gml:lowerCorner><gml:upperCorner>21 20</gml:upperCorner></gml:Envelope>'