]> granicus.if.org Git - postgis/commitdiff
This should repair the build but the emty geometry twkb is still corrupt
authorNicklas Avén <nicklas.aven@jordogskog.no>
Tue, 30 Sep 2014 04:16:10 +0000 (04:16 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Tue, 30 Sep 2014 04:16:10 +0000 (04:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13009 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_twkb.c

index 86ef8cd31539c7d2364e6098eaa6d4496ea95915..998335c2c34810c3dd06ae002441a4de8a8334ba 100644 (file)
@@ -107,7 +107,7 @@ static int uint8_to_twkb_buf(const uint8_t ival, uint8_t **buf)
 static size_t empty_to_twkb_size(const LWGEOM *geom, uint8_t variant, int64_t id) 
 {
        LWDEBUGF(2, "Entered  empty_to_twkb_size",0);
-       size_t size=0;
+       size_t size = WKB_BYTE_SIZE + WKB_BYTE_SIZE;
        /*size of ID*/
        size += varint_s64_encoded_size((int64_t) id);
        /*size of npoints*/
@@ -128,6 +128,11 @@ static int empty_to_twkb_buf(const LWGEOM *geom, uint8_t **buf, uint8_t variant,
        }
        uint8_t flag=0;
        
+               /* Set the id flag */
+       FIRST_BYTE_SET_ID(flag, ((variant & TWKB_ID) ? 1 : 0));
+       /* Tell what precision to use*/
+       FIRST_BYTE_SET_PRECISION(flag,0);
+       
        /*Copy the flag to the buffer*/
        uint8_to_twkb_buf(flag,buf);