mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-24 04:55:55 +00:00
Read and write spline knots, but don't try to interpret them yet
This commit is contained in:
parent
b64cc84bef
commit
0a339b6680
10
mvt.cpp
10
mvt.cpp
@ -399,6 +399,15 @@ bool mvt_tile::decode(std::string &message, bool &was_compressed) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 11: /* knots */
|
||||
{
|
||||
auto pi = feature_reader.get_packed_double();
|
||||
for (auto it = pi.first; it != pi.second; ++it) {
|
||||
feature.knots.push_back(*it);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
feature_reader.skip();
|
||||
break;
|
||||
@ -707,6 +716,7 @@ std::string mvt_tile::encode() {
|
||||
|
||||
feature_writer.add_packed_uint32(4, std::begin(geometry), std::end(geometry));
|
||||
feature_writer.add_packed_uint64(6, std::begin(elevations), std::end(elevations));
|
||||
feature_writer.add_packed_double(11, std::begin(layers[i].features[f].knots), std::end(layers[i].features[f].knots));
|
||||
|
||||
if (has_attributes > 0) {
|
||||
std::vector<unsigned long> attributes;
|
||||
|
4
mvt.hpp
4
mvt.hpp
@ -53,13 +53,15 @@ struct mvt_geometry {
|
||||
enum mvt_geometry_type {
|
||||
mvt_point = 1,
|
||||
mvt_linestring = 2,
|
||||
mvt_polygon = 3
|
||||
mvt_polygon = 3,
|
||||
mvt_curve = 4,
|
||||
};
|
||||
|
||||
struct mvt_feature {
|
||||
std::vector<unsigned> tags{};
|
||||
std::vector<unsigned long> properties{};
|
||||
std::vector<mvt_geometry> geometry{};
|
||||
std::vector<double> knots{};
|
||||
int /* mvt_geometry_type */ type = 0;
|
||||
unsigned long long id = 0;
|
||||
bool has_id = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user