| 1503 | | * This funx is a no-op only if a bbox cache is already present |
| 1504 | | * in input. If bbox cache is not there we'll need to handle |
| 1505 | | * automatic bbox addition FOR_COMPLEX_GEOMS. |
| 1506 | | */ |
| 1507 | | if ( lwgeom_contains_subgeoms(TYPE_GETTYPE(geom->type)) && |
| 1508 | | TYPE_HASBBOX(geom->type) ) |
| | 1500 | ** This funx is a no-op only if a bbox cache is already present |
| | 1501 | ** in input. If bbox cache is not there we'll need to handle |
| | 1502 | ** automatic bbox addition FOR_COMPLEX_GEOMS. |
| | 1503 | */ |
| | 1504 | if ( lwgeom_contains_subgeoms(TYPE_GETTYPE(geom->type)) && TYPE_HASBBOX(geom->type) ) |
| 1515 | | type = TYPE_GETTYPE(lwgeom->type); |
| 1516 | | |
| 1517 | | /* if it's a single POINT, LINESTRING or POLYGON geom, make it a multi */ |
| 1518 | | if ( type == POINTTYPE || type == LINETYPE || type == POLYGONTYPE ) |
| 1519 | | { |
| 1520 | | type += 3; |
| 1521 | | SRID = lwgeom->SRID; |
| 1522 | | /* We transfer bbox ownership from input to output */ |
| 1523 | | box = lwgeom->bbox; |
| 1524 | | lwgeom->SRID=-1; |
| 1525 | | lwgeom->bbox=NULL; |
| 1526 | | lwgeoms[0] = lwgeom; |
| 1527 | | |
| 1528 | | lwgeom = (LWGEOM *)lwcollection_construct(type, |
| 1529 | | SRID, box, 1, lwgeoms); |
| 1530 | | } |
| 1531 | | |
| 1532 | | |
| 1533 | | result = pglwgeom_serialize(lwgeom); |
| 1534 | | lwgeom_release(lwgeom); |
| | 1512 | ogeom = lwgeom_as_multi(lwgeom); |
| | 1513 | printf("ogeom %p\n",ogeom); |
| | 1514 | printf("ogeom->type %d\n", ogeom->type); |
| | 1515 | |
| | 1516 | result = pglwgeom_serialize(ogeom); |