Add --exclude-all to tile-join

This commit is contained in:
Eric Fischer
2018-08-07 10:27:38 -07:00
parent 5c881c11ef
commit 8d67e460d4
7 changed files with 179 additions and 5 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.31.1
* Add --exclude-all to tile-join
## 1.31.0 ## 1.31.0
* Upgrade Wagyu to version 0.4.3 * Upgrade Wagyu to version 0.4.3
+4 -1
View File
@@ -175,7 +175,10 @@ join-test: tile-join
./tile-join -q -f -Z6 -z9 -o tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur.mbtiles ./tile-join -q -f -Z6 -z9 -o tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur.mbtiles
./tippecanoe-decode -x generator tests/join-population/macarthur-6-9.mbtiles > tests/join-population/macarthur-6-9.mbtiles.json.check ./tippecanoe-decode -x generator 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 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 ./tile-join -q -f -Z6 -z9 -X -o tests/join-population/macarthur-6-9-exclude.mbtiles tests/join-population/macarthur.mbtiles
./tippecanoe-decode -x generator tests/join-population/macarthur-6-9-exclude.mbtiles > tests/join-population/macarthur-6-9-exclude.mbtiles.json.check
cmp tests/join-population/macarthur-6-9-exclude.mbtiles.json.check tests/join-population/macarthur-6-9-exclude.mbtiles.json
rm -f tests/join-population/macarthur-6-9.mbtiles.json.check tests/join-population/macarthur-6-9.mbtiles tests/join-population/macarthur-6-9-exclude.mbtiles.json.check tests/join-population/macarthur-6-9-exclude.mbtiles
./tippecanoe -q -f -d10 -D10 -Z9 -z11 -o tests/join-population/macarthur2.mbtiles -l macarthur tests/join-population/macarthur2.json ./tippecanoe -q -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 -o tests/join-population/joined.mbtiles -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
./tile-join --quiet --force -o tests/join-population/joined-null.mbtiles --empty-csv-columns-are-null -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles ./tile-join --quiet --force -o tests/join-population/joined-null.mbtiles --empty-csv-columns-are-null -x GEOID10 -c tests/join-population/population.csv tests/join-population/tabblock_06001420.mbtiles
+1
View File
@@ -560,6 +560,7 @@ The options are:
### Filtering features and feature attributes ### Filtering features and feature attributes
* `-x` *key* or `--exclude=`*key*: Remove attributes of type *key* from the output. You can use this to remove the field you are matching against if you no longer need it after joining, or to remove any other attributes you don't want. * `-x` *key* or `--exclude=`*key*: Remove attributes of type *key* from the output. You can use this to remove the field you are matching against if you no longer need it after joining, or to remove any other attributes you don't want.
* `-X` or `--exclude-all`: Remove all attributes from the output.
* `-i` or `--if-matched`: Only include features that matched the CSV. * `-i` or `--if-matched`: Only include features that matched the CSV.
* `-j` *filter* or `--feature-filter`=*filter*: Check features against a per-layer filter (as defined in the [Mapbox GL Style Specification](https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter)) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer `"*"` apply to all layers. * `-j` *filter* or `--feature-filter`=*filter*: Check features against a per-layer filter (as defined in the [Mapbox GL Style Specification](https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter)) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer `"*"` apply to all layers.
* `-J` *filter-file* or `--feature-filter-file`=*filter-file*: Like `-j`, but read the filter from a file. * `-J` *filter-file* or `--feature-filter-file`=*filter-file*: Like `-j`, but read the filter from a file.
+2
View File
@@ -674,6 +674,8 @@ The options are:
.IP \(bu 2 .IP \(bu 2
\fB\fC\-x\fR \fIkey\fP or \fB\fC\-\-exclude=\fR\fIkey\fP: Remove attributes of type \fIkey\fP from the output. You can use this to remove the field you are matching against if you no longer need it after joining, or to remove any other attributes you don't want. \fB\fC\-x\fR \fIkey\fP or \fB\fC\-\-exclude=\fR\fIkey\fP: Remove attributes of type \fIkey\fP from the output. You can use this to remove the field you are matching against if you no longer need it after joining, or to remove any other attributes you don't want.
.IP \(bu 2 .IP \(bu 2
\fB\fC\-X\fR or \fB\fC\-\-exclude\-all\fR: Remove all attributes from the output.
.IP \(bu 2
\fB\fC\-i\fR or \fB\fC\-\-if\-matched\fR: Only include features that matched the CSV. \fB\fC\-i\fR or \fB\fC\-\-if\-matched\fR: Only include features that matched the CSV.
.IP \(bu 2 .IP \(bu 2
\fB\fC\-j\fR \fIfilter\fP or \fB\fC\-\-feature\-filter\fR=\fIfilter\fP: Check features against a per\-layer filter (as defined in the Mapbox GL Style Specification \[la]https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter\[ra]) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer \fB\fC"*"\fR apply to all layers. \fB\fC\-j\fR \fIfilter\fP or \fB\fC\-\-feature\-filter\fR=\fIfilter\fP: Check features against a per\-layer filter (as defined in the Mapbox GL Style Specification \[la]https://www.mapbox.com/mapbox-gl-js/style-spec/#types-filter\[ra]) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer \fB\fC"*"\fR apply to all layers.
@@ -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\": {} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"macarthur\",\"count\": 61,\"geometry\": \"LineString\",\"attributeCount\": 0,\"attributes\": []}]}}",
"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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.255859, 37.821718 ], [ -122.259979, 37.824972 ], [ -122.272339, 37.828226 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.242126, 37.807614 ], [ -122.238007, 37.806529 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786996 ], [ -122.195435, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184448, 37.777228 ], [ -122.180328, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.177582, 37.771800 ], [ -122.176208, 37.771800 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769629 ], [ -122.163849, 37.762030 ], [ -122.162476, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.161102, 37.753344 ], [ -122.159729, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159729, 37.750087 ], [ -122.158356, 37.749001 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.255173, 37.821718 ], [ -122.259293, 37.824430 ], [ -122.272339, 37.827684 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254486, 37.820090 ], [ -122.254486, 37.820633 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.253113, 37.817378 ], [ -122.252426, 37.816836 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.242126, 37.807614 ], [ -122.237320, 37.805986 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194748, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185822, 37.775600 ], [ -122.185822, 37.776142 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184448, 37.776685 ], [ -122.180328, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176895, 37.771258 ], [ -122.175522, 37.771258 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769629 ], [ -122.167969, 37.766372 ], [ -122.163849, 37.762030 ], [ -122.161789, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.753344 ], [ -122.159042, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159042, 37.750087 ], [ -122.158356, 37.748458 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "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": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254143, 37.820090 ], [ -122.254486, 37.820362 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.253113, 37.817378 ], [ -122.252426, 37.816565 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241783, 37.807343 ], [ -122.237320, 37.805715 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194405, 37.786996 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185478, 37.775600 ], [ -122.185478, 37.775871 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184105, 37.776685 ], [ -122.179985, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.181702, 37.775057 ], [ -122.181358, 37.775057 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176552, 37.771258 ], [ -122.175522, 37.770986 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.172089, 37.769358 ], [ -122.167969, 37.766101 ], [ -122.163849, 37.761758 ], [ -122.161789, 37.756601 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.753073 ], [ -122.159042, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.159042, 37.750087 ], [ -122.158012, 37.748458 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254143, 37.819955 ], [ -122.254314, 37.820362 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.252941, 37.817243 ], [ -122.252426, 37.816429 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241611, 37.807343 ], [ -122.241268, 37.806936 ], [ -122.239723, 37.806800 ], [ -122.237320, 37.805715 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.194061, 37.786453 ], [ -122.194405, 37.786860 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.185478, 37.775600 ], [ -122.185307, 37.775735 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.184105, 37.776685 ], [ -122.179813, 37.773971 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.181530, 37.775057 ], [ -122.181187, 37.774921 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.176552, 37.771258 ], [ -122.175522, 37.770850 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.169857, 37.767594 ], [ -122.170029, 37.767729 ] ] } }
,
{ "type": "Feature", "properties": { }, "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": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.160416, 37.752937 ], [ -122.159901, 37.751444 ], [ -122.158871, 37.750087 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.158871, 37.750087 ], [ -122.157841, 37.748322 ] ] } }
,
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.143078, 37.738277 ], [ -122.151833, 37.742485 ], [ -122.153721, 37.744250 ], [ -122.156467, 37.746286 ], [ -122.157326, 37.747508 ] ] } }
] }
] }
] }
+9 -3
View File
@@ -45,6 +45,7 @@ int quiet = false;
int maxzoom = 32; int maxzoom = 32;
int minzoom = 0; int minzoom = 0;
std::map<std::string, std::string> renames; std::map<std::string, std::string> renames;
bool exclude_all = false;
struct stats { struct stats {
int minzoom; int minzoom;
@@ -217,7 +218,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, std::map<std::st
continue; continue;
} }
if (exclude.count(std::string(key)) == 0 && exclude_attributes.count(std::string(key)) == 0) { if (!exclude_all && exclude.count(std::string(key)) == 0 && exclude_attributes.count(std::string(key)) == 0) {
type_and_string tas; type_and_string tas;
tas.type = type; tas.type = type;
tas.string = value; tas.string = value;
@@ -250,7 +251,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, std::map<std::st
const char *sjoinkey = joinkey.c_str(); const char *sjoinkey = joinkey.c_str();
if (exclude.count(joinkey) == 0 && exclude_attributes.count(joinkey) == 0 && attr_type != mvt_null) { if (!exclude_all && exclude.count(joinkey) == 0 && exclude_attributes.count(joinkey) == 0 && attr_type != mvt_null) {
mvt_value outval; mvt_value outval;
if (attr_type == mvt_string) { if (attr_type == mvt_string) {
outval.type = mvt_string; outval.type = mvt_string;
@@ -825,7 +826,7 @@ void decode(struct reader *readers, std::map<std::string, layermap_entry> &layer
} }
void usage(char **argv) { void usage(char **argv) {
fprintf(stderr, "Usage: %s [-f] [-i] [-pk] [-pC] [-c joins.csv] [-x exclude ...] -o new.mbtiles source.mbtiles ...\n", argv[0]); fprintf(stderr, "Usage: %s [-f] [-i] [-pk] [-pC] [-c joins.csv] [-X] [-x exclude ...] -o new.mbtiles source.mbtiles ...\n", argv[0]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -868,6 +869,7 @@ int main(int argc, char **argv) {
{"prevent", required_argument, 0, 'p'}, {"prevent", required_argument, 0, 'p'},
{"csv", required_argument, 0, 'c'}, {"csv", required_argument, 0, 'c'},
{"exclude", required_argument, 0, 'x'}, {"exclude", required_argument, 0, 'x'},
{"exclude-all", no_argument, 0, 'X'},
{"layer", required_argument, 0, 'l'}, {"layer", required_argument, 0, 'l'},
{"exclude-layer", required_argument, 0, 'L'}, {"exclude-layer", required_argument, 0, 'L'},
{"quiet", no_argument, 0, 'q'}, {"quiet", no_argument, 0, 'q'},
@@ -978,6 +980,10 @@ int main(int argc, char **argv) {
exclude.insert(std::string(optarg)); exclude.insert(std::string(optarg));
break; break;
case 'X':
exclude_all = true;
break;
case 'l': case 'l':
keep_layers.insert(std::string(optarg)); keep_layers.insert(std::string(optarg));
break; break;
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP #ifndef VERSION_HPP
#define VERSION_HPP #define VERSION_HPP
#define VERSION "v1.31.0" #define VERSION "v1.31.1"
#endif #endif