Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue when TWKB does not paint geometries in high zoom levels (>18) #10

Merged
merged 2 commits into from
Nov 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions plugins/input/postgis/postgis_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,29 +203,25 @@ struct twkb_reader : mapnik::noncopyable
uint8_t nByte;

/* Check so we don't read beyond the twkb */
while( pos_ < size_ )
while ( pos_ < size_ )
{
nByte = twkb_[pos_];
/* Hibit is set, so this isn't the last byte */
if (nByte & 0x80)
{
/* We get here when there is more to read in the input varInt */
/* Here we take the least significant 7 bits of the read */
/* byte and put it in the most significant place in the result variable. */
nVal |= ((uint64_t)(nByte & 0x7f)) << nShift;
/* move the "cursor" of the input buffer step (8 bits) */
pos_++;
/* move the cursor in the resulting variable (7 bits) */
nShift += 7;
}
else

/* We get here when there is more to read in the input varInt */
/* Here we take the least significant 7 bits of the read */
/* byte and put it in the most significant place in the result variable. */
nVal |= ((uint64_t)(nByte & 0x7f)) << nShift;

/* move the "cursor" of the input buffer step (8 bits) */
pos_++;

/* move the cursor in the resulting variable (7 bits) */
nShift += 7;

/* Hibit isn't set, so this is the last byte */
if ( !(nByte & 0x80) )
{
/* move the "cursor" one step */
pos_++;
/* Move the last read byte to the most significant */
/* place in the result and return the whole result */
//*size = ptr - the_start;
return nVal | (uint64_t)(nByte << nShift);
return nVal;
}
}

Expand Down