]> granicus.if.org Git - postgis/commitdiff
Fix BBOX handling in serialization. Still related to #665
authorOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 8 Feb 2012 05:23:00 +0000 (05:23 +0000)
committerOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 8 Feb 2012 05:23:00 +0000 (05:23 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9092 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/libtgeom.c

index 79e046daeafa791743f32384079af34bb2c458a2..8a54327207a8164d15c1320edab77a76072d9623 100644 (file)
@@ -661,17 +661,20 @@ tgeom_serialize_buf(const TGEOM *tgeom, uint8_t *buf, size_t *retsize)
        size_t size=0;
        uint8_t *loc=buf;
        int dims = FLAGS_NDIMS(tgeom->flags);
+       uint8_t flags = tgeom->flags;
 
        assert(tgeom);
        assert(buf);
 
+       FLAGS_SET_BBOX(flags, tgeom->bbox?1:0);
+
        /* Write in the type. */
        memcpy(loc, &tgeom->type, sizeof(uint8_t));
        loc  += 1;
        size += 1;
 
        /* Write in the flags. */
-       memcpy(loc, &tgeom->flags, sizeof(uint8_t));
+       memcpy(loc, &flags, sizeof(uint8_t));
        loc  += 1;
        size += 1;
 
@@ -852,6 +855,7 @@ tgeom_deserialize(TSERIALIZED *serialized_form)
        result->srid = lw_get_int32_t(loc);
        loc += 4;
        /* bbox */
+
        if (FLAGS_GET_BBOX(flags))
        {
                result->bbox = lwalloc(sizeof(BOX3D));