mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 18:40:17 +00:00
Calculate a bounding box and hopefully reasonable center point
This commit is contained in:
parent
5d7a2f50a9
commit
8f77376b58
@ -573,6 +573,12 @@ next_feature:
|
||||
|
||||
double minlat = 0, minlon = 0, maxlat = 0, maxlon = 0, midlat = 0, midlon = 0;
|
||||
|
||||
tile2latlon(file_bbox[0], file_bbox[1], 32, &maxlat, &minlon);
|
||||
tile2latlon(file_bbox[2], file_bbox[3], 32, &minlat, &maxlon);
|
||||
|
||||
midlat = (maxlat + minlat) / 2;
|
||||
midlon = (maxlon + minlon) / 2;
|
||||
|
||||
fprintf(fp, "\"version\": 1,\n");
|
||||
fprintf(fp, "\"minzoom\": %d,\n", 0);
|
||||
fprintf(fp, "\"maxzoom\": %d,\n", BASE_ZOOM);
|
||||
|
Loading…
x
Reference in New Issue
Block a user