mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Round coordinates instead of truncating them (#60)
* Round coordinates instead of truncating them * Update all the tests for coordinate rounding changes * Curses, integer division still truncates * Fix tests * Also round instead of shifting when looking for no-op linetos * Should I worry that the same change for moveto doesn't change any tests? * Also round instead of shifting when scaling down to maxzoom resolution * Replace another explicit shift, for origin point * Round instead of shift when writing clipped geometries to the next zoom * Fix low-zoom gridding and smaller-than-a-pixel checks * Don't guess an excessively large maxzoom when there is only one feature * Add a test for guessing the maxzoom of a single point * Explicitly sort by index if no other order distinguishes features * Another affected test
This commit is contained in:
@@ -13,31 +13,31 @@
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 32.958984, 70.728979 ], [ -1.054688, 18.979026 ], [ 1.669922, -16.214675 ] ], [ [ -17.226562, 60.586967 ], [ -34.101562, 17.644022 ] ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 33.046875, 70.728979 ], [ -1.054688, 18.979026 ], [ 1.757812, -16.299051 ] ], [ [ -17.226562, 60.586967 ], [ -34.101562, 17.644022 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 0.131836, 3.513421 ], [ 1.713867, -16.256867 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 0.175781, 3.513421 ], [ 1.757812, -16.299051 ] ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 3.515625, 29.075375 ], [ 0.000000, 21.371244 ], [ -1.054688, 18.979026 ], [ 0.000000, 5.703448 ], [ 0.703125, -3.513421 ] ], [ [ -17.226562, 60.586967 ], [ -34.101562, 17.644022 ] ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 3.515625, 29.036961 ], [ 0.000000, 21.371244 ], [ -1.054688, 18.979026 ], [ 0.000000, 5.878332 ], [ 0.747070, -3.513421 ] ], [ [ -17.226562, 60.586967 ], [ -34.101562, 17.644022 ] ] ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 1 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 0.131836, 3.513421 ], [ 0.439453, 0.000000 ], [ 1.713867, -16.256867 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 0.175781, 3.513421 ], [ 0.483398, 0.000000 ], [ 1.757812, -16.299051 ] ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "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": "LineString", "coordinates": [ [ 33.002930, 70.728979 ], [ 0.000000, 21.371244 ], [ -1.054688, 18.979026 ], [ 0.000000, 5.703448 ], [ 0.439453, 0.000000 ], [ 0.703125, -3.513421 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ 33.046875, 70.728979 ], [ 0.000000, 21.371244 ], [ -1.054688, 18.979026 ], [ 0.000000, 5.878332 ], [ 0.483398, 0.000000 ], [ 0.747070, -3.513421 ] ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
|
||||
Reference in New Issue
Block a user