PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void out_gml_test_geoms ( void  )
static

Definition at line 442 of file cu_out_gml.c.

References do_gml2_test(), do_gml2_unsupported(), do_gml3_test(), and do_gml3_unsupported().

Referenced by out_gml_suite_setup().

443 {
444  /* GML2 - Linestring */
445  do_gml2_test(
446  "LINESTRING(0 1,2 3,4 5)",
447  "<gml:LineString><gml:coordinates>0,1 2,3 4,5</gml:coordinates></gml:LineString>",
448  NULL, 0);
449 
450  /* GML3 - Linestring */
451  do_gml3_test(
452  "LINESTRING(0 1,2 3,4 5)",
453  "<gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">0 1 2 3 4 5</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve>",
454  NULL, 0, 0);
455 
456 
457  /* GML2 Polygon */
458  do_gml2_test(
459  "POLYGON((0 1,2 3,4 5,0 1))",
460  "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,1 2,3 4,5 0,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>",
461  NULL, 0);
462 
463  /* GML3 Polygon */
464  do_gml3_test(
465  "POLYGON((0 1,2 3,4 5,0 1))",
466  "<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>",
467  NULL, 0, 0);
468 
469  /* GML2 Polygon - with internal ring */
470  do_gml2_test(
471  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
472  "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,1 2,3 4,5 0,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>6,7 8,9 10,11 6,7</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon>",
473  NULL, 0);
474 
475  /* GML3 Polygon - with internal ring */
476  do_gml3_test(
477  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
478  "<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:interior><gml:LinearRing><gml:posList srsDimension=\"2\">6 7 8 9 10 11 6 7</gml:posList></gml:LinearRing></gml:interior></gml:Polygon>",
479  NULL, 0, 0);
480 
481 
482  /* GML3 Triangle */
483  do_gml3_test(
484  "TRIANGLE((0 1,2 3,4 5,0 1))",
485  "<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>",
486  NULL, 0, 0);
487 
488 
489  /* GML2 MultiPoint */
490  do_gml2_test(
491  "MULTIPOINT(0 1,2 3)",
492  "<gml:MultiPoint><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>",
493  NULL, 0);
494 
495  /* GML3 MultiPoint */
496  do_gml3_test(
497  "MULTIPOINT(0 1,2 3)",
498  "<gml:MultiPoint><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>",
499  NULL, 0, 0);
500 
501 
502  /* GML2 Multiline */
503  do_gml2_test(
504  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
505  "<gml:MultiLineString><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>",
506  NULL, 0);
507 
508  /* GML3 Multiline */
509  do_gml3_test(
510  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
511  "<gml:MultiCurve><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>",
512  NULL, 0, 0);
513 
514 
515  /* GML2 MultiPolygon */
516  do_gml2_test(
517  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
518  "<gml:MultiPolygon><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>",
519  NULL, 0);
520 
521  /* GML3 MultiPolygon */
522  do_gml3_test(
523  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
524  "<gml:MultiSurface><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>",
525  NULL, 0, 0);
526 
527 
528  /* GML2 - GeometryCollection */
529  do_gml2_test(
530  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
531  "<gml:MultiGeometry><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>",
532  NULL, 0);
533 
534  /* GML3 - GeometryCollection */
535  do_gml3_test(
536  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
537  "<gml:MultiGeometry><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>",
538  NULL, 0, 0);
539 
540 
541  /* GML2 - Nested GeometryCollection */
542  do_gml2_test(
543  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
544  "<gml:MultiGeometry><gml:geometryMember><gml:Point><gml:coordinates>0,1</gml:coordinates></gml:Point></gml:geometryMember><gml:geometryMember><gml:MultiGeometry><gml:geometryMember><gml:LineString><gml:coordinates>2,3 4,5</gml:coordinates></gml:LineString></gml:geometryMember></gml:MultiGeometry></gml:geometryMember></gml:MultiGeometry>",
545  NULL, 0);
546 
547  /* GML3 - Nested GeometryCollection */
548  do_gml3_test(
549  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
550  "<gml:MultiGeometry><gml:geometryMember><gml:Point><gml:pos srsDimension=\"2\">0 1</gml:pos></gml:Point></gml:geometryMember><gml:geometryMember><gml:MultiGeometry><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></gml:geometryMember></gml:MultiGeometry>",
551  NULL, 0, 0);
552 
553 
554 
555  /* GML2 - CircularString */
557  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
558  "lwgeom_to_gml2: 'CircularString' geometry type not supported");
559  /* GML3 - CircularString */
561  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
562  "lwgeom_to_gml3: 'CircularString' geometry type not supported");
563 
564  /* GML2 - CompoundCurve */
566  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
567  "lwgeom_to_gml2: 'CompoundCurve' geometry type not supported");
568  /* GML3 - CompoundCurve */
570  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
571  "lwgeom_to_gml3: 'CompoundCurve' geometry type not supported");
572 
573  /* GML2 - CurvePolygon */
575  "CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0))",
576  "lwgeom_to_gml2: 'CurvePolygon' geometry type not supported");
577 
578  /* GML3 - CurvePolygon */
580  "CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0))",
581  "lwgeom_to_gml3: 'CurvePolygon' geometry type not supported");
582 
583 
584  /* GML2 - MultiCurve */
586  "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
587  "lwgeom_to_gml2: 'MultiCurve' geometry type not supported");
588 
589  /* GML3 - MultiCurve */
591  "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
592  "lwgeom_to_gml3: 'MultiCurve' geometry type not supported");
593 
594  /* GML2 - MultiSurface */
596  "MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0)),((7 8,10 10,6 14,4 11,7 8)))",
597  "lwgeom_to_gml2: 'MultiSurface' geometry type not supported");
598 
599  /* GML3 - MultiSurface */
601  "MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0)),((7 8,10 10,6 14,4 11,7 8)))",
602  "lwgeom_to_gml3: 'MultiSurface' geometry type not supported");
603 
604  /* GML2 - PolyhedralSurface */
606  "POLYHEDRALSURFACE(((0 1,2 3,4 5,0 1)))",
607  "Cannot convert PolyhedralSurface to GML2. Try ST_AsGML(3, <geometry>) to generate GML3.");
608 
609  /* GML2 - Tin */
611  "TIN(((0 1,2 3,4 5,0 1)))",
612  "Cannot convert Tin to GML2. Try ST_AsGML(3, <geometry>) to generate GML3.");
613 }
static void do_gml3_unsupported(char *in, char *out)
Definition: cu_out_gml.c:151
static void do_gml2_unsupported(char *in, char *out)
Definition: cu_out_gml.c:133
static void do_gml3_test(char *in, char *out, char *srs, int precision, int is_geodetic)
Definition: cu_out_gml.c:73
static void do_gml2_test(char *in, char *out, char *srs, int precision)
Definition: cu_out_gml.c:22

Here is the call graph for this function:

Here is the caller graph for this function: