mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-13 13:53:11 +00:00
Pass a node ID around as part of the serial feature representation
This commit is contained in:
parent
ca91cec923
commit
d684d94f55
@ -46,9 +46,11 @@ drawvec decode_geometry(FILE *meta, long long *geompos, int z, unsigned tx, unsi
|
||||
|
||||
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
|
||||
long long dx, dy;
|
||||
long long id;
|
||||
|
||||
deserialize_long_long_io(meta, &dx, geompos);
|
||||
deserialize_long_long_io(meta, &dy, geompos);
|
||||
deserialize_long_long_io(meta, &id, geompos);
|
||||
|
||||
wx += dx * (1 << geometry_scale);
|
||||
wy += dy * (1 << geometry_scale);
|
||||
@ -76,6 +78,7 @@ drawvec decode_geometry(FILE *meta, long long *geompos, int z, unsigned tx, unsi
|
||||
|
||||
d.x = wwx;
|
||||
d.y = wwy;
|
||||
d.id = id;
|
||||
}
|
||||
|
||||
out.push_back(d);
|
||||
|
@ -21,12 +21,14 @@ struct draw {
|
||||
signed char op;
|
||||
long long y : 40;
|
||||
signed char necessary;
|
||||
long id;
|
||||
|
||||
draw(int nop, long long nx, long long ny)
|
||||
: x(nx),
|
||||
op(nop),
|
||||
y(ny),
|
||||
necessary(0) {
|
||||
necessary(0),
|
||||
id(0) {
|
||||
}
|
||||
|
||||
draw()
|
||||
|
@ -174,6 +174,7 @@ static void write_geometry(drawvec const &dv, long long *fpos, FILE *out, const
|
||||
serialize_byte(out, dv[i].op, fpos, fname);
|
||||
serialize_long_long(out, dv[i].x - wx, fpos, fname);
|
||||
serialize_long_long(out, dv[i].y - wy, fpos, fname);
|
||||
serialize_long_long(out, dv[i].id, fpos, fname);
|
||||
wx = dv[i].x;
|
||||
wy = dv[i].y;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user