PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ asgml2_poly()

static void asgml2_poly ( stringbuffer_t sb,
const LWPOLY poly,
const GML_Options opts 
)
static

Definition at line 240 of file lwout_gml.c.

241{
242 uint32_t i;
243
244 stringbuffer_aprintf(sb, "<%sPolygon", opts->prefix);
245 if (opts->srs) stringbuffer_aprintf(sb, " srsName=\"%s\"", opts->srs);
246 if (lwpoly_is_empty(poly))
247 {
248 stringbuffer_append(sb, "/>");
249 return;
250 }
251 stringbuffer_append(sb, ">");
252 stringbuffer_aprintf(sb, "<%souterBoundaryIs>", opts->prefix);
253 stringbuffer_aprintf(sb, "<%sLinearRing>", opts->prefix);
254 stringbuffer_aprintf(sb, "<%scoordinates>", opts->prefix);
255 asgml2_ptarray(sb, poly->rings[0], opts);
256 stringbuffer_aprintf(sb, "</%scoordinates>", opts->prefix);
257 stringbuffer_aprintf(sb, "</%sLinearRing>", opts->prefix);
258 stringbuffer_aprintf(sb, "</%souterBoundaryIs>", opts->prefix);
259 for (i=1; i<poly->nrings; i++)
260 {
261 stringbuffer_aprintf(sb, "<%sinnerBoundaryIs>", opts->prefix);
262 stringbuffer_aprintf(sb, "<%sLinearRing>", opts->prefix);
263 stringbuffer_aprintf(sb, "<%scoordinates>", opts->prefix);
264 asgml2_ptarray(sb, poly->rings[i], opts);
265 stringbuffer_aprintf(sb, "</%scoordinates>", opts->prefix);
266 stringbuffer_aprintf(sb, "</%sLinearRing>", opts->prefix);
267 stringbuffer_aprintf(sb, "</%sinnerBoundaryIs>", opts->prefix);
268 }
269 stringbuffer_aprintf(sb, "</%sPolygon>", opts->prefix);
270}
int lwpoly_is_empty(const LWPOLY *poly)
static void asgml2_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
Definition lwout_gml.c:51
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.
static void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524

References asgml2_ptarray(), lwpoly_is_empty(), LWPOLY::nrings, LWPOLY::rings, stringbuffer_append(), and stringbuffer_aprintf().

Referenced by asgml2_collection(), asgml2_multi(), and lwgeom_to_gml2().

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