mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 10:30:16 +00:00
Merge pull request #176 from mapbox/decode-limit
Increase maximum tile size for decoding
This commit is contained in:
commit
3c85d3243a
@ -1,3 +1,7 @@
|
||||
## 1.9.2
|
||||
|
||||
* Increase maximum tile size for tippecanoe-decode
|
||||
|
||||
## 1.9.1
|
||||
|
||||
* Incorporate Mapnik's Clipper upgrades for consistent results between Mac and Linux
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include <string>
|
||||
#include <zlib.h>
|
||||
#include <math.h>
|
||||
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
|
||||
#include <google/protobuf/io/coded_stream.h>
|
||||
#include "vector_tile.pb.h"
|
||||
#include "tile.h"
|
||||
|
||||
@ -88,7 +90,10 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
if (is_compressed(message)) {
|
||||
std::string uncompressed;
|
||||
decompress(message, uncompressed);
|
||||
if (!tile.ParseFromString(uncompressed)) {
|
||||
google::protobuf::io::ArrayInputStream stream(uncompressed.c_str(), uncompressed.length());
|
||||
google::protobuf::io::CodedInputStream codedstream(&stream);
|
||||
codedstream.SetTotalBytesLimit(10 * 67108864, 5 * 67108864);
|
||||
if (!tile.ParseFromCodedStream(&codedstream)) {
|
||||
fprintf(stderr, "Couldn't decompress tile %d/%u/%u\n", z, x, y);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user