PostGIS  3.2.2dev-r@@SVN_REVISION@@

◆ ptarray_scale()

void ptarray_scale ( POINTARRAY pa,
const POINT4D fact 
)

WARNING, make sure you send in only 16-member double arrays or obviously things will go pear-shaped fast.

Scale a pointarray.

Definition at line 2325 of file ptarray.c.

2326 {
2327  uint32_t i;
2328  POINT4D p4d;
2329  LWDEBUG(3, "ptarray_scale start");
2330  for (i=0; i<pa->npoints; i++)
2331  {
2332  getPoint4d_p(pa, i, &p4d);
2333  p4d.x *= fact->x;
2334  p4d.y *= fact->y;
2335  p4d.z *= fact->z;
2336  p4d.m *= fact->m;
2337  ptarray_set_point4d(pa, i, &p4d);
2338  }
2339  LWDEBUG(3, "ptarray_scale end");
2340 }
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:126
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition: lwgeom_api.c:370
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
double m
Definition: liblwgeom.h:428
double x
Definition: liblwgeom.h:428
double z
Definition: liblwgeom.h:428
double y
Definition: liblwgeom.h:428
uint32_t npoints
Definition: liblwgeom.h:441

References getPoint4d_p(), LWDEBUG, POINT4D::m, POINTARRAY::npoints, ptarray_set_point4d(), POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by lwgeom_scale(), and test_ptarray_scale().

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