You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement quick tile generation with imputing (#383)
Improve `generate-tiles` script. By default, this script does NOT change current tile generation behavior except for two things:
* it will take into account the min/max zooms as defined in the tileset yaml file, and pass them to the `tilelive-pgquery`, so that the tilelive info block is correctly generated.
* it will run mbtiles-tools meta-generate at the end to update the info block with the actual zoom ranges and other tileset yaml data (this step is currently done by OMT makefile)
### New functionality
If MID_ZOOM env variable is set, this script will first generate all tiles from MIN_ZOOM to MID_ZOOM. Afterwards, the script will generate one zoom level at a time, making sure to only generate non-empty tiles.
A non-empty tile is a tile that has some data in the previous zoom. All other tiles will be imputed
using "mbtiles-tools impute" command.
Lastly, this also changes the version to 0.0.0 to avoid accidental publishing (the workflow will automatically fix this when publishing)
echo"Generating zoom $MIN_ZOOM..$MAX_ZOOM from $HOST_COUNT servers, using $MAX_HOST_CONNECTIONS connections per server, $ALL_STREAMS parallel streams..."
58
-
set -x
59
-
exec tilelive-copy \
60
-
--scheme="$RENDER_SCHEME" \
75
+
functionrun_tilelive_copy() {
76
+
set -x -o errexit
77
+
tilelive-copy "${@}" \
78
+
--exit \
61
79
--retry="$RETRY" \
62
-
--bounds="$BBOX" \
63
-
--timeout="$TIMEOUT" \
64
-
--minzoom="$MIN_ZOOM" \
65
-
--maxzoom="$MAX_ZOOM" \
66
80
--concurrency="$ALL_STREAMS" \
67
81
"$PGQUERY" \
68
-
"mbtiles://${EXPORT_DIR}/${MBTILES_FILE}"
82
+
"mbtiles://${MBTILES_PATH}"
83
+
{ set +x ;} 2> /dev/null
69
84
}
70
85
71
-
export_local_mbtiles
86
+
87
+
if [[ -z"${MID_ZOOM-}" ]];then
88
+
89
+
# One pass zoom - generate all tiles in one pass
90
+
echo"$(date '+%Y-%m-%d %H-%M-%S') Generating zoom $MIN_ZOOM..$MAX_ZOOM from $HOST_COUNT servers, using $MAX_HOST_CONNECTIONS connections per server, $ALL_STREAMS parallel streams..."
echo"$(date '+%Y-%m-%d %H-%M-%S') Generating zoom $ZOOM using a tile list $LIST_FILE from $HOST_COUNT servers, using $MAX_HOST_CONNECTIONS connections per server, $ALL_STREAMS streams"
109
+
# Use smaller timeout by default because high zooms should generate faster
0 commit comments