mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-01 16:58:05 +00:00
Don't add extra points at tile boundaries if not clipping
The extra points kept the features from being exactly the same in each tile.
This commit is contained in:
parent
56d8178a7c
commit
41099ed731
@ -800,7 +800,7 @@ drawvec impose_tile_boundaries(drawvec &geom, long long extent) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawvec simplify_lines(drawvec &geom, int z, int detail) {
|
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds) {
|
||||||
int res = 1 << (32 - detail - z);
|
int res = 1 << (32 - detail - z);
|
||||||
long long area = 0xFFFFFFFF;
|
long long area = 0xFFFFFFFF;
|
||||||
if (z != 0) {
|
if (z != 0) {
|
||||||
@ -817,7 +817,9 @@ drawvec simplify_lines(drawvec &geom, int z, int detail) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mark_tile_bounds) {
|
||||||
geom = impose_tile_boundaries(geom, area);
|
geom = impose_tile_boundaries(geom, area);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < geom.size(); i++) {
|
for (size_t i = 0; i < geom.size(); i++) {
|
||||||
if (geom[i].op == VT_MOVETO) {
|
if (geom[i].op == VT_MOVETO) {
|
||||||
|
@ -26,7 +26,7 @@ drawvec close_poly(drawvec &geom);
|
|||||||
drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double *accum_area);
|
drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double *accum_area);
|
||||||
drawvec clip_lines(drawvec &geom, int z, int detail, long long buffer);
|
drawvec clip_lines(drawvec &geom, int z, int detail, long long buffer);
|
||||||
int quick_check(long long *bbox, int z, int detail, long long buffer);
|
int quick_check(long long *bbox, int z, int detail, long long buffer);
|
||||||
drawvec simplify_lines(drawvec &geom, int z, int detail);
|
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds);
|
||||||
drawvec reorder_lines(drawvec &geom);
|
drawvec reorder_lines(drawvec &geom);
|
||||||
drawvec fix_polygon(drawvec &geom);
|
drawvec fix_polygon(drawvec &geom);
|
||||||
std::vector<drawvec> chop_polygon(std::vector<drawvec> &geoms);
|
std::vector<drawvec> chop_polygon(std::vector<drawvec> &geoms);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"bounds": "-118.000000,-79.000000,145.000000,83.000000",
|
"bounds": "-118.000000,-79.000000,145.000000,83.000000",
|
||||||
"center": "-90.000000,-42.525564,1",
|
"center": "-90.000000,42.525564,1",
|
||||||
"description": "tests/curve/out/-z1_--no-clipping.json.check.mbtiles",
|
"description": "tests/curve/out/-z1_--no-clipping.json.check.mbtiles",
|
||||||
"format": "pbf",
|
"format": "pbf",
|
||||||
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 1, \"fields\": {} } ] }",
|
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 1, \"fields\": {} } ] }",
|
||||||
@ -18,19 +18,19 @@
|
|||||||
,
|
,
|
||||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
||||||
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
||||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -92.680664, 0.000000 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 0.000000, -73.239377 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ 0.000000, -77.551572 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -109.731445, 0.000000 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
||||||
] }
|
] }
|
||||||
] }
|
] }
|
||||||
,
|
,
|
||||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
||||||
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
||||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -92.680664, 0.000000 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -109.731445, 0.000000 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
||||||
] }
|
] }
|
||||||
] }
|
] }
|
||||||
,
|
,
|
||||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
||||||
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
{ "type": "FeatureCollection", "properties": { "layer": "in" }, "features": [
|
||||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 0.000000, -73.239377 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ 0.000000, -77.551572 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -82.001953, 82.003058 ], [ -106.040039, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -28.037109, -72.996909 ], [ 90.000000, -73.995328 ], [ 144.975586, -73.995328 ], [ 144.975586, -76.999935 ], [ 92.988281, -78.996578 ], [ -33.002930, -76.999935 ], [ -75.014648, -65.982270 ], [ -97.031250, -37.996163 ], [ -118.037109, 26.037042 ], [ -117.026367, 71.002660 ], [ -99.008789, 83.004844 ], [ -82.001953, 82.003058 ] ] ] } }
|
||||||
] }
|
] }
|
||||||
] }
|
] }
|
||||||
] }
|
] }
|
||||||
|
File diff suppressed because one or more lines are too long
4
tile.cc
4
tile.cc
@ -510,7 +510,7 @@ void *partial_feature_worker(void *v) {
|
|||||||
geom = remove_noop(geom, t, 32 - z - line_detail);
|
geom = remove_noop(geom, t, 32 - z - line_detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
geom = simplify_lines(geom, z, line_detail);
|
geom = simplify_lines(geom, z, line_detail, !prevent[P_CLIPPING]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,7 +965,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
|
|||||||
for (size_t x = 0; x < features[j].size(); x++) {
|
for (size_t x = 0; x < features[j].size(); x++) {
|
||||||
if (features[j][x].coalesced && features[j][x].type == VT_LINE) {
|
if (features[j][x].coalesced && features[j][x].type == VT_LINE) {
|
||||||
features[j][x].geom = remove_noop(features[j][x].geom, features[j][x].type, 0);
|
features[j][x].geom = remove_noop(features[j][x].geom, features[j][x].type, 0);
|
||||||
features[j][x].geom = simplify_lines(features[j][x].geom, 32, 0);
|
features[j][x].geom = simplify_lines(features[j][x].geom, 32, 0, !prevent[P_CLIPPING]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features[j][x].type == VT_POLYGON) {
|
if (features[j][x].type == VT_POLYGON) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user