PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ LWGEOM_affine()

Datum LWGEOM_affine ( PG_FUNCTION_ARGS  )

Definition at line 2617 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(), PG_FUNCTION_INFO_V1(), ST_GeoHash(), AFFINE::xoff, AFFINE::yoff, and AFFINE::zoff.

Referenced by optimistic_overlap().

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