38{
44 1, 0, 0,
45 0, 1, 0,
46 0, 0, 1,
47 amount, 0, 0,
48 };
49
50
51
53 if ( ! box_in ) {
54
56 }
57
58 LWDEBUGF(2,
"BOX X range is %g..%g, cutx:%g, amount:%g", box_in->
xmin, box_in->
xmax, cutx, amount);
59
60
61 if ( ( amount < 0 && box_in->xmin >= cutx ) || ( amount > 0 && box_in->
xmax <= cutx ) )
62 {
65 LWDEBUGG(2, split,
"returning the translated geometry");
66 return split;
67 }
68
69
70 if ( ( amount < 0 && box_in->xmax <= cutx ) || ( amount > 0 && box_in->
xmin >= cutx ) )
71 {
73 LWDEBUGG(2, split,
"returning the cloned geometry");
74 return split;
75 }
76
77
78
79
82 pt.
y = box_in->
ymin - 1;
84 pt.
y = box_in->
ymax + 1;
87
88 LWDEBUG(2,
"splitting the geometry");
89
90
93 if ( ! split ) {
95 return NULL;
96 }
97 LWDEBUGG(2, split,
"split geometry");
98
99
100
102 if ( ! col ) {
103
104 lwnotice(
"WARNING: unexpected lack of split in lwgeom_split_wrapx");
106 }
109
110
112 LWDEBUGF(2,
"col_out:%p, unaryunion_out:%p", col_out, out);
114
116
117 return out;
118}
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
LWGEOM * lwgeom_unaryunion(const LWGEOM *geom1)
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)
void lwgeom_free(LWGEOM *geom)
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
void lwcollection_free(LWCOLLECTION *col)
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
#define LWDEBUGG(level, geom, msg)
static LWCOLLECTION * lwcollection_wrapx(const LWCOLLECTION *lwcoll_in, double cutx, double amount)