PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ out_gml_test_srid()

static void out_gml_test_srid ( void  )
static

Definition at line 194 of file cu_out_gml.c.

195 {
196  /* GML2 - Point with SRID */
197  do_gml2_test(
198  "POINT(0 1)",
199  "<gml:Point srsName=\"EPSG:4326\"><gml:coordinates>0,1</gml:coordinates></gml:Point>",
200  "EPSG:4326", 0);
201 
202  /* GML3 - Point with SRID */
203  do_gml3_test(
204  "POINT(0 1)",
205  "<gml:Point srsName=\"EPSG:4326\"><gml:pos srsDimension=\"2\">0 1</gml:pos></gml:Point>",
206  "EPSG:4326", 0, 0);
207 
208 
209  /* GML2 - Linestring with SRID */
210  do_gml2_test(
211  "LINESTRING(0 1,2 3,4 5)",
212  "<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>0,1 2,3 4,5</gml:coordinates></gml:LineString>",
213  "EPSG:4326", 0);
214 
215  /* GML3 - Linestring with SRID */
216  do_gml3_test(
217  "LINESTRING(0 1,2 3,4 5)",
218  "<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>",
219  "EPSG:4326", 0, 0);
220 
221  /* GML3 - Linestring with SRID and short tag*/
223  "LINESTRING(0 1,2 3,4 5)",
224  "<gml:LineString srsName=\"EPSG:4326\"><gml:posList>0 1 2 3 4 5</gml:posList></gml:LineString>",
225  "EPSG:4326", 0, LW_GML_SHORTLINE);
226 
227 
228  /* GML2 Polygon with SRID */
229  do_gml2_test(
230  "POLYGON((0 1,2 3,4 5,0 1))",
231  "<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>",
232  "EPSG:4326", 0);
233 
234  /* GML3 Polygon with SRID */
235  do_gml3_test(
236  "POLYGON((0 1,2 3,4 5,0 1))",
237  "<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>",
238  "EPSG:4326", 0, 0);
239 
240 
241  /* GML2 MultiPoint with SRID */
242  do_gml2_test(
243  "MULTIPOINT(0 1,2 3)",
244  "<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>",
245  "EPSG:4326", 0);
246 
247  /* GML3 MultiPoint with SRID */
248  do_gml3_test(
249  "MULTIPOINT(0 1,2 3)",
250  "<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>",
251  "EPSG:4326", 0, 0);
252 
253 
254  /* GML2 Multiline with SRID */
255  do_gml2_test(
256  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
257  "<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>",
258  "EPSG:4326", 0);
259 
260 
261  /* GML3 Multiline with SRID */
262  do_gml3_test(
263  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
264  "<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>",
265  "EPSG:4326", 0, 0);
266 
267  /* GML3 Multiline with SRID and LineString tag */
269  "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
270  "<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>",
271  "EPSG:4326", 0, LW_GML_SHORTLINE);
272 
273 
274  /* GML2 MultiPolygon with SRID */
275  do_gml2_test(
276  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
277  "<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>",
278  "EPSG:4326", 0);
279 
280  /* GML3 MultiPolygon with SRID */
281  do_gml3_test(
282  "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
283  "<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>",
284  "EPSG:4326", 0, 0);
285 
286  /* GML3 PolyhedralSurface with SRID */
287  do_gml3_test(
288  "POLYHEDRALSURFACE(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
289  "<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>",
290  "EPSG:4326", 0, 0);
291 
292  /* GML3 Tin with SRID */
293  do_gml3_test(
294  "TIN(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
295  "<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>",
296  "EPSG:4326", 0, 0);
297 
298 
299  /* GML2 GeometryCollection with SRID */
300  do_gml2_test(
301  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
302  "<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>",
303  "EPSG:4326", 0);
304 
305  /* GML3 GeometryCollection with SRID */
306  do_gml3_test(
307  "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
308  "<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>",
309  "EPSG:4326", 0, 0);
310 }
static void do_gml3_test(char *in, char *out, char *srs, int precision, int is_geodetic)
Definition: cu_out_gml.c:54
static void do_gml3_test_opts(char *in, char *out, char *srs, int precision, int opts)
Definition: cu_out_gml.c:43
static void do_gml2_test(char *in, char *out, char *srs, int precision)
Definition: cu_out_gml.c:21
#define LW_GML_SHORTLINE
For GML3, use <LineString> rather than <Curve> for lines.
Definition: liblwgeom.h:1686

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

Referenced by out_gml_suite_setup().

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