// Now compute the bounding box and write it
if ( wantbbox && ! lwgeom_hasBBOX(loc[0]) )
{
- buf[0] = TYPE_SETHASBBOX(loc[0], 1);
+ buf[0] = loc[0];
+ TYPE_SETHASBBOX(buf[0], 1);
box3d = lw_geom_getBB_simple(loc);
box2d = box3d_to_box2df(box3d);
loc = buf+1;
{
result = (PG_LWGEOM *)lwalloc(geom->size);
result->size = geom->size;
- result->type = TYPE_SETTYPE(geom->type, COLLECTIONTYPE);
+ result->type = geom->type;
+ TYPE_SETTYPE(result->type, COLLECTIONTYPE);
memcpy(result->data, geom->data, geom->size-5);
PG_RETURN_POINTER(result);
}
result = (PG_LWGEOM *)lwalloc(size); // 4 for numgeoms, 1 for type
result->size = size;
- result->type = TYPE_SETTYPE(geom->type, COLLECTIONTYPE);
+ result->type = geom->type;
+ TYPE_SETTYPE(result->type, COLLECTIONTYPE);
iptr = geom->data;
optr = result->data;
optr+=4;
// write type of first geometry w/out BBOX and SRID
- optr[0] = TYPE_SETHASSRID(geom->type, 0);
- optr[0] = TYPE_SETHASBBOX(optr[0], 0);
+ optr[0] = geom->type;
+ TYPE_SETHASSRID(optr[0], 0);
+ TYPE_SETHASBBOX(optr[0], 0);
optr++;
// write remaining stuff
result = (PG_LWGEOM *)lwalloc(size); // 4 for numgeoms, 1 for type
result->size = size;
- result->type = TYPE_SETTYPE(geom->type, newtype);
+ result->type = geom->type;
+ TYPE_SETTYPE(result->type, newtype);
iptr = geom->data;
optr = result->data;
optr+=4;
// write type of first geometry w/out BBOX and SRID
- optr[0] = TYPE_SETHASSRID(geom->type, 0);
- optr[0] = TYPE_SETHASBBOX(optr[0], 0);
+ optr[0] = geom->type;
+ TYPE_SETHASSRID(optr[0], 0);
+ TYPE_SETHASBBOX(optr[0], 0);
optr++;
// write remaining stuff