76{
77 int size;
80 char *ptr, *output;
81 size_t prefixlen = strlen(prefix);
82
83 if ( ! bbox )
84 {
85 size = ( sizeof("<Box>/") + (prefixlen*2) ) * 2;
86 if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
87
89
90 ptr += sprintf(ptr, "<%sBox", prefix);
91
92 if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
93
94 ptr += sprintf(ptr, "/>");
95
96 return output;
97 }
98
100
105
110
112 size += ( sizeof("<Box><coordinates>/") + (prefixlen*2) ) * 2;
113 if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
114
116
117 if ( srs ) ptr += sprintf(ptr, "<%sBox srsName=\"%s\">", prefix, srs);
118 else ptr += sprintf(ptr, "<%sBox>", prefix);
119
120 ptr += sprintf(ptr, "<%scoordinates>", prefix);
122 ptr += sprintf(ptr, "</%scoordinates></%sBox>", prefix, prefix);
123
125
126 return output;
127}
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_Z(flags)
void * lwalloc(size_t size)
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,...
#define LW_TRUE
Return types for functions with status returns.
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)