mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 18:40:17 +00:00
Constrain calculated center point to be within the bounding box
It could come out bigger because it is calculated from the center of the densest tile, not actually the centroid.
This commit is contained in:
parent
9bb4a549ca
commit
4b171c74b7
13
geojson.c
13
geojson.c
@ -468,6 +468,19 @@ next_feature:
|
||||
tile2latlon(file_bbox[0], file_bbox[1], 32, &maxlat, &minlon);
|
||||
tile2latlon(file_bbox[2], file_bbox[3], 32, &minlat, &maxlon);
|
||||
|
||||
if (midlat < minlat) {
|
||||
midlat = minlat;
|
||||
}
|
||||
if (midlat > maxlat) {
|
||||
midlat = maxlat;
|
||||
}
|
||||
if (midlon < minlon) {
|
||||
midlon = minlon;
|
||||
}
|
||||
if (midlon > maxlon) {
|
||||
midlon = maxlon;
|
||||
}
|
||||
|
||||
mbtiles_write_metadata(outdb, fname, layername, minzoom, maxzoom, minlat, minlon, maxlat, maxlon, midlat, midlon, &file_keys);
|
||||
|
||||
pool_free_strings(&file_keys);
|
||||
|
Loading…
x
Reference in New Issue
Block a user