Add tile-join options to select zoom levels to copy

This commit is contained in:
Eric Fischer 2017-08-16 13:46:07 -07:00
parent e6fc22187a
commit 4d1ddc5a03
7 changed files with 208 additions and 14 deletions

View File

@ -1,3 +1,9 @@
## 1.22.1
* Fix tilestats generation when long string attribute values are elided
* Add option not to produce tilestats
* Add tile-join options to select zoom levels to copy
## 1.22.0
* Add options to filter each tile's contents through a shell pipeline

View File

@ -147,6 +147,10 @@ join-test:
./tippecanoe -f -z12 -o tests/join-population/tabblock_06001420.mbtiles tests/join-population/tabblock_06001420.json
./tippecanoe -f -z12 -o tests/join-population/tabblock_06001420.mbtiles tests/join-population/tabblock_06001420.json
./tippecanoe -f -Z5 -z10 -o tests/join-population/macarthur.mbtiles -l macarthur tests/join-population/macarthur.json
./tile-join -f -Z6 -z9 -o tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur.mbtiles
./tippecanoe-decode tests/join-population/macarthur-6-9.mbtiles > tests/join-population/macarthur-6-9.mbtiles.json.check
cmp tests/join-population/macarthur-6-9.mbtiles.json.check tests/join-population/macarthur-6-9.mbtiles.json
rm -f tests/join-population/macarthur-6-9.mbtiles.json.check tests/join-population/macarthur-6-9.mbtiles
./tippecanoe -f -d10 -D10 -Z9 -z11 -o tests/join-population/macarthur2.mbtiles -l macarthur tests/join-population/macarthur2.json
./tile-join --quiet --force -o tests/join-population/joined.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
./tile-join --quiet --force --no-tile-stats -o tests/join-population/joined-no-tile-stats.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles

View File

@ -469,6 +469,11 @@ The options are:
* `-n` *name* or `--name=`*name*: Set the tileset name.
* `-N` *description* or `--description=`*description*: Set the tileset description.
### Zoom levels
* `-z` _zoom_ or `--maximum-zoom=`_zoom_: Don't copy tiles from higher zoom levels than the specified zoom
* `-Z` _zoom_ or `--minimum-zoom=`_zoom_: Don't copy tiles from lower zoom levels than the specified zoom
### Merging attributes from a CSV file
* `-c` *match*`.csv` or `--csv=`*match*`.csv`: Use *match*`.csv` as the source for new attributes to join to the features. The first line of the file should be the key names; the other lines are values. The first column is the one to match against the existing features; the other columns are the new data to add.

View File

@ -548,6 +548,13 @@ The options are:
.IP \(bu 2
\fB\fC\-N\fR \fIdescription\fP or \fB\fC\-\-description=\fR\fIdescription\fP: Set the tileset description.
.RE
.SS Zoom levels
.RS
.IP \(bu 2
\fB\fC\-z\fR \fIzoom\fP or \fB\fC\-\-maximum\-zoom=\fR\fIzoom\fP: Don't copy tiles from higher zoom levels than the specified zoom
.IP \(bu 2
\fB\fC\-Z\fR \fIzoom\fP or \fB\fC\-\-minimum\-zoom=\fR\fIzoom\fP: Don't copy tiles from lower zoom levels than the specified zoom
.RE
.SS Merging attributes from a CSV file
.RS
.IP \(bu 2

View File

@ -0,0 +1,158 @@
{ "type": "FeatureCollection", "properties": {
"bounds": "-122.343750,37.439974,-121.992188,37.996163",
"center": "-122.167969,37.833010,9",
"description": "tests/join-population/macarthur.mbtiles",
"format": "pbf",
"json": "{\"vector_layers\": [ { \"id\": \"macarthur\", \"description\": \"\", \"minzoom\": 6, \"maxzoom\": 9, \"fields\": {\"FULLNAME\": \"String\", \"LINEARID\": \"String\", \"MTFCC\": \"String\", \"RTTYP\": \"String\"} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"macarthur\",\"count\": 61,\"geometry\": \"LineString\",\"attributeCount\": 4,\"attributes\": [{\"attribute\": \"FULLNAME\",\"count\": 3,\"type\": \"string\",\"values\": [\"Macarthur\",\"Macarthur Fwy\",\"W Macarthur\"]},{\"attribute\": \"LINEARID\",\"count\": 16,\"type\": \"string\",\"values\": [\"1102155930810\",\"1102156241736\",\"1102156510290\",\"1102638069562\",\"1102654601627\",\"1102654601663\",\"1102654602215\",\"1102954918511\",\"1103690383700\",\"1103690474249\",\"1103690474250\",\"1103690483026\",\"1103690483032\",\"1104474748623\",\"1104486090991\",\"1104486392881\"]},{\"attribute\": \"MTFCC\",\"count\": 2,\"type\": \"string\",\"values\": [\"S1100\",\"S1400\"]},{\"attribute\": \"RTTYP\",\"count\": 1,\"type\": \"string\",\"values\": [\"M\"]}]}]}}",
"maxzoom": "9",
"minzoom": "6",
"name": "tests/join-population/macarthur.mbtiles",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 6, "x": 10, "y": 24 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486392881", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.255859, 37.821718 ], [ -122.259979, 37.824972 ], [ -122.272339, 37.828226 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102638069562", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.242126, 37.807614 ], [ -122.238007, 37.806529 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156241736", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786996 ], [ -122.195435, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.295685, 37.833649 ], [ -122.294312, 37.828226 ], [ -122.290192, 37.827141 ], [ -122.281952, 37.828226 ], [ -122.259979, 37.822802 ], [ -122.253113, 37.818463 ], [ -122.248993, 37.810869 ], [ -122.236633, 37.805444 ], [ -122.229767, 37.801104 ], [ -122.211914, 37.796763 ], [ -122.194061, 37.785911 ], [ -122.178955, 37.783740 ], [ -122.158356, 37.773971 ], [ -122.148743, 37.759859 ], [ -122.151489, 37.750087 ], [ -122.141876, 37.737055 ], [ -122.137756, 37.725108 ], [ -122.132263, 37.714245 ], [ -122.110291, 37.701207 ], [ -122.104797, 37.695774 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.104797, 37.695774 ], [ -122.110291, 37.701207 ], [ -122.132263, 37.715331 ], [ -122.137756, 37.726194 ], [ -122.140503, 37.738141 ], [ -122.151489, 37.751172 ], [ -122.148743, 37.760944 ], [ -122.158356, 37.773971 ], [ -122.178955, 37.783740 ], [ -122.194061, 37.785911 ], [ -122.210541, 37.796763 ], [ -122.229767, 37.801104 ], [ -122.236633, 37.806529 ], [ -122.250366, 37.810869 ], [ -122.254486, 37.819548 ], [ -122.259979, 37.822802 ], [ -122.281952, 37.828226 ], [ -122.290192, 37.827141 ], [ -122.294312, 37.829311 ], [ -122.294312, 37.831480 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483032", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184448, 37.777228 ], [ -122.180328, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483026", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.177582, 37.771800 ], [ -122.176208, 37.771800 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102954918511", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769629 ], [ -122.163849, 37.762030 ], [ -122.162476, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690383700", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.161102, 37.753344 ], [ -122.159729, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474249", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159729, 37.750087 ], [ -122.158356, 37.749001 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474250", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143250, 37.739227 ], [ -122.152863, 37.742485 ], [ -122.158356, 37.747915 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 7, "x": 20, "y": 49 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486392881", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.255173, 37.821718 ], [ -122.259293, 37.824430 ], [ -122.272339, 37.827684 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156510290", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254486, 37.820090 ], [ -122.254486, 37.820633 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654602215", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.253113, 37.817378 ], [ -122.252426, 37.816836 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102638069562", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.242126, 37.807614 ], [ -122.237320, 37.805986 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156241736", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194748, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294998, 37.833107 ], [ -122.293625, 37.828768 ], [ -122.290878, 37.827141 ], [ -122.288132, 37.826599 ], [ -122.281265, 37.827684 ], [ -122.260666, 37.822260 ], [ -122.253113, 37.818463 ], [ -122.250366, 37.811954 ], [ -122.248993, 37.810326 ], [ -122.235947, 37.805444 ], [ -122.229080, 37.801104 ], [ -122.211227, 37.796763 ], [ -122.205734, 37.794593 ], [ -122.200928, 37.789167 ], [ -122.194061, 37.785911 ], [ -122.189255, 37.784283 ], [ -122.178268, 37.783740 ], [ -122.158356, 37.773429 ], [ -122.155609, 37.770715 ], [ -122.148056, 37.759859 ], [ -122.148743, 37.757144 ], [ -122.152176, 37.753887 ], [ -122.151489, 37.750087 ], [ -122.149429, 37.745743 ], [ -122.141190, 37.737055 ], [ -122.138443, 37.725651 ], [ -122.131577, 37.714788 ], [ -122.121277, 37.707183 ], [ -122.109604, 37.700664 ], [ -122.104797, 37.695774 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.104111, 37.695774 ], [ -122.109604, 37.700664 ], [ -122.121964, 37.707726 ], [ -122.131577, 37.714788 ], [ -122.137756, 37.725651 ], [ -122.140503, 37.737598 ], [ -122.149429, 37.745743 ], [ -122.151489, 37.750629 ], [ -122.151489, 37.753887 ], [ -122.148743, 37.757144 ], [ -122.148056, 37.760401 ], [ -122.155609, 37.771258 ], [ -122.158356, 37.773429 ], [ -122.177582, 37.783740 ], [ -122.193375, 37.785911 ], [ -122.199554, 37.789167 ], [ -122.205734, 37.794050 ], [ -122.210541, 37.796763 ], [ -122.229080, 37.801104 ], [ -122.235947, 37.805986 ], [ -122.249680, 37.810869 ], [ -122.253799, 37.819006 ], [ -122.259979, 37.822802 ], [ -122.281265, 37.827684 ], [ -122.289505, 37.827141 ], [ -122.293625, 37.828768 ], [ -122.293625, 37.830938 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102155930810", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185822, 37.775600 ], [ -122.185822, 37.776142 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483032", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184448, 37.776685 ], [ -122.180328, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483026", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176895, 37.771258 ], [ -122.175522, 37.771258 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102954918511", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769629 ], [ -122.167969, 37.766372 ], [ -122.163849, 37.762030 ], [ -122.161789, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690383700", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.753344 ], [ -122.159042, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474249", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159042, 37.750087 ], [ -122.158356, 37.748458 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474250", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143250, 37.738684 ], [ -122.152176, 37.742485 ], [ -122.157669, 37.747915 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 8, "x": 41, "y": 99 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.144279, 37.740313 ], [ -122.141533, 37.738141 ], [ -122.140503, 37.736784 ], [ -122.138100, 37.725379 ], [ -122.133636, 37.718590 ], [ -122.131577, 37.714517 ], [ -122.129860, 37.712887 ], [ -122.125397, 37.710443 ], [ -122.121277, 37.707183 ], [ -122.117157, 37.705553 ], [ -122.109604, 37.700664 ], [ -122.104454, 37.695503 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.104111, 37.695503 ], [ -122.109261, 37.700664 ], [ -122.115784, 37.705010 ], [ -122.121277, 37.707455 ], [ -122.124023, 37.709628 ], [ -122.129860, 37.713159 ], [ -122.131577, 37.715060 ], [ -122.133293, 37.718590 ], [ -122.137413, 37.725108 ], [ -122.140503, 37.737327 ], [ -122.143936, 37.740313 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474250", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143250, 37.738413 ], [ -122.147369, 37.740313 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 8, "x": 41, "y": 98 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486392881", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254829, 37.821446 ], [ -122.258949, 37.824430 ], [ -122.263756, 37.825786 ], [ -122.265816, 37.826599 ], [ -122.271996, 37.827684 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156510290", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254143, 37.820090 ], [ -122.254486, 37.820362 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654602215", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.253113, 37.817378 ], [ -122.252426, 37.816565 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102638069562", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241783, 37.807343 ], [ -122.237320, 37.805715 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156241736", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194405, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294655, 37.833107 ], [ -122.293625, 37.828768 ], [ -122.290878, 37.826870 ], [ -122.287788, 37.826599 ], [ -122.281265, 37.827413 ], [ -122.260323, 37.822260 ], [ -122.256203, 37.820362 ], [ -122.253113, 37.817921 ], [ -122.251740, 37.816293 ], [ -122.250366, 37.811954 ], [ -122.249336, 37.810598 ], [ -122.242126, 37.808428 ], [ -122.235603, 37.805444 ], [ -122.229080, 37.801104 ], [ -122.210884, 37.796763 ], [ -122.205391, 37.793779 ], [ -122.199554, 37.788624 ], [ -122.194061, 37.785639 ], [ -122.188911, 37.784283 ], [ -122.178268, 37.783740 ], [ -122.170029, 37.778856 ], [ -122.158356, 37.773429 ], [ -122.155266, 37.770715 ], [ -122.148399, 37.760401 ], [ -122.148056, 37.757959 ], [ -122.151833, 37.753615 ], [ -122.151833, 37.750901 ], [ -122.149429, 37.745743 ], [ -122.145996, 37.742757 ], [ -122.140846, 37.737055 ], [ -122.138100, 37.725379 ], [ -122.133636, 37.718590 ], [ -122.131577, 37.714517 ], [ -122.129860, 37.712887 ], [ -122.125397, 37.710443 ], [ -122.121277, 37.707183 ], [ -122.117157, 37.705553 ], [ -122.109604, 37.700664 ], [ -122.105827, 37.696861 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.105484, 37.696861 ], [ -122.109261, 37.700664 ], [ -122.115784, 37.705010 ], [ -122.121277, 37.707455 ], [ -122.125053, 37.710443 ], [ -122.129173, 37.712615 ], [ -122.131233, 37.714517 ], [ -122.133293, 37.718590 ], [ -122.137413, 37.725108 ], [ -122.140503, 37.737327 ], [ -122.143936, 37.740313 ], [ -122.145653, 37.742757 ], [ -122.148743, 37.745200 ], [ -122.151146, 37.749544 ], [ -122.151833, 37.751172 ], [ -122.151833, 37.752801 ], [ -122.151146, 37.754430 ], [ -122.148399, 37.757144 ], [ -122.148056, 37.759859 ], [ -122.155266, 37.770986 ], [ -122.158012, 37.773157 ], [ -122.170029, 37.779399 ], [ -122.177238, 37.783469 ], [ -122.179642, 37.784283 ], [ -122.188911, 37.784554 ], [ -122.193031, 37.785639 ], [ -122.199554, 37.788895 ], [ -122.205391, 37.794050 ], [ -122.209167, 37.795949 ], [ -122.214317, 37.797848 ], [ -122.228737, 37.801104 ], [ -122.236977, 37.806258 ], [ -122.241096, 37.808428 ], [ -122.248993, 37.810598 ], [ -122.250366, 37.812225 ], [ -122.252426, 37.817921 ], [ -122.255516, 37.820362 ], [ -122.258949, 37.822260 ], [ -122.281265, 37.827684 ], [ -122.284012, 37.827684 ], [ -122.288132, 37.826870 ], [ -122.289505, 37.827141 ], [ -122.293282, 37.828768 ], [ -122.293625, 37.830938 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102155930810", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185478, 37.775600 ], [ -122.185478, 37.775871 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483032", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184105, 37.776685 ], [ -122.179985, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654601627", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.181702, 37.775057 ], [ -122.181358, 37.775057 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483026", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176552, 37.771258 ], [ -122.175522, 37.770986 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102954918511", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769358 ], [ -122.167969, 37.766101 ], [ -122.163849, 37.761758 ], [ -122.161789, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690383700", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.753073 ], [ -122.159042, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474249", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159042, 37.750087 ], [ -122.158012, 37.748458 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474250", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143250, 37.738413 ], [ -122.151833, 37.742485 ], [ -122.156639, 37.746286 ], [ -122.157326, 37.747643 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 9, "x": 82, "y": 198 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.138615, 37.729453 ], [ -122.137928, 37.725379 ], [ -122.137413, 37.724293 ], [ -122.134666, 37.720763 ], [ -122.133465, 37.718590 ], [ -122.131405, 37.714381 ], [ -122.129860, 37.712751 ], [ -122.127972, 37.711665 ], [ -122.125397, 37.710307 ], [ -122.121105, 37.707183 ], [ -122.117157, 37.705418 ], [ -122.109432, 37.700664 ], [ -122.104454, 37.695503 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.104111, 37.695503 ], [ -122.109089, 37.700664 ], [ -122.115784, 37.704874 ], [ -122.121105, 37.707319 ], [ -122.125053, 37.710307 ], [ -122.129173, 37.712615 ], [ -122.130890, 37.714245 ], [ -122.133121, 37.718590 ], [ -122.137413, 37.724972 ], [ -122.138443, 37.729453 ] ] } }
] }
] }
,
{ "type": "FeatureCollection", "properties": { "zoom": 9, "x": 82, "y": 197 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LINEARID": "1104486392881", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254829, 37.821446 ], [ -122.255001, 37.821989 ], [ -122.256203, 37.822802 ], [ -122.258778, 37.824430 ], [ -122.263756, 37.825650 ], [ -122.265644, 37.826599 ], [ -122.271824, 37.827548 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156510290", "FULLNAME": "W Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254143, 37.819955 ], [ -122.254314, 37.820362 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654602215", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.252941, 37.817243 ], [ -122.252426, 37.816429 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102638069562", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241611, 37.807343 ], [ -122.241268, 37.806936 ], [ -122.239723, 37.806800 ], [ -122.237320, 37.805715 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102156241736", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194405, 37.786860 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104486090991", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294655, 37.833107 ], [ -122.294140, 37.832158 ], [ -122.293797, 37.828904 ], [ -122.292938, 37.827955 ], [ -122.290707, 37.826735 ], [ -122.289677, 37.826463 ], [ -122.287788, 37.826463 ], [ -122.283325, 37.827277 ], [ -122.281265, 37.827277 ], [ -122.268391, 37.824158 ], [ -122.262383, 37.822938 ], [ -122.259121, 37.821853 ], [ -122.256031, 37.820362 ], [ -122.252941, 37.817921 ], [ -122.251740, 37.816293 ], [ -122.250366, 37.811818 ], [ -122.249165, 37.810598 ], [ -122.241955, 37.808292 ], [ -122.235432, 37.805444 ], [ -122.229767, 37.801375 ], [ -122.228909, 37.800968 ], [ -122.217236, 37.798391 ], [ -122.210884, 37.796628 ], [ -122.205219, 37.793779 ], [ -122.200756, 37.789302 ], [ -122.199554, 37.788488 ], [ -122.193890, 37.785639 ], [ -122.191486, 37.784825 ], [ -122.188740, 37.784283 ], [ -122.179298, 37.783876 ], [ -122.178268, 37.783604 ], [ -122.169857, 37.778856 ], [ -122.164192, 37.776414 ], [ -122.158184, 37.773293 ], [ -122.155266, 37.770715 ], [ -122.152519, 37.766101 ], [ -122.150631, 37.763930 ], [ -122.148399, 37.760401 ], [ -122.148056, 37.758773 ], [ -122.148056, 37.757823 ], [ -122.148743, 37.756601 ], [ -122.151661, 37.753615 ], [ -122.152004, 37.752122 ], [ -122.151833, 37.750765 ], [ -122.149944, 37.746557 ], [ -122.148914, 37.745064 ], [ -122.145824, 37.742621 ], [ -122.144108, 37.740313 ], [ -122.141533, 37.738141 ], [ -122.140675, 37.737055 ], [ -122.138443, 37.728774 ], [ -122.137928, 37.725379 ], [ -122.137070, 37.723750 ], [ -122.134666, 37.720763 ], [ -122.133465, 37.718590 ], [ -122.131405, 37.714381 ], [ -122.129860, 37.712751 ], [ -122.127972, 37.711665 ], [ -122.125397, 37.710307 ], [ -122.121964, 37.707726 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1104474748623", "FULLNAME": "Macarthur Fwy", "RTTYP": "M", "MTFCC": "S1100" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.121620, 37.707726 ], [ -122.125053, 37.710307 ], [ -122.128143, 37.711936 ], [ -122.129688, 37.713159 ], [ -122.131405, 37.715060 ], [ -122.133121, 37.718590 ], [ -122.137413, 37.724972 ], [ -122.138271, 37.729045 ], [ -122.140503, 37.737327 ], [ -122.141361, 37.738413 ], [ -122.143764, 37.740313 ], [ -122.145653, 37.742757 ], [ -122.149086, 37.745472 ], [ -122.151146, 37.749544 ], [ -122.151833, 37.751172 ], [ -122.151661, 37.753073 ], [ -122.150974, 37.754294 ], [ -122.148228, 37.756873 ], [ -122.147884, 37.758094 ], [ -122.147884, 37.759859 ], [ -122.148743, 37.761623 ], [ -122.152348, 37.766237 ], [ -122.155266, 37.770986 ], [ -122.157841, 37.773157 ], [ -122.164192, 37.776549 ], [ -122.170029, 37.779263 ], [ -122.173977, 37.781298 ], [ -122.177067, 37.783333 ], [ -122.179470, 37.784147 ], [ -122.188911, 37.784554 ], [ -122.193031, 37.785639 ], [ -122.199554, 37.788760 ], [ -122.201099, 37.789845 ], [ -122.203846, 37.792829 ], [ -122.205219, 37.794050 ], [ -122.208996, 37.795949 ], [ -122.211399, 37.797034 ], [ -122.214146, 37.797713 ], [ -122.219810, 37.799205 ], [ -122.228565, 37.800968 ], [ -122.229939, 37.801646 ], [ -122.234745, 37.805308 ], [ -122.237320, 37.806529 ], [ -122.241440, 37.808428 ], [ -122.248821, 37.810598 ], [ -122.249508, 37.811140 ], [ -122.250366, 37.812089 ], [ -122.251568, 37.816293 ], [ -122.252426, 37.817785 ], [ -122.253284, 37.818734 ], [ -122.255344, 37.820226 ], [ -122.258949, 37.822124 ], [ -122.262039, 37.823074 ], [ -122.269764, 37.824701 ], [ -122.281094, 37.827548 ], [ -122.283325, 37.827684 ], [ -122.286758, 37.826870 ], [ -122.288132, 37.826735 ], [ -122.289333, 37.827006 ], [ -122.292080, 37.827955 ], [ -122.293110, 37.828768 ], [ -122.293453, 37.829853 ], [ -122.293453, 37.830938 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102155930810", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185478, 37.775600 ], [ -122.185307, 37.775735 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483032", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184105, 37.776685 ], [ -122.179813, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654601627", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.181530, 37.775057 ], [ -122.181187, 37.774921 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690483026", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176552, 37.771258 ], [ -122.175522, 37.770850 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102654601663", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.169857, 37.767594 ], [ -122.170029, 37.767729 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1102954918511", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769222 ], [ -122.168140, 37.766508 ], [ -122.163849, 37.761623 ], [ -122.163162, 37.760808 ], [ -122.161789, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690383700", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.752937 ], [ -122.159901, 37.751444 ], [ -122.158871, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474249", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.158871, 37.750087 ], [ -122.157841, 37.748322 ] ] } }
,
{ "type": "Feature", "properties": { "LINEARID": "1103690474250", "FULLNAME": "Macarthur", "RTTYP": "M", "MTFCC": "S1400" }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143078, 37.738277 ], [ -122.151833, 37.742485 ], [ -122.153721, 37.744250 ], [ -122.156467, 37.746286 ], [ -122.157326, 37.747508 ] ] } }
] }
] }
] }

View File

@ -35,6 +35,8 @@ int pC = false;
int pg = false;
size_t CPUS;
int quiet = false;
int maxzoom = 32;
int minzoom = 0;
struct stats {
int minzoom;
@ -693,12 +695,14 @@ void decode(struct reader *readers, char *map, std::map<std::string, layermap_en
maxlat = max(lat1, maxlat);
maxlon = max(lon2, maxlon);
zxy tile = zxy(r->zoom, r->x, r->y);
if (tasks.count(tile) == 0) {
tasks.insert(std::pair<zxy, std::vector<std::string>>(tile, std::vector<std::string>()));
if (r->zoom >= minzoom && r->zoom <= maxzoom) {
zxy tile = zxy(r->zoom, r->x, r->y);
if (tasks.count(tile) == 0) {
tasks.insert(std::pair<zxy, std::vector<std::string>>(tile, std::vector<std::string>()));
}
auto f = tasks.find(tile);
f->second.push_back(r->data);
}
auto f = tasks.find(tile);
f->second.push_back(r->data);
if (readers == NULL || readers->zoom != r->zoom || readers->x != r->x || readers->y != r->y) {
if (tasks.size() > 100 * CPUS) {
@ -767,15 +771,15 @@ void decode(struct reader *readers, char *map, std::map<std::string, layermap_en
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'minzoom'", -1, &r->stmt, NULL) == SQLITE_OK) {
if (sqlite3_step(r->stmt) == SQLITE_ROW) {
int minzoom = sqlite3_column_int(r->stmt, 0);
st->minzoom = min(st->minzoom, minzoom);
int minz = max(sqlite3_column_int(r->stmt, 0), minzoom);
st->minzoom = min(st->minzoom, minz);
}
sqlite3_finalize(r->stmt);
}
if (sqlite3_prepare_v2(r->db, "SELECT value from metadata where name = 'maxzoom'", -1, &r->stmt, NULL) == SQLITE_OK) {
if (sqlite3_step(r->stmt) == SQLITE_ROW) {
int maxzoom = sqlite3_column_int(r->stmt, 0);
st->maxzoom = max(st->maxzoom, maxzoom);
int maxz = min(sqlite3_column_int(r->stmt, 0), maxzoom);
st->maxzoom = max(st->maxzoom, maxz);
}
sqlite3_finalize(r->stmt);
}
@ -852,14 +856,14 @@ void decode(struct reader *readers, char *map, std::map<std::string, layermap_en
if (j->type == JSON_HASH) {
if ((k = json_hash_get(j, "minzoom")) != NULL) {
const std::string minzoom_tmp = k->string;
int minzoom = std::stoi(minzoom_tmp);
st->minzoom = min(st->minzoom, minzoom);
int minz = max(std::stoi(minzoom_tmp), minzoom);
st->minzoom = min(st->minzoom, minz);
}
if ((k = json_hash_get(j, "maxzoom")) != NULL) {
const std::string maxzoom_tmp = k->string;
int maxzoom = std::stoi(maxzoom_tmp);
st->maxzoom = max(st->maxzoom, maxzoom);
int maxz = min(std::stoi(maxzoom_tmp), maxzoom);
st->maxzoom = max(st->maxzoom, maxz);
}
if ((k = json_hash_get(j, "center")) != NULL) {
@ -1033,6 +1037,8 @@ int main(int argc, char **argv) {
{"layer", required_argument, 0, 'l'},
{"exclude-layer", required_argument, 0, 'L'},
{"quiet", no_argument, 0, 'q'},
{"maximum-zoom", required_argument, 0, 'z'},
{"minimum-zoom", required_argument, 0, 'Z'},
{"no-tile-size-limit", no_argument, &pk, 1},
{"no-tile-compression", no_argument, &pC, 1},
@ -1089,6 +1095,14 @@ int main(int argc, char **argv) {
set_description = optarg;
break;
case 'z':
maxzoom = atoi(optarg);
break;
case 'Z':
minzoom = atoi(optarg);
break;
case 'p':
if (strcmp(optarg, "k") == 0) {
pk = true;

View File

@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "tippecanoe v1.22.0\n"
#define VERSION "tippecanoe v1.22.1\n"
#endif