136 size_t prefixlen = strlen(prefix);
141 size = (
sizeof(
"<Envelope>/") + (prefixlen*2) ) * 2;
142 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
146 ptr += sprintf(ptr,
"<%sEnvelope", prefix);
147 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
149 ptr += sprintf(ptr,
"/>");
164 size += (
sizeof(
"<Envelope><lowerCorner><upperCorner>//") + (prefixlen*3) ) * 2;
165 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
166 if (
IS_DIMS(
opts) ) size +=
sizeof(
" srsDimension=. .");
170 ptr += sprintf(ptr,
"<%sEnvelope", prefix);
171 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
172 if (
IS_DIMS(
opts) ) ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
173 ptr += sprintf(ptr,
">");
175 ptr += sprintf(ptr,
"<%slowerCorner>", prefix);
177 ptr += sprintf(ptr,
"</%slowerCorner>", prefix);
185 ptr += sprintf(ptr,
"<%supperCorner>", prefix);
187 ptr += sprintf(ptr,
"</%supperCorner>", prefix);
189 ptr += sprintf(ptr,
"</%sEnvelope>", prefix);
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
void ptarray_free(POINTARRAY *pa)
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, then a duplicate point will not be added.
#define LW_TRUE
Return types for functions with status returns.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
int ptarray_remove_point(POINTARRAY *pa, int where)
Remove a point from an existing POINTARRAY.
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
void * lwalloc(size_t size)