mapcache_seed(1)

mapcache_seed β€” the glow-up guide πŸ’…βœ¨

okay so bestie, this is the manual page for mapcache_seed(1), and honestly? it's a banger. it's the tool that goes out there and generates tiles to seed your mapcache. let's get into it 🫢


🌸 NAME 🌸

mapcache_seed β€” generate tiles to seed mapcache. that's it. that's the whole job. iconic behavior. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

mapcache_seed -c /path/to/mapcache.xml [options]

like, give it a config path and some options and she's off. slay.


✨ DESCRIPTION ✨

mapcache_seed is an advanced seeding tool for mapcache, and its main features are, no cap:

  • a configurable number of seeding threads, so the rendering goes faster πŸ’¨
  • the ability to reseed tiles that are older than a certain timestamp πŸ•°οΈ
  • the ability to seed tiles given a shapefile/OGR datasource 🌍

πŸ’– OPTIONS πŸ’–

  • -c, --config file β€” path to the mapcache.xml configuration file that contains the tilesets that need to be seeded. like, this is the whole map of what you're doing. don't skip her 🫢
  • -C, --cache override β€” overrides the cache used by the selected tileset. super useful when you wanna selectively seed fallback/multitier caches. iykyk πŸ’…
  • -t, --tileset name β€” name of the tileset that must be seeded. pick your queen.
  • -g, --grid name β€” name of the grid that must be seeded. heads up bestie: the selected tileset must reference the given grid. no grid, no vibes. 🚫
  • -z, --zoom minzoom,maxzoom β€” (optional) start and end zoom levels that must be seeded, separated by a comma, e.g. 0,6. lowkey my fave way to keep things scoped.
  • -M, --metasize width,height β€” override the metatile size while seeding, e.g. 8,8. ✨
  • -e, --extent minx,miny,maxx,maxy β€” (optional) bounding box of the area to seed. box her in, periodt.
  • -o, --older timestamp|now β€” (optional) only seed tiles that are older than the given value. the value can either be the string "now", or a date formatted like year/month/day hour:minute, e.g.: "2011/01/31 20:45". (note that a full timestamp should be quoted) β€” yes, the quotes matter, don't fight it πŸ’€
  • -n, --nthreads number β€” number of parallel threads that should be used to request tiles from the WMS source. the default is 1, but you can set it higher if the WMS server can withstand parallel requests (rule of thumb from the original: the value chosen here should never be much higher than the number of cpus on the WMS server). ⚠️ incompatible with -p/--nprocesses. pick one, bestie, you can't have both.
  • -p, --nprocesses number β€” number of parallel processes that should be used to request tiles from the WMS source. ⚠️ incompatible with -n/--nthreads. same deal, choose your fighter.
  • -P, --precent number β€” percent of failed requests allowed from the last 1000 before we abort (default: 1%, set to 0 to abort on first error). she's got a tolerance threshold and it's giving boundaries 🚧
  • -L, --log-failed file β€” log failed tiles to file. receipts, kept. 🧾
  • -R, --retry-failed file β€” retry failed requests logged to file by --log-failed. the comeback arc πŸ”
  • -m, --mode seed|delete|transfer β€” the mode the utility will be running in: either seed (default), delete or transfer. main character energy, three flavors 🌈
  • -x, --transfer tileset β€” name of the tileset to transfer. moving her to a new home 🚚
  • -D, --dimension DIMENSION=VALUE β€” used to specify which dimension to use if the tileset supports dimensions. can be used multiple times to set multiple dimensions, e.g. -D "DIM1=VAL1" -D "DIM2=VAL2". stack 'em up πŸ“
  • -h, --help β€” show help. when in doubt, ask for help bestie, no shame πŸ’œ
  • -q, --quiet β€” don't print progress messages to the standard output. silent but deadly 😌
  • -f, --force β€” force tile recreation even if it already exists. no thoughts, just overwrite πŸ”₯
  • -v, --verbose β€” print verbose debugging info (if compiled in). the "if compiled in" is doing a lot of heavy lifting here, just fyi πŸ™ˆ

🌍 Optional Commandline options when using OGR/GEOS 🌍

at compile time, if OGR and GEOS were found on the system, the seeder tool supports extra options to seed only the tiles that cover an arbitrary geographical area. cute, right? πŸ¦‹

Important: note that for the time being, the OGR datasource should be in the same projection as the grid you are seeding, because there is no automatic reprojection from the datasource projection to the grid projection. so like, get your projections matching first, okay? don't make her guess 😭
  • -d, --ogr-datasource datasource β€” OGR connection to the spatial source. consult the OGR documentation for all that is supported. in the simplest case (e.g. a Shapefile), this is just the full filename of the shapefile. simple queen ✨
  • -l, --ogr-layer layer β€” (optional) for datasources that contain multiple layers (e.g. postgis, with multiple tables), determines which layer will be used. pick a lane πŸ’…
  • -s, --ogr-sql SQL β€” OGR sql expression that can be applied (see http://www.gdal.org/ogr/ogr_sql.html). go wild with the SQL, bestie.
  • -w, --ogr-where where β€” SQL "where" expression to filter out returned values. this would typically be used to select only the geometry of a given country if the datasource contains all the world contours. so like, just the USA? just Japan? your call 🌸

🧚 NOTES 🧚

the seeding utility must be run under the same user account as the user running the webserver. why? because this is required so the permissions on the tiles created by the seeder are accessible by the webserver, and conversely so the seeder has the rights to write files to directories created by the webserver. it's a two-way street, mutual respect, healthy relationship πŸ’–

a sample seeding session goes like this:

[user@host]$ sudo www-data
[www-data@host]$ mapcache_seed -c /path/to/www/conf/mapcache.xml [options]
[www-data@host]$ logout
[user@host]$

see? user switch, seed, logout. clean, simple, no notes. πŸ‘‘


🌈 EXAMPLE 🌈

seed the "osm" tileset with the "g" (google/web-mercator) grid:

mapcache_seed -c mapcache.xml -t osm -g g

seed levels 0 through 12:

mapcache_seed -c mapcache.xml -t osm -g g -z 0,12

given a shapefile that contains the world country contours, seed only the areas that are covered by land (i.e. skip the oceans). also use 4 request threads in parallel:

mapcache_seed -c mapcache.xml -t osm -g g -z 0,12 -n 4 -d /path/to/seed.shp

same as beforehand, but only seed the USA (notice the quote usage, required to create valid sql with a single-quoted 'US'):

mapcache_seed -c mapcache.xml -t osm -g g -z 0,12 -n 4 -d /path/to/seed.shp -w "FIPS_A2='US'"

reseed levels 0 to 12 (this could also be done by deleting the cache for levels 0 to 12 and doing a classic seed, but doing so this way does not slow down the access from web clients):

mapcache_seed -c mapcache.xml -t osm -g g -z 0,12 -o now

and that's the whole page bestie!! πŸŽ€

little sign-off for the credits, because we always thank the source: this one is from mapcache_seed(1), dated 27 June 2026. love that for her. go forth and seed responsibly πŸ’œβœ¨πŸ¦‹

πŸ“¦ where this page comes from