PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 871 of file mvt.c.

872{
873 LWGEOM *ng = lwgeom;
874 assert(lwgeom->type != POLYGONTYPE);
875 assert(lwgeom->type != MULTIPOLYGONTYPE);
876
877 if (clip_geom)
878 {
879 gridspec grid = {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0};
880 GBOX bgbox;
881 bgbox.xmax = bgbox.ymax = (double)extent + (double)buffer;
882 bgbox.xmin = bgbox.ymin = -(double)buffer;
883 bgbox.flags = 0;
884
885 ng = mvt_unsafe_clip_by_box(ng, &bgbox);
886
887 /* Make sure there is no pending float values (clipping can do that) */
888 lwgeom_grid_in_place(ng, &grid);
889 }
890
891 return ng;
892}
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
void lwgeom_grid_in_place(LWGEOM *lwgeom, gridspec *grid)
Definition lwgeom.c:2317
static LWGEOM * mvt_unsafe_clip_by_box(LWGEOM *lwg_in, GBOX *clip_box)
Definition mvt.c:839
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:1400

References buffer(), GBOX::flags, 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: