79 double mindx = 0, mindy = 0;
80 unsigned int i, j, iw, jw;
88 if (PG_GETARG_POINTER(0) == NULL) {
92 serialized_in = (
GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
94 if (PG_NARGS() == 3) {
96 if (PG_ARGISNULL(1) || PG_ARGISNULL(2)) {
98 PG_RETURN_POINTER(serialized_in);
101 mindx = PG_GETARG_FLOAT8(1);
102 mindy = PG_GETARG_FLOAT8(2);
103 if (mindx <= 0 && mindy <= 0) {
105 PG_RETURN_POINTER(serialized_in);
115 PG_RETURN_POINTER(serialized_in);
122 PG_RETURN_POINTER(serialized_in);
138 for (i=0; i<mline->
ngeoms; i++) {
144 mline->
geoms[iw++] = line;
158 for (i=0; i<polygon->
nrings; i++) {
169 for (k=0; k<polygon->
nrings; k++) {
187 for (j=0; j<mpolygon->
ngeoms; j++) {
191 for (i=0; i<polygon->
nrings; i++) {
202 for (k=0; k<polygon->
nrings; k++) {
216 mpolygon->
geoms[jw++] = polygon;
233 PG_FREE_IF_COPY(serialized_in, 0);
234 PG_RETURN_POINTER(serialized_out);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
void lwgeom_free(LWGEOM *geom)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
static void ptarray_remove_dim_helper(POINTARRAY *points, double mindx, double mindy)