PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ pointArray_svg_abs()

static void pointArray_svg_abs ( stringbuffer_t sb,
const POINTARRAY pa,
int  close_ring,
int  precision,
int  start_at_index 
)
static

Returns maximum size of rendered pointarray in bytes.

Definition at line 102 of file lwout_svg.c.

103 {
104  int i, end;
105  const POINT2D* pt;
106  char sx[OUT_DOUBLE_BUFFER_SIZE];
107  char sy[OUT_DOUBLE_BUFFER_SIZE];
108 
109  end = close_ring ? pa->npoints : pa->npoints - 1;
110 
111  for (i = start_at_index; i < end; i++)
112  {
113  pt = getPoint2d_cp(pa, i);
114 
115  if (i == 1)
116  {
117  if (start_at_index > 0 ){
118  stringbuffer_append(sb, "L ");
119  }
120  else {
121  stringbuffer_append(sb, " L ");
122  }
123  }
124  else if (i) stringbuffer_append(sb, " ");
125 
126  lwprint_double(pt->x, precision, sx);
127  lwprint_double(-(pt->y), precision, sy);
128 
129  stringbuffer_aprintf(sb, "%s %s", sx, sy);
130  }
131 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define OUT_DOUBLE_BUFFER_SIZE
int lwprint_double(double d, int maxdd, char *buf)
Definition: lwprint.c:457
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:101
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 y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390
uint32_t npoints
Definition: liblwgeom.h:427

References getPoint2d_cp(), lwprint_double(), POINTARRAY::npoints, OUT_DOUBLE_BUFFER_SIZE, precision, stringbuffer_append(), stringbuffer_aprintf(), POINT2D::x, and POINT2D::y.

Referenced by assvg_compound(), assvg_line(), and assvg_polygon().

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