Read and write spline knots, but don't try to interpret them yet

This commit is contained in:
Eric Fischer 2018-09-17 16:57:08 -07:00
parent b64cc84bef
commit 0a339b6680
2 changed files with 13 additions and 1 deletions

10
mvt.cpp
View File

@ -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;

View File

@ -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;