mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
fix 'negation of 1 cannot be represented in type unsigned int' error - refs #227
This commit is contained in:
committed by
Eric Fischer
parent
d35ef72a99
commit
3182930f35
@@ -79,10 +79,6 @@ int compress(std::string const &input, std::string &output) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dezig(unsigned n) {
|
|
||||||
return (n >> 1) ^ (-(n & 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool mvt_tile::decode(std::string &message) {
|
bool mvt_tile::decode(std::string &message) {
|
||||||
layers.clear();
|
layers.clear();
|
||||||
std::string src;
|
std::string src;
|
||||||
@@ -214,8 +210,8 @@ bool mvt_tile::decode(std::string &message) {
|
|||||||
|
|
||||||
if (op == mvt_moveto || op == mvt_lineto) {
|
if (op == mvt_moveto || op == mvt_lineto) {
|
||||||
for (size_t k = 0; k < count && g + 2 < geoms.size(); k++) {
|
for (size_t k = 0; k < count && g + 2 < geoms.size(); k++) {
|
||||||
px += dezig(geoms[g + 1]);
|
px += protozero::decode_zigzag32(geoms[g + 1]);
|
||||||
py += dezig(geoms[g + 2]);
|
py += protozero::decode_zigzag32(geoms[g + 2]);
|
||||||
g += 2;
|
g += 2;
|
||||||
|
|
||||||
feature.geometry.push_back(mvt_geometry(op, px, py));
|
feature.geometry.push_back(mvt_geometry(op, px, py));
|
||||||
|
|||||||
Reference in New Issue
Block a user