From 8431bd20383237736abb9fbecfb6f24bdb34434b Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Wed, 12 Jul 2023 12:18:05 -0700 Subject: [PATCH] Do more simplification in integers --- geometry.cpp | 12 ++++----- tests/curve/out/-z2.json | 2 +- tests/curve/out/-z2_--no-clipping.json | 30 +++++++++++------------ tests/curve/out/-z2_--no-duplication.json | 6 ++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 55c24be7..5d0d5d44 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -980,7 +980,7 @@ drawvec clip_lines(drawvec &geom, long long minx, long long miny, long long maxx return out; } -static double square_distance_from_line(long long point_x, long long point_y, long long segA_x, long long segA_y, long long segB_x, long long segB_y) { +static long long square_distance_from_line(long long point_x, long long point_y, long long segA_x, long long segA_y, long long segB_x, long long segB_y) { long long p2x = segB_x - segA_x; long long p2y = segB_y - segA_y; double something = p2x * p2x + p2y * p2y; @@ -1027,7 +1027,7 @@ static void douglas_peucker(drawvec &geom, int start, int n, double e, size_t ke int first = recursion_stack.top(); recursion_stack.pop(); - double max_distance = -1; + long long max_distance = -1; int farthest_element_index; if (geom[start + first] < geom[start + second]) { farthest_element_index = second; @@ -1039,9 +1039,9 @@ static void douglas_peucker(drawvec &geom, int start, int n, double e, size_t ke int i; if (geom[start + first] < geom[start + second]) { for (i = first + 1; i < second; i++) { - double temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y, geom[start + first].x, geom[start + first].y, geom[start + second].x, geom[start + second].y); + long long temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y, geom[start + first].x, geom[start + first].y, geom[start + second].x, geom[start + second].y); - double distance = std::fabs(temp_dist); + long long distance = std::llabs(temp_dist); if ((distance > e || kept < retain) && (distance > max_distance || (distance == max_distance && geom[start + i] < geom[start + farthest_element_index]))) { farthest_element_index = i; @@ -1050,9 +1050,9 @@ static void douglas_peucker(drawvec &geom, int start, int n, double e, size_t ke } } else { for (i = second - 1; i > first; i--) { - double temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y, geom[start + first].x, geom[start + first].y, geom[start + second].x, geom[start + second].y); + long long temp_dist = square_distance_from_line(geom[start + i].x, geom[start + i].y, geom[start + first].x, geom[start + first].y, geom[start + second].x, geom[start + second].y); - double distance = std::fabs(temp_dist); + long long distance = std::llabs(temp_dist); if ((distance > e || kept < retain) && (distance > max_distance || (distance == max_distance && geom[start + i] < geom[start + farthest_element_index]))) { farthest_element_index = i; diff --git a/tests/curve/out/-z2.json b/tests/curve/out/-z2.json index 729fe6b2..c1fac176 100644 --- a/tests/curve/out/-z2.json +++ b/tests/curve/out/-z2.json @@ -17,7 +17,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -98.964844, 82.994132 ], [ -82.001953, 81.996942 ], [ -105.996094, 69.990535 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -27.949219, -72.996909 ], [ 90.000000, -73.995328 ], [ 145.019531, -73.995328 ], [ 145.019531, -76.999935 ], [ 92.988281, -79.004962 ], [ -32.958984, -76.999935 ], [ -74.970703, -66.018018 ], [ -97.031250, -37.996163 ], [ -117.949219, 25.958045 ], [ -116.982422, 70.988349 ], [ -98.964844, 82.994132 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -111.972656, -75.004940 ], [ -92.021484, -76.999935 ], [ 169.980469, -79.997168 ], [ 160.048828, -81.996942 ], [ -111.005859, -81.996942 ], [ -138.955078, -75.994839 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -118.740234, 68.236823 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } ] } ] } , diff --git a/tests/curve/out/-z2_--no-clipping.json b/tests/curve/out/-z2_--no-clipping.json index 0a37140a..8917847f 100644 --- a/tests/curve/out/-z2_--no-clipping.json +++ b/tests/curve/out/-z2_--no-clipping.json @@ -17,7 +17,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -98.964844, 82.994132 ], [ -82.001953, 81.996942 ], [ -105.996094, 69.990535 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -27.949219, -72.996909 ], [ 90.000000, -73.995328 ], [ 145.019531, -73.995328 ], [ 145.019531, -76.999935 ], [ 92.988281, -79.004962 ], [ -32.958984, -76.999935 ], [ -74.970703, -66.018018 ], [ -97.031250, -37.996163 ], [ -117.949219, 25.958045 ], [ -116.982422, 70.988349 ], [ -98.964844, 82.994132 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -111.972656, -75.004940 ], [ -92.021484, -76.999935 ], [ 169.980469, -79.997168 ], [ 160.048828, -81.996942 ], [ -111.005859, -81.996942 ], [ -138.955078, -75.994839 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -118.740234, 68.236823 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } ] } ] } , @@ -25,7 +25,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.003058 ], [ -105.996094, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -33.027088 ], [ -62.973633, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.007440 ], [ 145.019531, -74.007440 ], [ 145.019531, -76.999935 ], [ 93.032227, -79.004962 ], [ -33.002930, -76.999935 ], [ -74.970703, -66.000150 ], [ -96.987305, -37.996163 ], [ -117.993164, 25.997550 ], [ -116.982422, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 80.004799 ], [ -87.978516, 80.004799 ], [ -119.003906, 71.002660 ], [ -111.972656, -75.004940 ], [ -91.977539, -76.999935 ], [ 170.024414, -80.004799 ], [ 160.004883, -82.003058 ], [ -111.005859, -82.003058 ], [ -138.999023, -76.005470 ], [ -138.999023, 74.007440 ], [ -100.986328, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 80.004799 ], [ -87.978516, 80.004799 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.253111 ], [ -138.999023, 74.007440 ], [ -100.986328, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } ] } ] } , @@ -33,7 +33,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 81.996942 ], [ -105.996094, 69.990535 ], [ -103.007812, 31.989442 ], [ -82.001953, -33.027088 ], [ -62.973633, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.007440 ], [ 145.019531, -74.007440 ], [ 145.019531, -76.999935 ], [ 93.032227, -79.004962 ], [ -33.002930, -76.999935 ], [ -74.970703, -66.000150 ], [ -96.987305, -37.996163 ], [ -117.993164, 25.997550 ], [ -116.982422, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 71.002660 ], [ -111.972656, -75.004940 ], [ -91.977539, -76.999935 ], [ 170.024414, -80.004799 ], [ 160.004883, -82.003058 ], [ -111.005859, -82.003058 ], [ -138.999023, -76.005470 ], [ -138.999023, 73.995328 ], [ -100.986328, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.236823 ], [ -138.999023, 73.995328 ], [ -100.986328, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } ] } ] } , @@ -41,19 +41,19 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.003058 ], [ -105.996094, 70.005567 ], [ -103.007812, 32.026706 ], [ -82.001953, -33.027088 ], [ -63.017578, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.007440 ], [ 145.019531, -74.007440 ], [ 145.019531, -76.999935 ], [ 93.032227, -79.004962 ], [ -33.002930, -76.999935 ], [ -75.014648, -66.000150 ], [ -97.031250, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.026367, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 80.004799 ], [ -88.022461, 80.004799 ], [ -119.003906, 71.002660 ], [ -112.016602, -75.004940 ], [ -92.021484, -76.999935 ], [ 170.024414, -80.004799 ], [ 160.004883, -82.003058 ], [ -111.005859, -82.003058 ], [ -138.999023, -76.005470 ], [ -138.999023, 74.007440 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 80.004799 ], [ -88.022461, 80.004799 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.253111 ], [ -138.999023, 74.007440 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } ] } ] } , { "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -88.022461, 79.997168 ], [ -119.003906, 71.002660 ], [ -112.016602, -75.004940 ], [ -92.021484, -76.999935 ], [ 170.024414, -80.004799 ], [ 160.004883, -82.003058 ], [ -111.005859, -82.003058 ], [ -138.999023, -76.005470 ], [ -138.999023, 73.995328 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -88.022461, 79.997168 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.236823 ], [ -138.999023, 73.995328 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } ] } ] } , { "type": "FeatureCollection", "properties": { "zoom": 2, "x": 0, "y": 3 }, "features": [ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -61,7 +61,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -69,7 +69,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -77,7 +77,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -85,7 +85,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -99,7 +99,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -107,13 +107,13 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , { "type": "FeatureCollection", "properties": { "zoom": 2, "x": 2, "y": 0 }, "features": [ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , @@ -121,13 +121,13 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } , { "type": "FeatureCollection", "properties": { "zoom": 2, "x": 3, "y": 0 }, "features": [ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } ] } diff --git a/tests/curve/out/-z2_--no-duplication.json b/tests/curve/out/-z2_--no-duplication.json index 1db93917..b5de0b74 100644 --- a/tests/curve/out/-z2_--no-duplication.json +++ b/tests/curve/out/-z2_--no-duplication.json @@ -17,7 +17,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -98.964844, 82.994132 ], [ -82.001953, 81.996942 ], [ -105.996094, 69.990535 ], [ -103.007812, 32.026706 ], [ -82.001953, -32.990236 ], [ -63.017578, -62.995158 ], [ -27.949219, -72.996909 ], [ 90.000000, -73.995328 ], [ 145.019531, -73.995328 ], [ 145.019531, -76.999935 ], [ 92.988281, -79.004962 ], [ -32.958984, -76.999935 ], [ -74.970703, -66.018018 ], [ -97.031250, -37.996163 ], [ -117.949219, 25.958045 ], [ -116.982422, 70.988349 ], [ -98.964844, 82.994132 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -111.972656, -75.004940 ], [ -92.021484, -76.999935 ], [ 169.980469, -79.997168 ], [ 160.048828, -81.996942 ], [ -111.005859, -81.996942 ], [ -138.955078, -75.994839 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 108.984375, 82.994132 ], [ 135.000000, 79.997168 ], [ -87.978516, 79.997168 ], [ -119.003906, 70.988349 ], [ -118.740234, 68.236823 ], [ -138.955078, 73.995328 ], [ -100.986328, 82.994132 ], [ 108.984375, 82.994132 ] ] ] } } ] } ] } , @@ -25,7 +25,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 81.996942 ], [ -105.996094, 69.990535 ], [ -103.007812, 31.989442 ], [ -82.001953, -33.027088 ], [ -63.017578, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.007440 ], [ 145.019531, -74.007440 ], [ 145.019531, -76.999935 ], [ 93.032227, -79.004962 ], [ -33.002930, -76.999935 ], [ -75.014648, -66.000150 ], [ -97.031250, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.026367, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -88.022461, 79.997168 ], [ -119.003906, 71.002660 ], [ -112.016602, -75.004940 ], [ -92.021484, -76.999935 ], [ 170.024414, -80.004799 ], [ 160.004883, -82.003058 ], [ -111.005859, -82.003058 ], [ -138.999023, -76.005470 ], [ -138.999023, 73.995328 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.028320, 82.999490 ], [ 135.000000, 79.997168 ], [ -88.022461, 79.997168 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.236823 ], [ -138.999023, 73.995328 ], [ -101.030273, 82.999490 ], [ 109.028320, 82.999490 ] ] ] } } ] } ] } , @@ -33,7 +33,7 @@ { "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.008789, 82.999490 ], [ -82.001953, 82.000000 ], [ -105.996094, 69.998052 ], [ -103.007812, 32.008076 ], [ -82.001953, -33.008663 ], [ -62.995605, -62.995158 ], [ -27.993164, -72.996909 ], [ 90.000000, -74.001385 ], [ 144.997559, -74.001385 ], [ 144.997559, -76.999935 ], [ 93.010254, -79.000771 ], [ -33.002930, -76.999935 ], [ -74.992676, -66.000150 ], [ -97.009277, -37.996163 ], [ -117.993164, 25.997550 ], [ -117.004395, 71.002660 ], [ -99.008789, 82.999490 ] ] ] } } , -{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -111.994629, -74.999254 ], [ -91.999512, -76.999935 ], [ 170.002441, -80.000984 ], [ 160.004883, -82.000000 ], [ -111.005859, -82.000000 ], [ -138.999023, -76.000156 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 109.006348, 82.999490 ], [ 135.000000, 80.000984 ], [ -88.000488, 80.000984 ], [ -119.003906, 71.002660 ], [ -118.740234, 68.244968 ], [ -138.999023, 74.001385 ], [ -101.008301, 82.999490 ], [ 109.006348, 82.999490 ] ] ] } } ] } ] } ] }