mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-29 15:06:01 +00:00
Support feature IDs for decoding
This commit is contained in:
parent
a1f8564631
commit
2bc1b9bd91
@ -102,6 +102,11 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
within = 1;
|
||||
|
||||
printf("{ \"type\": \"Feature\"");
|
||||
|
||||
if (feat.has_id) {
|
||||
printf(", \"id\": %llu", feat.id);
|
||||
}
|
||||
|
||||
printf(", \"properties\": { ");
|
||||
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
|
5
mvt.cpp
5
mvt.cpp
@ -178,6 +178,11 @@ bool mvt_tile::decode(std::string &message) {
|
||||
|
||||
while (feature_reader.next()) {
|
||||
switch (feature_reader.tag()) {
|
||||
case 1: /* id */
|
||||
feature.id = feature_reader.get_uint64();
|
||||
feature.has_id = true;
|
||||
break;
|
||||
|
||||
case 2: /* tag */
|
||||
{
|
||||
auto pi = feature_reader.get_packed_uint32();
|
||||
|
Loading…
x
Reference in New Issue
Block a user