PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_affine()

void lwgeom_affine ( LWGEOM geom,
const AFFINE affine 
)

Definition at line 1969 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, ovdump::type, and LWGEOM::type.

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

1970 {
1971  int type = geom->type;
1972  uint32_t i;
1973 
1974  switch(type)
1975  {
1976  /* Take advantage of fact tht pt/ln/circ/tri have same memory structure */
1977  case POINTTYPE:
1978  case LINETYPE:
1979  case CIRCSTRINGTYPE:
1980  case TRIANGLETYPE:
1981  {
1982  LWLINE *l = (LWLINE*)geom;
1983  ptarray_affine(l->points, affine);
1984  break;
1985  }
1986  case POLYGONTYPE:
1987  {
1988  LWPOLY *p = (LWPOLY*)geom;
1989  for( i = 0; i < p->nrings; i++ )
1990  ptarray_affine(p->rings[i], affine);
1991  break;
1992  }
1993  case CURVEPOLYTYPE:
1994  {
1995  LWCURVEPOLY *c = (LWCURVEPOLY*)geom;
1996  for( i = 0; i < c->nrings; i++ )
1997  lwgeom_affine(c->rings[i], affine);
1998  break;
1999  }
2000  default:
2001  {
2002  if( lwgeom_is_collection(geom) )
2003  {
2004  LWCOLLECTION *c = (LWCOLLECTION*)geom;
2005  for( i = 0; i < c->ngeoms; i++ )
2006  {
2007  lwgeom_affine(c->geoms[i], affine);
2008  }
2009  }
2010  else
2011  {
2012  lwerror("lwgeom_affine: unable to handle type '%s'", lwtype_name(type));
2013  }
2014  }
2015  }
2016 
2017 }
#define LINETYPE
Definition: liblwgeom.h:85
LWGEOM ** rings
Definition: liblwgeom.h:537
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define TRIANGLETYPE
Definition: liblwgeom.h:97
uint32_t ngeoms
Definition: liblwgeom.h:509
uint32_t nrings
Definition: liblwgeom.h:457
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:511
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
Definition: lwgeom.c:1969
POINTARRAY ** rings
Definition: liblwgeom.h:459
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1085
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
uint32_t nrings
Definition: liblwgeom.h:535
#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:424
Here is the call graph for this function:
Here is the caller graph for this function: