PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ mvt_clip_and_validate_geos()

static LWGEOM* mvt_clip_and_validate_geos ( LWGEOM lwgeom,
uint8_t  basic_type,
uint32_t  extent,
uint32_t  buffer,
bool  clip_geom 
)
static

Definition at line 872 of file mvt.c.

873 {
874  LWGEOM *ng = lwgeom;
875  assert(lwgeom->type != POLYGONTYPE);
876  assert(lwgeom->type != MULTIPOLYGONTYPE);
877 
878  if (clip_geom)
879  {
880  gridspec grid = {0, 0, 0, 0, 1, 1, 0, 0};
881  GBOX bgbox;
882  bgbox.xmax = bgbox.ymax = (double)extent + (double)buffer;
883  bgbox.xmin = bgbox.ymin = -(double)buffer;
884  FLAGS_SET_GEODETIC(bgbox.flags, 0);
885 
886  ng = mvt_unsafe_clip_by_box(ng, &bgbox);
887 
888  /* Make sure there is no pending float values (clipping can do that) */
889  lwgeom_grid_in_place(ng, &grid);
890  }
891 
892  return ng;
893 }
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:107
#define POLYGONTYPE
Definition: liblwgeom.h:104
#define FLAGS_SET_GEODETIC(flags, value)
Definition: liblwgeom.h:175
void lwgeom_grid_in_place(LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:2166
static LWGEOM * mvt_unsafe_clip_by_box(LWGEOM *lwg_in, GBOX *clip_box)
Definition: mvt.c:840
Datum buffer(PG_FUNCTION_ARGS)
double ymax
Definition: liblwgeom.h:357
double xmax
Definition: liblwgeom.h:355
double ymin
Definition: liblwgeom.h:356
double xmin
Definition: liblwgeom.h:354
lwflags_t flags
Definition: liblwgeom.h:353
uint8_t type
Definition: liblwgeom.h:462
Snap-to-grid.
Definition: liblwgeom.h:1375

References buffer(), GBOX::flags, FLAGS_SET_GEODETIC, lwgeom_grid_in_place(), MULTIPOLYGONTYPE, mvt_unsafe_clip_by_box(), POLYGONTYPE, LWGEOM::type, GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by mvt_clip_and_validate().

Here is the call graph for this function:
Here is the caller graph for this function: