PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ out_gml_test_srid()

static void out_gml_test_srid ( void  )
static

Definition at line 244 of file cu_out_gml.c.

References do_gml2_test(), do_gml3_test(), do_gml3_test_opts(), and LW_GML_SHORTLINE.

Referenced by out_gml_suite_setup().

245 {
246  /* GML2 - Point with SRID */
247  do_gml2_test(
248  "POINT(0 1)",
249  "<gml:Point srsName=\"EPSG:4326\"><gml:coordinates>0,1</gml:coordinates></gml:Point>",
250  "EPSG:4326", 0);
251 
252  /* GML3 - Point with SRID */
253  do_gml3_test(
254  "POINT(0 1)",
255  "<gml:Point srsName=\"EPSG:4326\"><gml:pos srsDimension=\"2\">0 1</gml:pos></gml:Point>",
256  "EPSG:4326", 0, 0);
257 
258 
259  /* GML2 - Linestring with SRID */
260  do_gml2_test(
261  "LINESTRING(0 1,2 3,4 5)",
262  "<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>0,1 2,3 4,5</gml:coordinates></gml:LineString>",
263  "EPSG:4326", 0);
264 
265  /* GML3 - Linestring with SRID */
266  do_gml3_test(
267  "LINESTRING(0 1,2 3,4 5)",
268  "<gml:Curve srsName=\"EPSG:4326\"><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">0 1 2 3 4 5</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve>",
269  "EPSG:4326", 0, 0);
270 
271  /* GML3 - Linestring with SRID and short tag*/
273  "LINESTRING(0 1,2 3,4 5)",
274  "<gml:LineString srsName=\"EPSG:4326\"><gml:posList>0 1 2 3 4 5</gml:posList></gml:LineString>",
275  "EPSG:4326", 0, LW_GML_SHORTLINE);
276 
277 
278  /* GML2 Polygon with SRID */
279  do_gml2_test(
280  "POLYGON((0 1,2 3,4 5,0 1))",
281  "<gml:Polygon srsName=\"EPSG:4326\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,1 2,3 4,5 0,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>",
282  "EPSG:4326", 0);
283 
284  /* GML3 Polygon with SRID */
285  do_gml3_test(
286  "POLYGON((0 1,2 3,4 5,0 1))",
287  "<gml:Polygon srsName=\"EPSG:4326\"><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">0 1 2 3 4 5 0 1</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>",
288  "EPSG:4326", 0, 0);
289 
290 
291  /* GML2 MultiPoint with SRID */
292  do_gml2_test(
293  "MULTIPOINT(0 1,2 3)",
294  "<gml:MultiPoint srsName=\"EPSG:4326\"><gml:pointMember><gml:Point><gml:coordinates>0,1</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>2,3</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint>",
295  "EPSG:4326", 0);
296 
297  /* GML3 MultiPoint with SRID */
298  do_gml3_test(
299  "MULTIPOINT(0 1,2 3)",
300  "<gml:MultiPoint srsName=\"EPSG:4326\"><gml:pointMember><gml:Point><gml:pos srsDimension=\"2\">0 1</gml:pos></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:pos srsDimension=\"2\">2 3</gml:pos></gml:Point></gml:pointMember></gml:MultiPoint>",
301  "EPSG:4326", 0, 0);
302 
303 
304  /* GML2 Multiline with SRID */
305  do_gml2_test(
306  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
307  "<gml:MultiLineString srsName=\"EPSG:4326\"><gml:lineStringMember><gml:LineString><gml:coordinates>0,1 2,3 4,5</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>6,7 8,9 10,11</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString>",
308  "EPSG:4326", 0);
309 
310 
311  /* GML3 Multiline with SRID */
312  do_gml3_test(
313  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
314  "<gml:MultiCurve srsName=\"EPSG:4326\"><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">0 1 2 3 4 5</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">6 7 8 9 10 11</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember></gml:MultiCurve>",
315  "EPSG:4326", 0, 0);
316 
317  /* GML3 Multiline with SRID and LineString tag */
319  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
320  "<gml:MultiCurve srsName=\"EPSG:4326\"><gml:curveMember><gml:LineString><gml:posList>0 1 2 3 4 5</gml:posList></gml:LineString></gml:curveMember><gml:curveMember><gml:LineString><gml:posList>6 7 8 9 10 11</gml:posList></gml:LineString></gml:curveMember></gml:MultiCurve>",
321  "EPSG:4326", 0, LW_GML_SHORTLINE);
322 
323 
324  /* GML2 MultiPolygon with SRID */
325  do_gml2_test(
326  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
327  "<gml:MultiPolygon srsName=\"EPSG:4326\"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,1 2,3 4,5 0,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,7 8,9 10,11 6,7</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>",
328  "EPSG:4326", 0);
329 
330  /* GML3 MultiPolygon with SRID */
331  do_gml3_test(
332  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
333  "<gml:MultiSurface srsName=\"EPSG:4326\"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">0 1 2 3 4 5 0 1</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">6 7 8 9 10 11 6 7</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface>",
334  "EPSG:4326", 0, 0);
335 
336  /* GML3 PolyhedralSurface with SRID */
337  do_gml3_test(
338  "POLYHEDRALSURFACE(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
339  "<gml:PolyhedralSurface srsName=\"EPSG:4326\"><gml:polygonPatches><gml:PolygonPatch><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">0 1 2 3 4 5 0 1</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch><gml:PolygonPatch><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">6 7 8 9 10 11 6 7</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch></gml:polygonPatches></gml:PolyhedralSurface>",
340  "EPSG:4326", 0, 0);
341 
342  /* GML3 Tin with SRID */
343  do_gml3_test(
344  "TIN(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
345  "<gml:Tin srsName=\"EPSG:4326\"><gml:trianglePatches><gml:Triangle><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">0 1 2 3 4 5 0 1</gml:posList></gml:LinearRing></gml:exterior></gml:Triangle><gml:Triangle><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">6 7 8 9 10 11 6 7</gml:posList></gml:LinearRing></gml:exterior></gml:Triangle></gml:trianglePatches></gml:Tin>",
346  "EPSG:4326", 0, 0);
347 
348 
349  /* GML2 GeometryCollection with SRID */
350  do_gml2_test(
351  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
352  "<gml:MultiGeometry srsName=\"EPSG:4326\"><gml:geometryMember><gml:Point><gml:coordinates>0,1</gml:coordinates></gml:Point></gml:geometryMember><gml:geometryMember><gml:LineString><gml:coordinates>2,3 4,5</gml:coordinates></gml:LineString></gml:geometryMember></gml:MultiGeometry>",
353  "EPSG:4326", 0);
354 
355  /* GML3 GeometryCollection with SRID */
356  do_gml3_test(
357  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
358  "<gml:MultiGeometry srsName=\"EPSG:4326\"><gml:geometryMember><gml:Point><gml:pos srsDimension=\"2\">0 1</gml:pos></gml:Point></gml:geometryMember><gml:geometryMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">2 3 4 5</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:geometryMember></gml:MultiGeometry>",
359  "EPSG:4326", 0, 0);
360 }
static void do_gml3_test_opts(char *in, char *out, char *srs, int precision, int opts)
Definition: cu_out_gml.c:55
#define LW_GML_SHORTLINE
For GML3, use <LineString> rather than <Curve> for lines.
Definition: liblwgeom.h:1539
static void do_gml3_test(char *in, char *out, char *srs, int precision, int is_geodetic)
Definition: cu_out_gml.c:72
static void do_gml2_test(char *in, char *out, char *srs, int precision)
Definition: cu_out_gml.c:21
Here is the call graph for this function:
Here is the caller graph for this function: