mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Add --clip-bounding-box option to clip input geometry
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
* Fix null pointer crash when reading filter output that does not
|
* Fix null pointer crash when reading filter output that does not
|
||||||
tag features with their extent
|
tag features with their extent
|
||||||
|
* Add `--clip-bounding-box` option to clip input geometry
|
||||||
|
|
||||||
## 1.32.0
|
## 1.32.0
|
||||||
|
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
|
|||||||
* `-aw` or `--detect-longitude-wraparound`: Detect when adjacent points within a feature jump to the other side of the world, and try to fix the geometry.
|
* `-aw` or `--detect-longitude-wraparound`: Detect when adjacent points within a feature jump to the other side of the world, and try to fix the geometry.
|
||||||
* `-pw` or `--use-source-polygon-winding`: Instead of respecting GeoJSON polygon ring order, use the original polygon winding in the source data to distinguish inner (clockwise) and outer (counterclockwise) polygon rings.
|
* `-pw` or `--use-source-polygon-winding`: Instead of respecting GeoJSON polygon ring order, use the original polygon winding in the source data to distinguish inner (clockwise) and outer (counterclockwise) polygon rings.
|
||||||
* `-pW` or `--reverse-source-polygon-winding`: Instead of respecting GeoJSON polygon ring order, use the opposite of the original polygon winding in the source data to distinguish inner (counterclockwise) and outer (clockwise) polygon rings.
|
* `-pW` or `--reverse-source-polygon-winding`: Instead of respecting GeoJSON polygon ring order, use the opposite of the original polygon winding in the source data to distinguish inner (counterclockwise) and outer (clockwise) polygon rings.
|
||||||
|
* `--clip-bounding-box=`*minlon*`,`*minlat*`,`*maxlon*`,`*maxlat*: Clip all features to the specified bounding box.
|
||||||
|
|
||||||
### Setting or disabling tile size limits
|
### Setting or disabling tile size limits
|
||||||
|
|
||||||
|
|||||||
+14
-6
@@ -595,16 +595,20 @@ drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawvec clip_point(drawvec &geom, int z, long long buffer) {
|
drawvec clip_point(drawvec &geom, int z, long long buffer) {
|
||||||
drawvec out;
|
|
||||||
|
|
||||||
long long min = 0;
|
long long min = 0;
|
||||||
long long area = 1LL << (32 - z);
|
long long area = 1LL << (32 - z);
|
||||||
|
|
||||||
min -= buffer * area / 256;
|
min -= buffer * area / 256;
|
||||||
area += buffer * area / 256;
|
area += buffer * area / 256;
|
||||||
|
|
||||||
|
return clip_point(geom, min, min, area, area);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawvec clip_point(drawvec &geom, long long minx, long long miny, long long maxx, long long maxy) {
|
||||||
|
drawvec out;
|
||||||
|
|
||||||
for (size_t i = 0; i < geom.size(); i++) {
|
for (size_t i = 0; i < geom.size(); i++) {
|
||||||
if (geom[i].x >= min && geom[i].y >= min && geom[i].x <= area && geom[i].y <= area) {
|
if (geom[i].x >= minx && geom[i].y >= miny && geom[i].x <= maxx && geom[i].y <= maxy) {
|
||||||
out.push_back(geom[i]);
|
out.push_back(geom[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,13 +650,17 @@ bool point_within_tile(long long x, long long y, int z) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawvec clip_lines(drawvec &geom, int z, long long buffer) {
|
drawvec clip_lines(drawvec &geom, int z, long long buffer) {
|
||||||
drawvec out;
|
|
||||||
|
|
||||||
long long min = 0;
|
long long min = 0;
|
||||||
long long area = 1LL << (32 - z);
|
long long area = 1LL << (32 - z);
|
||||||
min -= buffer * area / 256;
|
min -= buffer * area / 256;
|
||||||
area += buffer * area / 256;
|
area += buffer * area / 256;
|
||||||
|
|
||||||
|
return clip_lines(geom, min, min, area, area);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawvec clip_lines(drawvec &geom, long long minx, long long miny, long long maxx, long long maxy) {
|
||||||
|
drawvec out;
|
||||||
|
|
||||||
for (size_t i = 0; i < geom.size(); i++) {
|
for (size_t i = 0; i < geom.size(); i++) {
|
||||||
if (i > 0 && (geom[i - 1].op == VT_MOVETO || geom[i - 1].op == VT_LINETO) && geom[i].op == VT_LINETO) {
|
if (i > 0 && (geom[i - 1].op == VT_MOVETO || geom[i - 1].op == VT_LINETO) && geom[i].op == VT_LINETO) {
|
||||||
double x1 = geom[i - 1].x;
|
double x1 = geom[i - 1].x;
|
||||||
@@ -661,7 +669,7 @@ drawvec clip_lines(drawvec &geom, int z, long long buffer) {
|
|||||||
double x2 = geom[i - 0].x;
|
double x2 = geom[i - 0].x;
|
||||||
double y2 = geom[i - 0].y;
|
double y2 = geom[i - 0].y;
|
||||||
|
|
||||||
int c = clip(&x1, &y1, &x2, &y2, min, min, area, area);
|
int c = clip(&x1, &y1, &x2, &y2, minx, miny, maxx, maxy);
|
||||||
|
|
||||||
if (c > 1) { // clipped
|
if (c > 1) { // clipped
|
||||||
out.push_back(draw(VT_MOVETO, x1, y1));
|
out.push_back(draw(VT_MOVETO, x1, y1));
|
||||||
|
|||||||
@@ -76,4 +76,8 @@ void check_polygon(drawvec &geom);
|
|||||||
double get_area(drawvec &geom, size_t i, size_t j);
|
double get_area(drawvec &geom, size_t i, size_t j);
|
||||||
double get_mp_area(drawvec &geom);
|
double get_mp_area(drawvec &geom);
|
||||||
|
|
||||||
|
drawvec simple_clip_poly(drawvec &geom, long long x1, long long y1, long long x2, long long y2);
|
||||||
|
drawvec clip_lines(drawvec &geom, long long x1, long long y1, long long x2, long long y2);
|
||||||
|
drawvec clip_point(drawvec &geom, long long x1, long long y1, long long x2, long long y2);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ long long MAX_FILES;
|
|||||||
static long long diskfree;
|
static long long diskfree;
|
||||||
char **av;
|
char **av;
|
||||||
|
|
||||||
|
std::vector<clipbbox> clipbboxes;
|
||||||
|
|
||||||
void checkdisk(std::vector<struct reader> *r) {
|
void checkdisk(std::vector<struct reader> *r) {
|
||||||
long long used = 0;
|
long long used = 0;
|
||||||
for (size_t i = 0; i < r->size(); i++) {
|
for (size_t i = 0; i < r->size(); i++) {
|
||||||
@@ -2594,6 +2596,7 @@ int main(int argc, char **argv) {
|
|||||||
{"detect-longitude-wraparound", no_argument, &additional[A_DETECT_WRAPAROUND], 1},
|
{"detect-longitude-wraparound", no_argument, &additional[A_DETECT_WRAPAROUND], 1},
|
||||||
{"use-source-polygon-winding", no_argument, &prevent[P_USE_SOURCE_POLYGON_WINDING], 1},
|
{"use-source-polygon-winding", no_argument, &prevent[P_USE_SOURCE_POLYGON_WINDING], 1},
|
||||||
{"reverse-source-polygon-winding", no_argument, &prevent[P_REVERSE_SOURCE_POLYGON_WINDING], 1},
|
{"reverse-source-polygon-winding", no_argument, &prevent[P_REVERSE_SOURCE_POLYGON_WINDING], 1},
|
||||||
|
{"clip-bounding-box", required_argument, 0, '~'},
|
||||||
|
|
||||||
{"Filtering tile contents", 0, 0, 0},
|
{"Filtering tile contents", 0, 0, 0},
|
||||||
{"prefilter", required_argument, 0, 'C'},
|
{"prefilter", required_argument, 0, 'C'},
|
||||||
@@ -2682,6 +2685,17 @@ int main(int argc, char **argv) {
|
|||||||
max_tilestats_sample_values = atoi(optarg);
|
max_tilestats_sample_values = atoi(optarg);
|
||||||
} else if (strcmp(opt, "tile-stats-values-limit") == 0) {
|
} else if (strcmp(opt, "tile-stats-values-limit") == 0) {
|
||||||
max_tilestats_values = atoi(optarg);
|
max_tilestats_values = atoi(optarg);
|
||||||
|
} else if (strcmp(opt, "clip-bounding-box") == 0) {
|
||||||
|
clipbbox clip;
|
||||||
|
if (sscanf(optarg, "%lf,%lf,%lf,%lf", &clip.lon1, &clip.lat1, &clip.lon2, &clip.lat2) == 4) {
|
||||||
|
clipbboxes.push_back(clip);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%s: Can't parse bounding box --%s=%s\n", argv[0], opt, optarg);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3003,6 +3017,14 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait until here to project the bounding box, so that the behavior is
|
||||||
|
// the same no matter what order the projection and bounding box are
|
||||||
|
// specified in
|
||||||
|
for (auto &c : clipbboxes) {
|
||||||
|
projection->project(c.lon1, c.lat1, 32, &c.minx, &c.maxy);
|
||||||
|
projection->project(c.lon2, c.lat2, 32, &c.maxx, &c.miny);
|
||||||
|
}
|
||||||
|
|
||||||
if (max_tilestats_sample_values < max_tilestats_values) {
|
if (max_tilestats_sample_values < max_tilestats_values) {
|
||||||
max_tilestats_sample_values = max_tilestats_values;
|
max_tilestats_sample_values = max_tilestats_values;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,20 @@ struct index {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct clipbbox {
|
||||||
|
double lon1;
|
||||||
|
double lat1;
|
||||||
|
double lon2;
|
||||||
|
double lat2;
|
||||||
|
|
||||||
|
long long minx;
|
||||||
|
long long miny;
|
||||||
|
long long maxx;
|
||||||
|
long long maxy;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern std::vector<clipbbox> clipbboxes;
|
||||||
|
|
||||||
void checkdisk(std::vector<struct reader> *r);
|
void checkdisk(std::vector<struct reader> *r);
|
||||||
|
|
||||||
extern int geometry_scale;
|
extern int geometry_scale;
|
||||||
|
|||||||
@@ -560,6 +560,8 @@ the line or polygon within one tile unit of its proper location. You can probabl
|
|||||||
\fB\fC\-pw\fR or \fB\fC\-\-use\-source\-polygon\-winding\fR: Instead of respecting GeoJSON polygon ring order, use the original polygon winding in the source data to distinguish inner (clockwise) and outer (counterclockwise) polygon rings.
|
\fB\fC\-pw\fR or \fB\fC\-\-use\-source\-polygon\-winding\fR: Instead of respecting GeoJSON polygon ring order, use the original polygon winding in the source data to distinguish inner (clockwise) and outer (counterclockwise) polygon rings.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fC\-pW\fR or \fB\fC\-\-reverse\-source\-polygon\-winding\fR: Instead of respecting GeoJSON polygon ring order, use the opposite of the original polygon winding in the source data to distinguish inner (counterclockwise) and outer (clockwise) polygon rings.
|
\fB\fC\-pW\fR or \fB\fC\-\-reverse\-source\-polygon\-winding\fR: Instead of respecting GeoJSON polygon ring order, use the opposite of the original polygon winding in the source data to distinguish inner (counterclockwise) and outer (clockwise) polygon rings.
|
||||||
|
.IP \(bu 2
|
||||||
|
\fB\fC\-\-clip\-bounding\-box=\fR\fIminlon\fP\fB\fC,\fR\fIminlat\fP\fB\fC,\fR\fImaxlon\fP\fB\fC,\fR\fImaxlat\fP: Clip all features to the specified bounding box.
|
||||||
.RE
|
.RE
|
||||||
.SS Setting or disabling tile size limits
|
.SS Setting or disabling tile size limits
|
||||||
.RS
|
.RS
|
||||||
|
|||||||
+10
@@ -387,6 +387,16 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
|||||||
sf.geometry = fix_polygon(sf.geometry);
|
sf.geometry = fix_polygon(sf.geometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto &c : clipbboxes) {
|
||||||
|
if (sf.t == VT_POLYGON) {
|
||||||
|
sf.geometry = simple_clip_poly(sf.geometry, c.minx >> geometry_scale, c.miny >> geometry_scale, c.maxx >> geometry_scale, c.maxy >> geometry_scale);
|
||||||
|
} else if (sf.t == VT_LINE) {
|
||||||
|
sf.geometry = clip_lines(sf.geometry, c.minx >> geometry_scale, c.miny >> geometry_scale, c.maxx >> geometry_scale, c.maxy >> geometry_scale);
|
||||||
|
} else if (sf.t == VT_POINT) {
|
||||||
|
sf.geometry = clip_point(sf.geometry, c.minx >> geometry_scale, c.miny >> geometry_scale, c.maxx >> geometry_scale, c.maxy >> geometry_scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!sf.has_id) {
|
if (!sf.has_id) {
|
||||||
if (additional[A_GENERATE_IDS]) {
|
if (additional[A_GENERATE_IDS]) {
|
||||||
sf.has_id = true;
|
sf.has_id = true;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+88
@@ -0,0 +1,88 @@
|
|||||||
|
{ "type": "FeatureCollection", "properties": {
|
||||||
|
"bounds": "-124.213807,29.689480,-70.645734,49.005639",
|
||||||
|
"center": "-70.645734,29.689480,0",
|
||||||
|
"description": "tests/ne_110m_admin_1_states_provinces_lines/out/-z0_--clip-bounding-box_-110,27,-92,52.json.check.mbtiles",
|
||||||
|
"format": "pbf",
|
||||||
|
"json": "{\"vector_layers\": [ { \"id\": \"in\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 0, \"fields\": {\"adm0_a3\": \"String\", \"adm0_name\": \"String\", \"featurecla\": \"String\", \"mapcolor13\": \"Number\", \"mapcolor9\": \"Number\", \"scalerank\": \"Number\"} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"in\",\"count\": 110,\"geometry\": \"LineString\",\"attributeCount\": 6,\"attributes\": [{\"attribute\": \"adm0_a3\",\"count\": 1,\"type\": \"string\",\"values\": [\"USA\"]},{\"attribute\": \"adm0_name\",\"count\": 1,\"type\": \"string\",\"values\": [\"United States of America\"]},{\"attribute\": \"featurecla\",\"count\": 1,\"type\": \"string\",\"values\": [\"Admin-1 boundary\"]},{\"attribute\": \"mapcolor13\",\"count\": 1,\"type\": \"number\",\"values\": [1],\"min\": 1,\"max\": 1},{\"attribute\": \"mapcolor9\",\"count\": 1,\"type\": \"number\",\"values\": [1],\"min\": 1,\"max\": 1},{\"attribute\": \"scalerank\",\"count\": 1,\"type\": \"number\",\"values\": [2],\"min\": 2,\"max\": 2}]}]}}",
|
||||||
|
"maxzoom": "0",
|
||||||
|
"minzoom": "0",
|
||||||
|
"name": "tests/ne_110m_admin_1_states_provinces_lines/out/-z0_--clip-bounding-box_-110,27,-92,52.json.check.mbtiles",
|
||||||
|
"type": "overlay",
|
||||||
|
"version": "2"
|
||||||
|
}, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "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": [ [ -110.039062, 41.046217 ], [ -109.072266, 41.046217 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -110.039062, 45.089036 ], [ -104.150391, 45.089036 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.062500, 46.012224 ], [ -104.150391, 49.037868 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.062500, 46.012224 ], [ -104.150391, 45.089036 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.150391, 45.089036 ], [ -104.062500, 43.004647 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.062500, 41.046217 ], [ -109.072266, 41.046217 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.062500, 41.046217 ], [ -104.062500, 43.004647 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.062500, 46.012224 ], [ -96.591797, 46.073231 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -96.591797, 46.073231 ], [ -96.855469, 47.040182 ], [ -96.855469, 47.576526 ], [ -97.207031, 48.166085 ], [ -97.294922, 49.037868 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -96.503906, 42.553080 ], [ -96.767578, 42.553080 ], [ -96.767578, 42.682435 ], [ -97.294922, 42.875964 ], [ -97.998047, 42.811522 ], [ -98.613281, 43.004647 ], [ -104.062500, 43.004647 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -96.503906, 43.516689 ], [ -96.591797, 45.398450 ], [ -96.855469, 45.644768 ], [ -96.855469, 45.767523 ], [ -96.591797, 45.890008 ], [ -96.591797, 46.073231 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -96.503906, 42.553080 ], [ -96.679688, 42.747012 ], [ -96.503906, 43.068888 ], [ -96.503906, 43.516689 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.800781, 40.647304 ], [ -95.976562, 41.442726 ], [ -96.152344, 41.574361 ], [ -96.152344, 41.836828 ], [ -96.416016, 42.163403 ], [ -96.503906, 42.553080 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -92.021484, 44.402392 ], [ -92.812500, 44.777936 ], [ -92.724609, 45.521744 ], [ -92.900391, 45.706179 ], [ -92.812500, 45.890008 ], [ -92.285156, 46.134170 ], [ -92.285156, 46.679594 ], [ -92.021484, 46.739861 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -92.021484, 43.580391 ], [ -96.503906, 43.516689 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -110.039062, 37.020098 ], [ -109.072266, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.072266, 37.020098 ], [ -109.072266, 41.046217 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.072266, 37.020098 ], [ -109.072266, 31.353637 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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, 37.020098 ], [ -109.072266, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -102.128906, 40.044438 ], [ -102.128906, 41.046217 ], [ -104.062500, 41.046217 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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, 37.020098 ], [ -103.007812, 36.527295 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -102.128906, 37.020098 ], [ -102.128906, 40.044438 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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, 37.020098 ], [ -102.128906, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.527295 ], [ -103.007812, 32.026706 ], [ -106.699219, 32.026706 ], [ -106.523438, 31.802893 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.361328, 40.044438 ], [ -102.128906, 40.044438 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.658203, 37.020098 ], [ -102.128906, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.482422, 33.651208 ], [ -95.273438, 33.943360 ], [ -96.064453, 33.943360 ], [ -96.328125, 33.797409 ], [ -96.855469, 33.797409 ], [ -97.031250, 33.943360 ], [ -97.119141, 33.797409 ], [ -97.734375, 34.016242 ], [ -97.998047, 33.943360 ], [ -98.173828, 34.161818 ], [ -98.613281, 34.161818 ], [ -99.228516, 34.307144 ], [ -99.404297, 34.452218 ], [ -99.667969, 34.379713 ], [ -100.019531, 34.597042 ], [ -100.019531, 36.527295 ], [ -103.007812, 36.527295 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.361328, 40.044438 ], [ -95.800781, 40.647304 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.800781, 40.647304 ], [ -92.021484, 40.647304 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.361328, 40.044438 ], [ -95.009766, 39.909736 ], [ -95.097656, 39.571822 ], [ -94.921875, 39.300299 ], [ -94.658203, 39.164141 ], [ -94.658203, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.658203, 36.597889 ], [ -94.658203, 37.020098 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.482422, 33.651208 ], [ -94.482422, 35.532226 ], [ -94.658203, 36.597889 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.482422, 33.651208 ], [ -94.042969, 33.651208 ], [ -94.130859, 33.063924 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.658203, 36.597889 ], [ -92.021484, 36.527295 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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": [ [ -92.021484, 33.063924 ], [ -94.130859, 33.063924 ] ] } }
|
||||||
|
,
|
||||||
|
{ "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.130859, 33.063924 ], [ -94.042969, 31.952162 ], [ -93.867188, 31.877558 ], [ -93.515625, 31.128199 ], [ -93.779297, 30.372875 ], [ -93.691406, 30.145127 ], [ -93.955078, 29.840644 ], [ -93.867188, 29.764377 ] ] } }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
File diff suppressed because one or more lines are too long
@@ -2246,7 +2246,7 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
|
|||||||
tile.layers = filter_layers(postfilter, tile.layers, z, tx, ty, layermaps, tiling_seg, layer_unmaps, 1 << line_detail);
|
tile.layers = filter_layers(postfilter, tile.layers, z, tx, ty, layermaps, tiling_seg, layer_unmaps, 1 << line_detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z == 0 && unclipped_features < original_features / 2) {
|
if (z == 0 && unclipped_features < original_features / 2 && clipbboxes.size() == 0) {
|
||||||
fprintf(stderr, "\n\nMore than half the features were clipped away at zoom level 0.\n");
|
fprintf(stderr, "\n\nMore than half the features were clipped away at zoom level 0.\n");
|
||||||
fprintf(stderr, "Is your data in the wrong projection? It should be in WGS84/EPSG:4326.\n");
|
fprintf(stderr, "Is your data in the wrong projection? It should be in WGS84/EPSG:4326.\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user