Always keep the first feature so there is something to coalesce onto

This commit is contained in:
Eric Fischer 2018-02-22 17:25:54 -08:00
parent bc0edec753
commit 30a277a43e
11 changed files with 3273 additions and 886 deletions

View File

@ -12,7 +12,7 @@
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 326, "y": 791 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "FIELD RD/Nike Site" }, "geometry": { "type": "Point", "coordinates": [ -122.527685, 37.829074 ] } }
{ "type": "Feature", "properties": { "name": "Fort Cronkhite Parking Lot" }, "geometry": { "type": "Point", "coordinates": [ -122.538671, 37.832395 ] } }
,
{ "type": "Feature", "properties": { "name": "Field Rd & Bunker Rd" }, "geometry": { "type": "Point", "coordinates": [ -122.523265, 37.831345 ] } }
] }
@ -20,7 +20,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 327, "y": 792 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Arballo Dr & Acevedo Ave ." }, "geometry": { "type": "Point", "coordinates": [ -122.483139, 37.719914 ] } }
{ "type": "Feature", "properties": { "name": "John Muir Dr & Skyline Blvd" }, "geometry": { "type": "Point", "coordinates": [ -122.500048, 37.718998 ] } }
,
{ "type": "Feature", "properties": { "name": "19th Avenue & Holloway St" }, "geometry": { "type": "Point", "coordinates": [ -122.475114, 37.721204 ] } }
,
@ -162,7 +162,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 327, "y": 791 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": " Conzelman Rd & Mccullough Rd" }, "geometry": { "type": "Point", "coordinates": [ -122.493825, 37.833717 ] } }
{ "type": "Feature", "properties": { "name": "BUNKER RD/Stables" }, "geometry": { "type": "Point", "coordinates": [ -122.515411, 37.831751 ] } }
,
{ "type": "Feature", "properties": { "name": "Conzelman Rd/GGNRA entrance sign" }, "geometry": { "type": "Point", "coordinates": [ -122.483568, 37.833107 ] } }
,
@ -1364,7 +1364,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 653, "y": 1582 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Mitchell Rd & Bunker Rd" }, "geometry": { "type": "Point", "coordinates": [ -122.532384, 37.831836 ] } }
{ "type": "Feature", "properties": { "name": "Fort Cronkhite Parking Lot" }, "geometry": { "type": "Point", "coordinates": [ -122.538671, 37.832395 ] } }
,
{ "type": "Feature", "properties": { "name": "BUNKER RD/Miwok Trail" }, "geometry": { "type": "Point", "coordinates": [ -122.527256, 37.832599 ] } }
,
@ -1378,7 +1378,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 654, "y": 1584 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Arballo Dr & Acevedo Ave ." }, "geometry": { "type": "Point", "coordinates": [ -122.483139, 37.719897 ] } }
{ "type": "Feature", "properties": { "name": "John Muir Dr & Skyline Blvd" }, "geometry": { "type": "Point", "coordinates": [ -122.500048, 37.718998 ] } }
,
{ "type": "Feature", "properties": { "name": "Font Blvd & Serrano Dr NS/W-SB" }, "geometry": { "type": "Point", "coordinates": [ -122.479920, 37.719609 ] } }
,
@ -1548,7 +1548,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 654, "y": 1583 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Divisadero St & California St" }, "geometry": { "type": "Point", "coordinates": [ -122.440395, 37.788200 ] } }
{ "type": "Feature", "properties": { "name": "Presidio Ave & Clay St" }, "geometry": { "type": "Point", "coordinates": [ -122.447262, 37.789184 ] } }
,
{ "type": "Feature", "properties": { "name": "Steiner St & California St" }, "geometry": { "type": "Point", "coordinates": [ -122.435589, 37.788844 ] } }
,
@ -2884,7 +2884,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 654, "y": 1582 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "BUNKER RD/Rifle Range" }, "geometry": { "type": "Point", "coordinates": [ -122.508824, 37.833022 ] } }
{ "type": "Feature", "properties": { "name": "BUNKER RD/Stables" }, "geometry": { "type": "Point", "coordinates": [ -122.515390, 37.831751 ] } }
,
{ "type": "Feature", "properties": { "name": "Mccullough Rd & Bunker Rd" }, "geometry": { "type": "Point", "coordinates": [ -122.502429, 37.836124 ] } }
,
@ -3064,7 +3064,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 655, "y": 1584 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Prague St & Persia Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.427199, 37.719032 ] } }
{ "type": "Feature", "properties": { "name": "Naples St & Russia Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.432413, 37.719201 ] } }
,
{ "type": "Feature", "properties": { "name": "Persia Ave & Prague St" }, "geometry": { "type": "Point", "coordinates": [ -122.427070, 37.718964 ] } }
,
@ -3218,7 +3218,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 655, "y": 1583 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Fillmore St & Sutter St" }, "geometry": { "type": "Point", "coordinates": [ -122.433271, 37.785826 ] } }
{ "type": "Feature", "properties": { "name": "Sutter St & Fillmore St" }, "geometry": { "type": "Point", "coordinates": [ -122.433164, 37.786165 ] } }
,
{ "type": "Feature", "properties": { "name": "Fillmore St & Geary Blvd" }, "geometry": { "type": "Point", "coordinates": [ -122.432928, 37.784741 ] } }
,
@ -4382,7 +4382,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 655, "y": 1582 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Chestnut St & Buchanan St" }, "geometry": { "type": "Point", "coordinates": [ -122.433078, 37.801172 ] } }
{ "type": "Feature", "properties": { "name": "Marina Blvd & Laguna St" }, "geometry": { "type": "Point", "coordinates": [ -122.432220, 37.805139 ] } }
,
{ "type": "Feature", "properties": { "name": "Union St & Buchanan St" }, "geometry": { "type": "Point", "coordinates": [ -122.432113, 37.797594 ] } }
,

View File

@ -186,7 +186,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 11, "x": 327, "y": 791 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": " Conzelman Rd & Mccullough Rd" }, "geometry": { "type": "Point", "coordinates": [ -122.493825, 37.833717 ] } }
{ "type": "Feature", "properties": { "name": "BUNKER RD/Stables" }, "geometry": { "type": "Point", "coordinates": [ -122.515411, 37.831751 ] } }
,
{ "type": "Feature", "properties": { "name": "Conzelman Rd/GGNRA entrance sign" }, "geometry": { "type": "Point", "coordinates": [ -122.483568, 37.833107 ] } }
,
@ -1600,7 +1600,7 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 12, "x": 654, "y": 1583 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "muni", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "name": "Divisadero St & California St" }, "geometry": { "type": "Point", "coordinates": [ -122.440395, 37.788200 ] } }
{ "type": "Feature", "properties": { "name": "Presidio Ave & Clay St" }, "geometry": { "type": "Point", "coordinates": [ -122.447262, 37.789184 ] } }
,
{ "type": "Feature", "properties": { "name": "Steiner St & California St" }, "geometry": { "type": "Point", "coordinates": [ -122.435589, 37.788844 ] } }
,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -110,12 +110,16 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 2, "x": 1, "y": 1 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -91.230469, 43.516689 ], [ -91.296387, 43.945372 ], [ -91.647949, 44.087585 ], [ -91.757812, 44.182204 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -77.739258, 39.334297 ], [ -77.849121, 39.147103 ], [ -78.354492, 39.419221 ], [ -78.442383, 39.147103 ], [ -78.903809, 38.788345 ], [ -78.969727, 38.822591 ], [ -79.233398, 38.479395 ], [ -79.387207, 38.427774 ], [ -79.650879, 38.582526 ], [ -79.760742, 38.358888 ], [ -79.936523, 38.186387 ], [ -79.980469, 38.048091 ], [ -80.178223, 37.909534 ], [ -80.310059, 37.735969 ], [ -80.310059, 37.527154 ], [ -80.463867, 37.457418 ], [ -80.617676, 37.457418 ], [ -80.727539, 37.387617 ], [ -80.837402, 37.422526 ], [ -80.859375, 37.335224 ], [ -81.232910, 37.247821 ], [ -81.364746, 37.317752 ], [ -81.672363, 37.195331 ], [ -81.936035, 37.370157 ], [ -81.979980, 37.544577 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 1, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -111.060791, 41.640078 ], [ -111.060791, 41.029643 ], [ -109.061279, 41.004775 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -120.003662, 41.640078 ], [ -120.003662, 40.979898 ], [ -120.003662, 39.002110 ], [ -114.642334, 35.056980 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -114.038086, 37.002553 ], [ -114.038086, 40.979898 ], [ -114.038086, 41.640078 ] ] } }
@ -168,6 +172,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 2, "y": 3 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.373535, 41.640078 ], [ -90.472412, 41.541478 ], [ -90.692139, 41.483891 ], [ -90.878906, 41.459195 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.878906, 39.334297 ], [ -90.758057, 39.266284 ], [ -90.670166, 39.078908 ], [ -90.659180, 38.908133 ], [ -90.538330, 38.873929 ], [ -90.351562, 38.933776 ], [ -90.164795, 38.771216 ], [ -90.219727, 38.591114 ], [ -90.307617, 38.444985 ], [ -90.373535, 38.264063 ], [ -90.230713, 38.117272 ], [ -90.032959, 37.978845 ], [ -90.000000, 37.978845 ], [ -89.923096, 37.970185 ], [ -89.659424, 37.753344 ], [ -89.560547, 37.727280 ], [ -89.483643, 37.483577 ], [ -89.516602, 37.335224 ], [ -89.395752, 37.081476 ], [ -89.285889, 37.107765 ], [ -89.110107, 36.958671 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.878906, 36.509636 ], [ -90.120850, 36.465472 ], [ -90.032959, 36.341678 ], [ -90.263672, 36.129002 ], [ -90.318604, 36.031332 ], [ -90.000000, 36.031332 ], [ -89.670410, 36.031332 ] ] } }
@ -176,8 +182,6 @@
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -74.685059, 41.360319 ], [ -75.014648, 41.500350 ], [ -75.080566, 41.640078 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -87.528076, 41.640078 ], [ -87.528076, 40.979898 ], [ -87.539062, 39.393755 ], [ -87.648926, 39.121537 ], [ -87.561035, 39.044786 ], [ -87.517090, 38.873929 ], [ -87.517090, 38.736946 ], [ -87.604980, 38.676933 ], [ -87.681885, 38.513788 ], [ -87.879639, 38.298559 ], [ -88.022461, 38.022131 ], [ -88.055420, 37.822802 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -88.176270, 35.003003 ], [ -88.099365, 34.813803 ], [ -88.275146, 33.513919 ], [ -88.450928, 31.914868 ], [ -88.417969, 30.391830 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -83.682861, 36.606709 ], [ -84.353027, 36.571424 ], [ -85.231934, 36.615528 ], [ -85.528564, 36.597889 ], [ -86.099854, 36.633162 ], [ -86.682129, 36.641978 ], [ -87.220459, 36.641978 ], [ -87.846680, 36.615528 ], [ -87.879639, 36.659606 ], [ -88.077393, 36.659606 ], [ -88.077393, 36.500805 ], [ -89.505615, 36.509636 ] ] } }
@ -192,9 +196,9 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 3, "x": 2, "y": 2 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -74.685059, 41.360319 ], [ -75.014648, 41.500350 ], [ -75.080566, 41.648288 ], [ -75.058594, 41.754922 ], [ -75.388184, 42.000325 ], [ -79.760742, 42.000325 ], [ -79.760742, 42.244785 ] ] } }
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.878906, 42.706660 ], [ -90.747070, 42.666281 ], [ -90.648193, 42.512602 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -87.528076, 41.713930 ], [ -87.528076, 40.979898 ], [ -87.539062, 40.313043 ] ] } }
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -74.685059, 41.360319 ], [ -75.014648, 41.500350 ], [ -75.080566, 41.648288 ], [ -75.058594, 41.754922 ], [ -75.388184, 42.000325 ], [ -79.760742, 42.000325 ], [ -79.760742, 42.244785 ] ] } }
] }
] }
,
@ -222,6 +226,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 3, "y": 6 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -111.055298, 41.310824 ], [ -111.055298, 41.029643 ], [ -109.055786, 41.004775 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -109.050293, 37.002553 ], [ -109.044800, 31.344254 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -103.007812, 36.998166 ], [ -109.050293, 37.002553 ] ] } }
@ -278,6 +284,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 4, "x": 4, "y": 5 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.439453, 42.322001 ], [ -90.417480, 42.273244 ], [ -90.263672, 42.191899 ], [ -90.159302, 42.106374 ], [ -90.214233, 41.836828 ], [ -90.439453, 41.566142 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -74.679565, 41.356196 ], [ -75.014648, 41.496235 ], [ -75.080566, 41.644183 ], [ -75.053101, 41.754922 ], [ -75.388184, 42.000325 ], [ -79.760742, 42.000325 ], [ -79.760742, 42.240719 ] ] } }
] }
] }
@ -312,6 +320,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 5, "y": 10 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -117.031860, 48.777913 ], [ -117.031860, 48.922499 ], [ -117.031860, 49.000042 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -116.032104, 48.777913 ], [ -116.043091, 48.922499 ], [ -116.048584, 49.001844 ] ] } }
] }
] }
@ -326,6 +336,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 6, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -111.055298, 41.145570 ], [ -111.055298, 41.029643 ], [ -109.055786, 41.002703 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -109.047546, 37.000359 ], [ -109.055786, 40.979898 ], [ -109.055786, 41.002703 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -109.047546, 37.000359 ], [ -109.047546, 31.952162 ], [ -109.047546, 31.765537 ] ] } }
@ -356,14 +368,24 @@
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 6, "y": 10 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -104.095459, 48.777913 ], [ -104.095459, 48.922499 ], [ -104.095459, 49.007249 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 7, "y": 13 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -94.012756, 32.138409 ], [ -94.001770, 31.952162 ], [ -93.999023, 31.942840 ], [ -93.836975, 31.830899 ], [ -93.694153, 31.445067 ], [ -93.578796, 31.217499 ], [ -93.490906, 31.081165 ], [ -93.587036, 30.715865 ], [ -93.650208, 30.607186 ], [ -93.738098, 30.368136 ], [ -93.666687, 30.301761 ], [ -93.669434, 30.102366 ], [ -93.817749, 29.969212 ], [ -93.919373, 29.823966 ], [ -93.836975, 29.690439 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -91.101379, 32.138409 ], [ -91.128845, 32.017392 ], [ -91.211243, 31.952162 ], [ -91.323853, 31.861230 ], [ -91.411743, 31.651043 ], [ -91.502380, 31.409912 ], [ -91.625977, 31.297328 ], [ -91.584778, 31.048228 ], [ -90.703125, 31.017633 ], [ -90.000000, 31.017633 ], [ -89.780273, 31.017633 ] ], [ [ -89.780273, 30.899868 ], [ -89.788513, 30.848005 ], [ -89.854431, 30.685164 ], [ -89.791260, 30.557531 ], [ -89.780273, 30.548070 ] ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 7, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -95.798035, 40.584757 ], [ -95.863953, 40.765982 ], [ -95.836487, 40.944639 ], [ -95.841980, 40.979898 ], [ -95.858459, 41.116607 ], [ -95.869446, 41.145570 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -95.325623, 40.002372 ], [ -101.250000, 40.002372 ], [ -101.469727, 40.002372 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -94.625244, 37.000359 ], [ -101.250000, 36.993778 ], [ -101.469727, 36.993778 ] ] } }
@ -390,6 +412,12 @@
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 7, "y": 10 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -97.135620, 48.777913 ], [ -97.215271, 48.902643 ], [ -97.218018, 48.922499 ], [ -97.229004, 49.001844 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 8, "y": 13 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.219727, 31.017633 ], [ -90.000000, 31.017633 ], [ -89.761047, 31.015279 ], [ -89.788513, 30.848005 ], [ -89.854431, 30.685164 ], [ -89.791260, 30.557531 ], [ -89.659424, 30.441570 ], [ -89.623718, 30.275672 ], [ -89.607239, 30.178373 ] ] } }
@ -420,6 +448,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 8, "y": 11 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -90.219727, 42.157296 ], [ -90.159302, 42.104336 ], [ -90.211487, 41.836828 ], [ -90.219727, 41.828642 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -78.530273, 42.000325 ], [ -78.750000, 42.000325 ], [ -79.760742, 42.000325 ], [ -79.760742, 42.238685 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -87.522583, 41.709829 ], [ -87.528076, 41.709829 ], [ -87.528076, 40.979898 ], [ -87.528076, 40.813809 ] ] } }
@ -428,6 +458,8 @@
,
{ "type": "FeatureCollection", "properties": { "zoom": 5, "x": 9, "y": 12 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -73.913269, 40.961234 ], [ -73.951721, 40.979898 ], [ -74.273071, 41.145570 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -77.725525, 39.323675 ], [ -77.835388, 39.136452 ], [ -78.346252, 39.406489 ], [ -78.425903, 39.140712 ], [ -78.549500, 39.040520 ], [ -78.750000, 38.908133 ], [ -78.892822, 38.781922 ], [ -78.966980, 38.822591 ], [ -78.969727, 38.820451 ] ] } }
,
{ "type": "Feature", "properties": { "scalerank": 2, "featurecla": "Admin-1 boundary", "adm0_a3": "USA", "adm0_name": "United States of America", "mapcolor9": 1, "mapcolor13": 1 }, "geometry": { "type": "LineString", "coordinates": [ [ -78.969727, 34.216345 ], [ -78.750000, 34.029900 ], [ -78.554993, 33.863574 ] ] } }

111
tile.cpp
View File

@ -342,6 +342,7 @@ struct partial {
unsigned long long id = 0;
bool has_id = 0;
ssize_t renamed = 0;
long long extent = 0;
};
struct partial_arg {
@ -396,7 +397,14 @@ void *partial_feature_worker(void *v) {
std::vector<struct partial> *partials = a->partials;
for (size_t i = a->task; i < (*partials).size(); i += a->tasks) {
drawvec geom = (*partials)[i].geoms[0]; // XXX assumption of a single geometry at the beginning
drawvec geom;
for (size_t j = 0; j < (*partials)[i].geoms.size(); j++) {
for (size_t k = 0; k < (*partials)[i].geoms[j].size(); k++) {
geom.push_back((*partials)[i].geoms[j][k]);
}
}
(*partials)[i].geoms.clear(); // avoid keeping two copies in memory
signed char t = (*partials)[i].t;
int z = (*partials)[i].z;
@ -1414,6 +1422,10 @@ void add_tilestats(std::string const &layername, int z, std::vector<std::map<std
add_to_file_keys(fk->second.file_keys, key, attrib);
}
void preserve_attribute(std::map<std::string, int> const *attribute_accum, std::map<std::string, serial_val> &attribute_accum_state, serial_feature &sf, char *stringpool, std::string &key, serial_val &val) {
}
void preserve_attributes(std::map<std::string, int> const *attribute_accum, std::map<std::string, serial_val> &attribute_accum_state, serial_feature &sf, char *stringpool) {
for (size_t i = 0; i < sf.m; i++) {
std::string key = stringpool + sf.keys[i] + 1;
@ -1423,7 +1435,7 @@ void preserve_attributes(std::map<std::string, int> const *attribute_accum, std:
sv.s = stringpool + sf.values[i] + 1;
if (attribute_accum->count(key) != 0) {
printf("%s %s\n", key.c_str(), sv.s.c_str());
preserve_attribute(attribute_accum, attribute_accum_state, sf, stringpool, key, sv);
}
}
for (size_t i = 0; i < sf.full_keys.size(); i++) {
@ -1431,11 +1443,22 @@ void preserve_attributes(std::map<std::string, int> const *attribute_accum, std:
serial_val sv = sf.full_values[i];
if (attribute_accum->count(key) != 0) {
printf("%s %s\n", key.c_str(), sv.s.c_str());
preserve_attribute(attribute_accum, attribute_accum_state, sf, stringpool, key, sv);
}
}
}
bool find_partial(std::vector<partial> &partials, serial_feature &sf, ssize_t &out) {
for (ssize_t i = partials.size() - 1; i >= 0; i--) {
if (partials[i].t == sf.t) {
out = i;
return true;
}
}
return false;
}
long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *stringpool, int z, unsigned tx, unsigned ty, int detail, int min_detail, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, FILE **geomfile, int minzoom, int maxzoom, double todo, volatile long long *along, long long alongminus, double gamma, int child_shards, long long *meta_off, long long *pool_off, unsigned *initial_x, unsigned *initial_y, volatile int *running, double simplification, std::vector<std::map<std::string, layermap_entry>> *layermaps, std::vector<std::vector<std::string>> *layer_unmaps, size_t tiling_seg, size_t pass, size_t passes, unsigned long long mingap, long long minextent, double fraction, const char *prefilter, const char *postfilter, write_tile_args *arg) {
int line_detail;
double merge_fraction = 1;
@ -1489,8 +1512,8 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
std::map<std::string, std::vector<coalesce>> layers;
std::vector<unsigned long long> indices;
std::vector<long long> extents;
std::vector<serial_feature> coalesced_geometry;
std::map<std::string, serial_val> attribute_accum_state;
double coalesced_area = 0;
int within[child_shards];
long long geompos[child_shards];
@ -1569,6 +1592,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
while (1) {
serial_feature sf;
ssize_t which_partial = -1;
if (prefilter == NULL) {
sf = next_feature(geoms, geompos_in, metabase, meta_off, z, tx, ty, initial_x, initial_y, &original_features, &unclipped_features, nextzoom, maxzoom, minzoom, max_zoom_increment, pass, passes, along, alongminus, buffer, within, &first_time, geomfile, geompos, &oprogress, todo, fname, child_shards);
@ -1581,22 +1605,15 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
if (gamma > 0) {
if (manage_gap(sf.index, &previndex, scale, gamma, &gap)) {
if (manage_gap(sf.index, &previndex, scale, gamma, &gap) && find_partial(partials, sf, which_partial)) {
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
}
double coalesced_area = 0;
for (size_t i = 0; i < coalesced_geometry.size(); i++) {
if (coalesced_geometry[i].t == sf.t) {
coalesced_area += coalesced_geometry[i].extent;
}
}
if (additional[A_CLUSTER_DENSEST_AS_NEEDED] || cluster_distance != 0) {
indices.push_back(sf.index);
if (sf.index - merge_previndex < mingap) {
if ((sf.index < merge_previndex || sf.index - merge_previndex < mingap) && find_partial(partials, sf, which_partial)) {
clustered++;
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
@ -1624,27 +1641,29 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
} else if (additional[A_DROP_DENSEST_AS_NEEDED]) {
indices.push_back(sf.index);
if (sf.index - merge_previndex < mingap) {
if (sf.index - merge_previndex < mingap && find_partial(partials, sf, which_partial)) {
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
} else if (additional[A_COALESCE_DENSEST_AS_NEEDED]) {
indices.push_back(sf.index);
if (sf.index - merge_previndex < mingap) {
coalesced_geometry.push_back(sf);
if (sf.index - merge_previndex < mingap && find_partial(partials, sf, which_partial)) {
partials[which_partial].geoms.push_back(sf.geometry);
coalesced_area += sf.extent;
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
} else if (additional[A_DROP_SMALLEST_AS_NEEDED]) {
extents.push_back(sf.extent);
if (sf.extent + coalesced_area <= minextent && sf.t != VT_POINT) {
if (sf.extent + coalesced_area <= minextent && sf.t != VT_POINT && find_partial(partials, sf, which_partial)) {
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
} else if (additional[A_COALESCE_SMALLEST_AS_NEEDED]) {
extents.push_back(sf.extent);
if (sf.extent + coalesced_area <= minextent) {
coalesced_geometry.push_back(sf);
if (sf.extent + coalesced_area <= minextent && find_partial(partials, sf, which_partial)) {
partials[which_partial].geoms.push_back(sf.geometry);
coalesced_area += sf.extent;
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
@ -1663,26 +1682,16 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
fraction_accum += fraction;
if (fraction_accum < 1) {
if (fraction_accum < 1 && find_partial(partials, sf, which_partial)) {
if (additional[A_COALESCE_FRACTION_AS_NEEDED]) {
coalesced_geometry.push_back(sf);
partials[which_partial].geoms.push_back(sf.geometry);
coalesced_area += sf.extent;
}
preserve_attributes(arg->attribute_accum, attribute_accum_state, sf, stringpool);
continue;
}
fraction_accum -= 1;
if (coalesced_geometry.size() != 0) {
for (ssize_t i = coalesced_geometry.size() - 1; i >= 0; i--) {
if (coalesced_geometry[i].t == sf.t && coalesced_geometry[i].layer == sf.layer) {
for (size_t j = 0; j < coalesced_geometry[i].geometry.size(); j++) {
sf.geometry.push_back(coalesced_geometry[i].geometry[j]);
}
coalesced_geometry.erase(coalesced_geometry.begin() + i);
}
}
}
bool reduced = false;
if (sf.t == VT_POLYGON) {
if (!prevent[P_TINY_POLYGON_REDUCTION] && !additional[A_GRID_LOW_ZOOMS]) {
@ -1713,27 +1722,16 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
p.has_id = sf.has_id;
p.index = sf.index;
p.renamed = -1;
p.extent = sf.extent;
partials.push_back(p);
}
merge_previndex = sf.index;
}
// Attach any pieces that were waiting to be coalesced onto some features that did make it.
for (ssize_t i = (ssize_t) coalesced_geometry.size() - 1; i >= 0; i--) {
for (ssize_t j = partials.size() - 1; j >= 0; j--) {
if (partials[j].layer == coalesced_geometry[i].layer && partials[j].t == coalesced_geometry[i].t) {
for (size_t k = 0; k < coalesced_geometry[i].geometry.size(); k++) {
partials[j].geoms[0].push_back(coalesced_geometry[i].geometry[k]);
}
coalesced_geometry.erase(coalesced_geometry.begin() + i);
break;
}
}
coalesced_area = 0;
}
// Attach the leftover cluster count to the last feature that did make it
// XXX Cluster onto the previous feature instead
if (clustered > 0) {
if (partials.size() > 0) {
size_t n = partials.size() - 1;
@ -2058,11 +2056,15 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
line_detail++; // to keep it the same when the loop decrements it
continue;
} else if (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED]) {
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
mingap_fraction = mingap_fraction * max_tile_features / totalsize * 0.90;
unsigned long long mg = choose_mingap(indices, mingap_fraction);
if (mg <= mingap) {
mg = (mingap + 1) * 1.5;
if (mg <= mingap) {
mg = ULONG_MAX;
}
}
mingap = mg;
if (mingap > arg->mingap_out) {
@ -2089,7 +2091,10 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
line_detail++;
continue;
}
} else if (prevent[P_DYNAMIC_DROP] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_COALESCE_FRACTION_AS_NEEDED]) {
} else if (totalsize > layers.size() && (prevent[P_DYNAMIC_DROP] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_COALESCE_FRACTION_AS_NEEDED])) {
// The 95% is a guess to avoid too many retries
// and probably actually varies based on how much duplicated metadata there is
fraction = fraction * max_tile_features / totalsize * 0.95;
if (!quiet) {
fprintf(stderr, "Going to try keeping %0.2f%% of the features to make it fit\n", fraction * 100);
@ -2142,11 +2147,15 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
fprintf(stderr, "Going to try gamma of %0.3f to make it fit\n", gamma);
}
line_detail++; // to keep it the same when the loop decrements it
} else if (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED]) {
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
mingap_fraction = mingap_fraction * max_tile_size / compressed.size() * 0.90;
unsigned long long mg = choose_mingap(indices, mingap_fraction);
if (mg <= mingap) {
mg = mingap * 1.5;
mg = (mingap + 1) * 1.5;
if (mg <= mingap) {
mg = ULONG_MAX;
}
}
mingap = mg;
if (mingap > arg->mingap_out) {
@ -2172,7 +2181,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
line_detail++;
continue;
}
} else if (prevent[P_DYNAMIC_DROP] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_COALESCE_FRACTION_AS_NEEDED]) {
} else if (totalsize > layers.size() && (prevent[P_DYNAMIC_DROP] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_COALESCE_FRACTION_AS_NEEDED])) {
// The 95% is a guess to avoid too many retries
// and probably actually varies based on how much duplicated metadata there is