PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgml3_gbox()

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

Definition at line 163 of file lwout_gml.c.

164 {
165  if (!bbox)
166  {
167  stringbuffer_aprintf(sb, "<%sEnvelope", opts->prefix);
168  if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
169  stringbuffer_append(sb, "/>");
170  return;
171  }
172  else
173  {
174  int dimension = FLAGS_GET_Z(bbox->flags) ? 3 : 2;
175 
177  POINT4D pt = { bbox->xmin, bbox->ymin, bbox->zmin, 0.0 };
178  ptarray_append_point(pa, &pt, LW_TRUE);
179 
180  stringbuffer_aprintf(sb, "<%sEnvelope", opts->prefix);
181  if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
182  if (IS_DIMS(opts->opts)) stringbuffer_aprintf(sb, " srsDimension=\"%d\"", dimension);
183  stringbuffer_append(sb, ">");
184 
185  stringbuffer_aprintf(sb, "<%slowerCorner>", opts->prefix);
186  asgml3_ptarray(sb, pa, opts);
187  stringbuffer_aprintf(sb, "</%slowerCorner>", opts->prefix);
188 
189  pt.x = bbox->xmax; pt.y = bbox->ymax; pt.z =bbox->zmax;
190  ptarray_remove_point(pa, 0);
191  ptarray_append_point(pa, &pt, LW_TRUE);
192 
193  stringbuffer_aprintf(sb, "<%supperCorner>", opts->prefix);
194  asgml3_ptarray(sb, pa, opts);
195  stringbuffer_aprintf(sb, "</%supperCorner>", opts->prefix);
196 
197  stringbuffer_aprintf(sb, "</%sEnvelope>", opts->prefix);
198  ptarray_free(pa);
199  }
200 }
int ptarray_remove_point(POINTARRAY *pa, uint32_t where)
Remove a point from an existing POINTARRAY.
Definition: ptarray.c:251
#define IS_DIMS(x)
Definition: liblwgeom.h:1691
#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 asgml3_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
Definition: lwout_gml.c:112
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 asgml3_ptarray(), GBOX::flags, FLAGS_GET_Z, IS_DIMS, LW_TRUE, ovdump::opts, ptarray_append_point(), ptarray_construct_empty(), ptarray_free(), ptarray_remove_point(), 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_gml3().

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