return LW_FAILURE;
/* Update the bounding box */
- lwgeom_drop_bbox(lwline_as_lwgeom(line));
- lwgeom_add_bbox(lwline_as_lwgeom(line));
+ if ( line->bbox )
+ {
+ lwgeom_drop_bbox(lwline_as_lwgeom(line));
+ lwgeom_add_bbox(lwline_as_lwgeom(line));
+ }
return LW_SUCCESS;
}
lwcollection_add_lwgeom(lwgeom_out, lwpoint_as_lwgeom(lwp));
}
- /* Set the bbox */
- lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
- lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ /* Set the bbox, if necessary */
+ if ( lwgeom_out->bbox )
+ {
+ lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
+ lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ }
return lwgeom_out;
}
}
}
- /* Set the bbox */
- lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
- lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ /* Set the bbox, if necessary */
+ if ( lwgeom_out->bbox )
+ {
+ lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
+ lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ }
return lwgeom_out;
}
lwfree(col);
}
}
- lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
- lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ if ( lwgeom_out->bbox )
+ {
+ lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
+ lwgeom_add_bbox((LWGEOM*)lwgeom_out);
+ }
+
if ( ! homogeneous )
{
lwgeom_out->type = COLLECTIONTYPE;
lwfree(q);
lwfree(r);
- if ( lwgeom_out->ngeoms > 0 )
+ if ( lwgeom_out->bbox && lwgeom_out->ngeoms > 0 )
{
lwgeom_drop_bbox((LWGEOM*)lwgeom_out);
lwgeom_add_bbox((LWGEOM*)lwgeom_out);
** functions do the right thing.
*/
lwgeom_set_geodetic(lwgeom, true);
+
/* Recalculate the boxes after re-setting the geodetic bit */
lwgeom_drop_bbox(lwgeom);
lwgeom_add_bbox(lwgeom);
+
g_ser = geography_serialize(lwgeom);
/*
lwgeom_affine(lwgeom, &affine);
/* COMPUTE_BBOX TAINTING */
- lwgeom_drop_bbox(lwgeom);
- lwgeom_add_bbox(lwgeom);
+ if ( lwgeom->bbox )
+ {
+ lwgeom_drop_bbox(lwgeom);
+ lwgeom_add_bbox(lwgeom);
+ }
ret = geometry_serialize(lwgeom);
/* Release memory */