PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgml2_gbox()

static void asgml2_gbox ( stringbuffer_t sb,
const GBOX bbox,
const GML_Options opts 
)
static

Definition at line 82 of file lwout_gml.c.

83 {
84  if (!bbox)
85  {
86  stringbuffer_aprintf(sb, "<%sBox", opts->prefix);
87  if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
88  stringbuffer_append(sb, "/>");
89  return;
90  }
91  else
92  {
93  POINT4D pt = { bbox->xmin, bbox->ymin, bbox->zmin, 0.0 };
95  ptarray_append_point(pa, &pt, LW_TRUE);
96  pt.x = bbox->xmax; pt.y = bbox->ymax; pt.z = bbox->zmax;
97  ptarray_append_point(pa, &pt, LW_TRUE);
98 
99  if (opts->srs) stringbuffer_aprintf(sb, "<%sBox srsName=\"%s\">", opts->prefix, opts->srs);
100  else stringbuffer_aprintf(sb, "<%sBox>", opts->prefix);
101 
102  stringbuffer_aprintf(sb, "<%scoordinates>", opts->prefix);
103  asgml2_ptarray(sb, pa, opts);
104  stringbuffer_aprintf(sb, "</%scoordinates>", opts->prefix);
105  stringbuffer_aprintf(sb, "</%sBox>", opts->prefix);
106 
107  ptarray_free(pa);
108  }
109 }
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
Definition: ptarray.c:59
void ptarray_free(POINTARRAY *pa)
Definition: ptarray.c:319
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
Definition: ptarray.c:147
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
static void asgml2_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
Definition: lwout_gml.c:51
opts
Definition: ovdump.py:45
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
Definition: stringbuffer.c:247
static void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
Definition: stringbuffer.h:105
double ymax
Definition: liblwgeom.h:357
double zmax
Definition: liblwgeom.h:359
double xmax
Definition: liblwgeom.h:355
double zmin
Definition: liblwgeom.h:358
double ymin
Definition: liblwgeom.h:356
double xmin
Definition: liblwgeom.h:354
lwflags_t flags
Definition: liblwgeom.h:353
double x
Definition: liblwgeom.h:414
double z
Definition: liblwgeom.h:414
double y
Definition: liblwgeom.h:414

References asgml2_ptarray(), GBOX::flags, FLAGS_GET_Z, LW_TRUE, ovdump::opts, ptarray_append_point(), ptarray_construct_empty(), ptarray_free(), stringbuffer_append(), stringbuffer_aprintf(), POINT4D::x, GBOX::xmax, GBOX::xmin, POINT4D::y, GBOX::ymax, GBOX::ymin, POINT4D::z, GBOX::zmax, and GBOX::zmin.

Referenced by lwgeom_extent_to_gml2().

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