mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-06-06 01:21:36 +00:00
Only movetos and linetos have elevations, not closepaths
This commit is contained in:
parent
6315009cc1
commit
c3d06f8931
20
mvt.cpp
20
mvt.cpp
@ -468,18 +468,20 @@ bool mvt_tile::decode(std::string &message, bool &was_compressed) {
|
|||||||
std::vector<long> &elevations = layer.features[i].elevations;
|
std::vector<long> &elevations = layer.features[i].elevations;
|
||||||
if (elevations.size() != 0) {
|
if (elevations.size() != 0) {
|
||||||
for (size_t j = 0; j < geom.size(); j++) {
|
for (size_t j = 0; j < geom.size(); j++) {
|
||||||
if (off < elevations.size()) {
|
if (geom[j].op == mvt_moveto || geom[j].op == mvt_lineto) {
|
||||||
double el;
|
if (off < elevations.size()) {
|
||||||
|
double el;
|
||||||
|
|
||||||
current_elevation += elevations[off];
|
current_elevation += elevations[off];
|
||||||
el = elevation_scaling.base + elevation_scaling.multiplier * current_elevation;
|
el = elevation_scaling.base + elevation_scaling.multiplier * current_elevation;
|
||||||
|
|
||||||
geom[j].elevations.push_back(el);
|
geom[j].elevations.push_back(el);
|
||||||
|
|
||||||
off++;
|
off++;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Ran out of elevations\n");
|
fprintf(stderr, "Ran out of elevations\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user