PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ out_gml_test_geoms()

static void out_gml_test_geoms ( void  )
static

Definition at line 421 of file cu_out_gml.c.

422 {
423  /* GML2 - Linestring */
424  do_gml2_test(
425  "LINESTRING(0 1,2 3,4 5)",
426  "<gml:LineString><gml:coordinates>0,1 2,3 4,5</gml:coordinates></gml:LineString>",
427  NULL, 0);
428 
429  /* GML3 - Linestring */
430  do_gml3_test(
431  "LINESTRING(0 1,2 3,4 5)",
432  "<gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">0 1 2 3 4 5</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve>",
433  NULL, 0, 0);
434 
435 
436  /* GML2 Polygon */
437  do_gml2_test(
438  "POLYGON((0 1,2 3,4 5,0 1))",
439  "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,1 2,3 4,5 0,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>",
440  NULL, 0);
441 
442  /* GML3 Polygon */
443  do_gml3_test(
444  "POLYGON((0 1,2 3,4 5,0 1))",
445  "<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>",
446  NULL, 0, 0);
447 
448  /* GML2 Polygon - with internal ring */
449  do_gml2_test(
450  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
451  "<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>",
452  NULL, 0);
453 
454  /* GML3 Polygon - with internal ring */
455  do_gml3_test(
456  "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
457  "<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>",
458  NULL, 0, 0);
459 
460 
461  /* GML3 Triangle */
462  do_gml3_test(
463  "TRIANGLE((0 1,2 3,4 5,0 1))",
464  "<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>",
465  NULL, 0, 0);
466 
467 
468  /* GML2 MultiPoint */
469  do_gml2_test(
470  "MULTIPOINT(0 1,2 3)",
471  "<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>",
472  NULL, 0);
473 
474  /* GML3 MultiPoint */
475  do_gml3_test(
476  "MULTIPOINT(0 1,2 3)",
477  "<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>",
478  NULL, 0, 0);
479 
480 
481  /* GML2 Multiline */
482  do_gml2_test(
483  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
484  "<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>",
485  NULL, 0);
486 
487  /* GML3 Multiline */
488  do_gml3_test(
489  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
490  "<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>",
491  NULL, 0, 0);
492 
493 
494  /* GML2 MultiPolygon */
495  do_gml2_test(
496  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
497  "<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>",
498  NULL, 0);
499 
500  /* GML3 MultiPolygon */
501  do_gml3_test(
502  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
503  "<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>",
504  NULL, 0, 0);
505 
506 
507  /* GML2 - GeometryCollection */
508  do_gml2_test(
509  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
510  "<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>",
511  NULL, 0);
512 
513  /* GML3 - GeometryCollection */
514  do_gml3_test(
515  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
516  "<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>",
517  NULL, 0, 0);
518 
519 
520  /* GML2 - Nested GeometryCollection */
521  do_gml2_test(
522  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
523  "<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>",
524  NULL, 0);
525 
526  /* GML3 - Nested GeometryCollection */
527  do_gml3_test(
528  "GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
529  "<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>",
530  NULL, 0, 0);
531 
532  /* GML2 - CircularString */
534  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
535  "lwgeom_to_gml2: 'CircularString' geometry type not supported");
536  /* GML3 - CircularString */
537  do_gml3_test(
538  "CIRCULARSTRING(-2 0,0 2,2 0,0 2,2 4)",
539  "<gml:Curve><gml:segments><gml:ArcString><gml:posList srsDimension=\"2\">-2 0 0 2 2 0 0 2 2 4</gml:posList></gml:ArcString></gml:segments></gml:Curve>",
540  NULL, 0, 0 );
541 
542  /* GML2 - CompoundCurve */
544  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
545  "lwgeom_to_gml2: 'CompoundCurve' geometry type not supported");
546  /* GML3 - CompoundCurve */
547 
548  do_gml3_test(
549  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1,1 0),(1 0,0 1))",
550  "<gml:Curve><gml:segments><gml:ArcString><gml:posList srsDimension=\"2\">0 0 1 1 1 0</gml:posList></gml:ArcString><gml:LineStringSegment><gml:posList srsDimension=\"2\">1 0 0 1</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve>",
551  NULL, 0, 0 );
552 
553  /* GML2 - CurvePolygon */
555  "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))",
556  "lwgeom_to_gml2: 'CurvePolygon' geometry type not supported");
557 
558  /* GML3 - CurvePolygon */
559  do_gml3_test(
560  "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))",
561  "<gml:Polygon><gml:exterior><gml:Ring><gml:curveMember><gml:Curve><gml:segments><gml:ArcString><gml:posList srsDimension=\"2\">-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0</gml:posList></gml:ArcString></gml:segments></gml:Curve></gml:curveMember></gml:Ring></gml:exterior><gml:interior><gml:LinearRing><gml:posList srsDimension=\"2\">-1 0 0 0.5 1 0 0 1 -1 0</gml:posList></gml:LinearRing></gml:interior></gml:Polygon>",
562  NULL, 1, 0 );
563  do_gml3_test(
564  "CURVEPOLYGON(COMPOUNDCURVE((763650.600000001 189057.100000001,7636.35 189045.199999999, 763650.548999999 189057.844000001,763650.600000001 189057.100000001)))",
565  "<gml:Polygon><gml:exterior><gml:Ring><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">763650.6 189057.1 7636.35 189045.2 763650.549 189057.844 763650.6 189057.1</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember></gml:Ring></gml:exterior></gml:Polygon>",
566  NULL, 7, 0 );
567 
568  /* GML2 - MultiCurve */
570  "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
571  "lwgeom_to_gml2: 'MultiCurve' geometry type not supported");
572 
573  /* GML3 - MultiCurve */
574  do_gml3_test(
575  "MULTICURVE((5 5,3 5,3 3,0 3),CIRCULARSTRING(0 0,2 1,2 2))",
576  "<gml:MultiCurve><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension=\"2\">5 5 3 5 3 3 0 3</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember><gml:curveMember><gml:Curve><gml:segments><gml:ArcString><gml:posList srsDimension=\"2\">0 0 2 1 2 2</gml:posList></gml:ArcString></gml:segments></gml:Curve></gml:curveMember></gml:MultiCurve>",
577  NULL, 0, 0 );
578 
579  /* GML2 - MultiSurface */
581  "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)))",
582  "lwgeom_to_gml2: 'MultiSurface' geometry type not supported");
583 
584  /* GML3 - MultiSurface */
585  do_gml3_test(
586  "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)))",
587  "<gml:MultiSurface><gml:Polygon><gml:exterior><gml:Ring><gml:curveMember><gml:Curve><gml:segments><gml:ArcString><gml:posList srsDimension=\"2\">-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0</gml:posList></gml:ArcString></gml:segments></gml:Curve></gml:curveMember></gml:Ring></gml:exterior><gml:interior><gml:LinearRing><gml:posList srsDimension=\"2\">-1 0 0 0.5 1 0 0 1 -1 0</gml:posList></gml:LinearRing></gml:interior></gml:Polygon><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">7 8 10 10 6 14 4 11 7 8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:MultiSurface>",
588  NULL, 1, 0 );
589 
590  /* GML2 - PolyhedralSurface */
592  "POLYHEDRALSURFACE(((0 1,2 3,4 5,0 1)))",
593  "Cannot convert PolyhedralSurface to GML2. Try ST_AsGML(3, <geometry>) to generate GML3.");
594 
595  /* GML2 - Tin */
597  "TIN(((0 1,2 3,4 5,0 1)))",
598  "Cannot convert Tin to GML2. Try ST_AsGML(3, <geometry>) to generate GML3.");
599 }
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_unsupported(char *in, char *out)
Definition: cu_out_gml.c:132
static void do_gml2_test(char *in, char *out, char *srs, int precision)
Definition: cu_out_gml.c:21

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

Referenced by out_gml_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: