mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-23 18:13:42 +00:00
Move in the direction of supporting lists and hashes again
This commit is contained in:
parent
f31024d97e
commit
881402112e
13
mvt.cpp
13
mvt.cpp
@ -693,7 +693,7 @@ void mvt_layer::tag(mvt_feature &feature, std::string key, mvt_value value) {
|
||||
}
|
||||
}
|
||||
|
||||
void mvt_layer::tag_v3(mvt_feature &feature, std::string key, mvt_value value) {
|
||||
size_t mvt_layer::tag_v3_key(std::string key) {
|
||||
std::map<std::string, size_t>::iterator ki = key_map.find(key);
|
||||
size_t ko;
|
||||
|
||||
@ -705,6 +705,10 @@ void mvt_layer::tag_v3(mvt_feature &feature, std::string key, mvt_value value) {
|
||||
ko = ki->second;
|
||||
}
|
||||
|
||||
return ko;
|
||||
}
|
||||
|
||||
size_t mvt_layer::tag_v3_value(mvt_value value) {
|
||||
std::map<mvt_value, unsigned long>::iterator vi = property_map.find(value);
|
||||
unsigned long vo;
|
||||
|
||||
@ -761,6 +765,13 @@ void mvt_layer::tag_v3(mvt_feature &feature, std::string key, mvt_value value) {
|
||||
vo = vi->second;
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
void mvt_layer::tag_v3(mvt_feature &feature, std::string key, mvt_value value) {
|
||||
size_t ko = tag_v3_key(key);
|
||||
size_t vo = tag_v3_value(value);
|
||||
|
||||
feature.properties.push_back(ko);
|
||||
feature.properties.push_back(vo);
|
||||
}
|
||||
|
2
mvt.hpp
2
mvt.hpp
@ -121,6 +121,8 @@ struct mvt_layer {
|
||||
void tag_v3(mvt_feature &feature, std::string key, mvt_value value);
|
||||
size_t tag_value(mvt_value const &value);
|
||||
size_t tag_key(std::string const &key);
|
||||
size_t tag_v3_key(std::string key);
|
||||
size_t tag_v3_value(mvt_value value);
|
||||
|
||||
// For tracking the key-value constants already used in this layer
|
||||
std::map<std::string, size_t> key_map{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user