PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum LWGEOM_affine ( PG_FUNCTION_ARGS  )

Definition at line 2615 of file lwgeom_functions_basic.c.

References AFFINE::afac, LWGEOM::bbox, AFFINE::bfac, AFFINE::cfac, AFFINE::dfac, AFFINE::efac, AFFINE::ffac, dumpnode::geom, geometry_serialize(), AFFINE::gfac, AFFINE::hfac, AFFINE::ifac, lwgeom_affine(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_refresh_bbox(), AFFINE::xoff, AFFINE::yoff, and AFFINE::zoff.

2616 {
2617  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P_COPY(0);
2618  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
2619  GSERIALIZED *ret;
2620  AFFINE affine;
2621 
2622  affine.afac = PG_GETARG_FLOAT8(1);
2623  affine.bfac = PG_GETARG_FLOAT8(2);
2624  affine.cfac = PG_GETARG_FLOAT8(3);
2625  affine.dfac = PG_GETARG_FLOAT8(4);
2626  affine.efac = PG_GETARG_FLOAT8(5);
2627  affine.ffac = PG_GETARG_FLOAT8(6);
2628  affine.gfac = PG_GETARG_FLOAT8(7);
2629  affine.hfac = PG_GETARG_FLOAT8(8);
2630  affine.ifac = PG_GETARG_FLOAT8(9);
2631  affine.xoff = PG_GETARG_FLOAT8(10);
2632  affine.yoff = PG_GETARG_FLOAT8(11);
2633  affine.zoff = PG_GETARG_FLOAT8(12);
2634 
2635  POSTGIS_DEBUG(2, "LWGEOM_affine called.");
2636 
2637  lwgeom_affine(lwgeom, &affine);
2638 
2639  /* COMPUTE_BBOX TAINTING */
2640  if ( lwgeom->bbox )
2641  {
2642  lwgeom_refresh_bbox(lwgeom);
2643  }
2644  ret = geometry_serialize(lwgeom);
2645 
2646  /* Release memory */
2647  lwgeom_free(lwgeom);
2648  PG_FREE_IF_COPY(geom, 0);
2649 
2650  PG_RETURN_POINTER(ret);
2651 }
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
Definition: lwgeom.c:691
GBOX * bbox
Definition: liblwgeom.h:397
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
double zoff
Definition: liblwgeom.h:269
double ifac
Definition: liblwgeom.h:269
double ffac
Definition: liblwgeom.h:269
double xoff
Definition: liblwgeom.h:269
double afac
Definition: liblwgeom.h:269
LWGEOM * geom
double cfac
Definition: liblwgeom.h:269
double dfac
Definition: liblwgeom.h:269
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
double efac
Definition: liblwgeom.h:269
double yoff
Definition: liblwgeom.h:269
double gfac
Definition: liblwgeom.h:269
double hfac
Definition: liblwgeom.h:269
double bfac
Definition: liblwgeom.h:269
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
Definition: lwgeom.c:1962

Here is the call graph for this function: