PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ LWGEOM_affine()

Datum LWGEOM_affine ( PG_FUNCTION_ARGS  )

Definition at line 2618 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().

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