PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_affine()

Datum LWGEOM_affine ( PG_FUNCTION_ARGS  )

Definition at line 2629 of file lwgeom_functions_basic.c.

2630 {
2631  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P_COPY(0);
2632  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
2633  GSERIALIZED *ret;
2634  AFFINE affine;
2635 
2636  affine.afac = PG_GETARG_FLOAT8(1);
2637  affine.bfac = PG_GETARG_FLOAT8(2);
2638  affine.cfac = PG_GETARG_FLOAT8(3);
2639  affine.dfac = PG_GETARG_FLOAT8(4);
2640  affine.efac = PG_GETARG_FLOAT8(5);
2641  affine.ffac = PG_GETARG_FLOAT8(6);
2642  affine.gfac = PG_GETARG_FLOAT8(7);
2643  affine.hfac = PG_GETARG_FLOAT8(8);
2644  affine.ifac = PG_GETARG_FLOAT8(9);
2645  affine.xoff = PG_GETARG_FLOAT8(10);
2646  affine.yoff = PG_GETARG_FLOAT8(11);
2647  affine.zoff = PG_GETARG_FLOAT8(12);
2648 
2649  POSTGIS_DEBUG(2, "LWGEOM_affine called.");
2650 
2651  lwgeom_affine(lwgeom, &affine);
2652 
2653  /* COMPUTE_BBOX TAINTING */
2654  if ( lwgeom->bbox )
2655  {
2656  lwgeom_refresh_bbox(lwgeom);
2657  }
2658  ret = geometry_serialize(lwgeom);
2659 
2660  /* Release memory */
2661  lwgeom_free(lwgeom);
2662  PG_FREE_IF_COPY(geom, 0);
2663 
2664  PG_RETURN_POINTER(ret);
2665 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
Definition: lwgeom.c:698
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
Definition: lwgeom.c:1984
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
double gfac
Definition: liblwgeom.h:273
double zoff
Definition: liblwgeom.h:273
double bfac
Definition: liblwgeom.h:273
double ifac
Definition: liblwgeom.h:273
double xoff
Definition: liblwgeom.h:273
double dfac
Definition: liblwgeom.h:273
double afac
Definition: liblwgeom.h:273
double ffac
Definition: liblwgeom.h:273
double cfac
Definition: liblwgeom.h:273
double hfac
Definition: liblwgeom.h:273
double efac
Definition: liblwgeom.h:273
double yoff
Definition: liblwgeom.h:273
GBOX * bbox
Definition: liblwgeom.h:401

References AFFINE::afac, LWGEOM::bbox, AFFINE::bfac, AFFINE::cfac, AFFINE::dfac, AFFINE::efac, AFFINE::ffac, 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.

Here is the call graph for this function: