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

Definition at line 2513 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_add_bbox(), lwgeom_affine(), lwgeom_drop_bbox(), lwgeom_free(), lwgeom_from_gserialized(), AFFINE::xoff, AFFINE::yoff, and AFFINE::zoff.

2514 {
2515  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P_COPY(0);
2516  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
2517  GSERIALIZED *ret;
2518  AFFINE affine;
2519 
2520  affine.afac = PG_GETARG_FLOAT8(1);
2521  affine.bfac = PG_GETARG_FLOAT8(2);
2522  affine.cfac = PG_GETARG_FLOAT8(3);
2523  affine.dfac = PG_GETARG_FLOAT8(4);
2524  affine.efac = PG_GETARG_FLOAT8(5);
2525  affine.ffac = PG_GETARG_FLOAT8(6);
2526  affine.gfac = PG_GETARG_FLOAT8(7);
2527  affine.hfac = PG_GETARG_FLOAT8(8);
2528  affine.ifac = PG_GETARG_FLOAT8(9);
2529  affine.xoff = PG_GETARG_FLOAT8(10);
2530  affine.yoff = PG_GETARG_FLOAT8(11);
2531  affine.zoff = PG_GETARG_FLOAT8(12);
2532 
2533  POSTGIS_DEBUG(2, "LWGEOM_affine called.");
2534 
2535  lwgeom_affine(lwgeom, &affine);
2536 
2537  /* COMPUTE_BBOX TAINTING */
2538  if ( lwgeom->bbox )
2539  {
2540  lwgeom_drop_bbox(lwgeom);
2541  lwgeom_add_bbox(lwgeom);
2542  }
2543  ret = geometry_serialize(lwgeom);
2544 
2545  /* Release memory */
2546  lwgeom_free(lwgeom);
2547  PG_FREE_IF_COPY(geom, 0);
2548 
2549  PG_RETURN_POINTER(ret);
2550 }
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:1063
double zoff
Definition: liblwgeom.h:269
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:599
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
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
Definition: lwgeom.c:612
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:1704

Here is the call graph for this function: