PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWGEOM * lwgeom_grid ( LWGEOM lwgeom,
gridspec grid 
)

Definition at line 500 of file lwgeom_functions_analytic.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, LINETYPE, lwcirc_grid(), lwcollection_grid(), lwline_grid(), lwpoint_grid(), lwpoly_grid(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, and LWGEOM::type.

Referenced by lwcollection_grid(), LWGEOM_snaptogrid(), and LWGEOM_snaptogrid_pointoff().

501 {
502  switch (lwgeom->type)
503  {
504  case POINTTYPE:
505  return (LWGEOM *)lwpoint_grid((LWPOINT *)lwgeom, grid);
506  case LINETYPE:
507  return (LWGEOM *)lwline_grid((LWLINE *)lwgeom, grid);
508  case POLYGONTYPE:
509  return (LWGEOM *)lwpoly_grid((LWPOLY *)lwgeom, grid);
510  case MULTIPOINTTYPE:
511  case MULTILINETYPE:
512  case MULTIPOLYGONTYPE:
513  case COLLECTIONTYPE:
514  case COMPOUNDTYPE:
515  return (LWGEOM *)lwcollection_grid((LWCOLLECTION *)lwgeom, grid);
516  case CIRCSTRINGTYPE:
517  return (LWGEOM *)lwcirc_grid((LWCIRCSTRING *)lwgeom, grid);
518  default:
519  elog(ERROR, "lwgeom_grid: Unsupported geometry type: %s",
520  lwtype_name(lwgeom->type));
521  return NULL;
522  }
523 }
#define LINETYPE
Definition: liblwgeom.h:61
LWCOLLECTION * lwcollection_grid(LWCOLLECTION *coll, gridspec *grid)
LWCIRCSTRING * lwcirc_grid(LWCIRCSTRING *line, gridspec *grid)
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
LWPOLY * lwpoly_grid(LWPOLY *poly, gridspec *grid)
LWPOINT * lwpoint_grid(LWPOINT *point, gridspec *grid)
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
LWLINE * lwline_grid(LWLINE *line, gridspec *grid)
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: