PostGIS  2.5.0dev-r@@SVN_REVISION@@
void lwgeom_affine ( LWGEOM geom,
const AFFINE affine 
)

Definition at line 1962 of file lwgeom.c.

References CIRCSTRINGTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, LINETYPE, lwerror(), lwgeom_is_collection(), lwtype_name(), LWCOLLECTION::ngeoms, LWPOLY::nrings, LWCURVEPOLY::nrings, LWLINE::points, POINTTYPE, POLYGONTYPE, ptarray_affine(), LWPOLY::rings, LWCURVEPOLY::rings, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM_affine(), lwgeom_split_wrapx(), and mvt_geom().

1963 {
1964  int type = geom->type;
1965  uint32_t i;
1966 
1967  switch(type)
1968  {
1969  /* Take advantage of fact tht pt/ln/circ/tri have same memory structure */
1970  case POINTTYPE:
1971  case LINETYPE:
1972  case CIRCSTRINGTYPE:
1973  case TRIANGLETYPE:
1974  {
1975  LWLINE *l = (LWLINE*)geom;
1976  ptarray_affine(l->points, affine);
1977  break;
1978  }
1979  case POLYGONTYPE:
1980  {
1981  LWPOLY *p = (LWPOLY*)geom;
1982  for( i = 0; i < p->nrings; i++ )
1983  ptarray_affine(p->rings[i], affine);
1984  break;
1985  }
1986  case CURVEPOLYTYPE:
1987  {
1988  LWCURVEPOLY *c = (LWCURVEPOLY*)geom;
1989  for( i = 0; i < c->nrings; i++ )
1990  lwgeom_affine(c->rings[i], affine);
1991  break;
1992  }
1993  default:
1994  {
1995  if( lwgeom_is_collection(geom) )
1996  {
1997  LWCOLLECTION *c = (LWCOLLECTION*)geom;
1998  for( i = 0; i < c->ngeoms; i++ )
1999  {
2000  lwgeom_affine(c->geoms[i], affine);
2001  }
2002  }
2003  else
2004  {
2005  lwerror("lwgeom_affine: unable to handle type '%s'", lwtype_name(type));
2006  }
2007  }
2008  }
2009 
2010 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** rings
Definition: liblwgeom.h:534
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define TRIANGLETYPE
Definition: liblwgeom.h:97
uint32_t ngeoms
Definition: liblwgeom.h:506
uint32_t nrings
Definition: liblwgeom.h:454
unsigned int uint32_t
Definition: uthash.h:78
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
LWGEOM ** geoms
Definition: liblwgeom.h:508
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
Definition: lwgeom.c:1962
POINTARRAY ** rings
Definition: liblwgeom.h:456
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1078
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
uint32_t nrings
Definition: liblwgeom.h:532
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
void ptarray_affine(POINTARRAY *pa, const AFFINE *affine)
Affine transform a pointarray.
Definition: ptarray.c:1789
POINTARRAY * points
Definition: liblwgeom.h:421

Here is the call graph for this function:

Here is the caller graph for this function: