Posters from licensed sources only: kept layers, options, credits on every picture #8

Merged
mesh-tools merged 17 commits from feat/poster-layers into master 2026-11-27 14:39:52 +00:00
2 changed files with 124 additions and 0 deletions
Showing only changes of commit 4f00403e13 - Show all commits
+2
View File
@@ -10,6 +10,8 @@ Kometa.
* **The data**: [circuits/circuits.json](circuits/circuits.json) and one folder per circuit under
[circuits/](circuits/) — 77 circuits, 122 layouts
How posters are made (sources and their licences, kept layers, options, credits): [docs/posters.md](docs/posters.md).
## The API
| Request | Answers |
+122
View File
@@ -0,0 +1,122 @@
# Posters: sources, layers, options and credits
How F1 Circuits makes its race posters, season posters and session thumbnails: where every picture comes
from and under which licence, what it fetches once and keeps, what it draws on every request, which options a
caller has, and how every image says where it comes from. Decided with the operator on 2026-11-27; the licence
reading behind it quotes each source's own terms.
## Principles
1. **Every source is used only as its terms allow, and says so.** The credit each source asks for is drawn on
every image made from it, sent in a header, and listed on the licences page. A caller cannot switch it off.
2. **Static is kept.** The circuits, their layouts and finished seasons do not change, so what is made from
them is fetched or rendered once and kept. Nothing expires; a changed input makes a new key.
3. **Heavy once, light every time.** What needs the network (a map, a photo) is a kept layer. What a caller
can choose (texts, colours, size, format) is drawn on the fly from the kept layers.
4. **Whole or not at all.** A layer is kept only when every part of it arrived. A picture whose layer did not
arrive is served without it, for five minutes, and not kept.
## Sources
Only sources whose licence allows keeping a copy for good (the operator's first tier) are used. Esri, Bing,
Azure Maps, Google, Mapbox and MapTiler are not: their terms forbid automated fetching, keeping, or serving
images made from their maps to the public.
| Source | Used for | Licence | Credit drawn on the image |
|:---|:---|:---|:---|
| Wikimedia Commons aerial photo, picked per layout | `bg=satellite` where a pick exists | per file: CC0, public domain, CC BY or CC BY-SA only | `Photo: <author>, <licence>, via Wikimedia Commons` |
| USGS imagery (NAIP), United States | `bg=satellite` for circuits in the US | public domain | `Imagery: USGS` |
| PDOK aerial photo, the Netherlands | `bg=satellite` for circuits in the Netherlands | CC BY 4.0 | `Luchtfoto: PDOK / Beeldmateriaal Nederland` |
| IGN BD ORTHO, France | `bg=satellite` for circuits in France | Licence Ouverte (Etalab) 2.0 | `© IGN – BD ORTHO` |
| EOxCloudless (Sentinel-2, 10 m) | `bg=satellite` everywhere else | 2016: CC BY 4.0; later years: CC BY-NC-SA 4.0 | `EOxCloudless https://cloudless.eox.at by EOX IT Services GmbH (Contains modified Copernicus Sentinel data <year>)` |
| OpenStreetMap standard tiles | `bg=osm`, `bg=dark`, `bg=light` (recoloured), the world locator | ODbL (data), tile usage policy | `© OpenStreetMap contributors` |
| Jolpica F1 API | race schedules: names, rounds, dates | CC BY-NC-SA 4.0 | in the docs and the Kometa file |
| The circuits' GPS traces and layouts | track outlines, track files | MIT (LICENSE.md) | in the docs |
The national sources' exact credit lines and tile addresses are read from each provider's own pages when
they are built; the lines above are the form to fill.
**The satellite chain.** `bg=satellite` takes, per layout, the first source that has it: the layout's picked
Commons photo, then the national aerial photo of the circuit's country, then EOxCloudless: the 2016 mosaic for
a layout raced in or before 2016 (CC BY 4.0, free of share-alike), else the newest mosaic. `bg=aerial` is the
same as `bg=satellite`, kept for addresses already in use.
**Fetching.** Every request carries the app's own User-Agent, `f1-circuits/<version> (+<public address>)`,
never a person's address. OpenStreetMap tiles are fetched only when a picture is asked for, at most two at a
time, never ahead (its policy forbids pre-seeding). EOX's and the national sources' tiles may be fetched ahead
by a tool, paced. Commons: one API request at a time, at most five a second, at most two downloads at once.
## Layers (kept for good)
| Layer | Made from | Key | Class |
|:---|:---|:---|:---|
| Map picture | the tiles of one source around a layout's trace, at its zoom, for one frame (poster 1000×1500, thumb 1920×1080) | source, source year, trace hash, frame, zoom, render version | `rebuildable` |
| Photo picture | one picked Commons file, cropped to the frame | file name, file's SHA-1 from Commons, frame, render version | `rebuildable` |
| World locator | OpenStreetMap tiles at zoom 5 around the circuit, dark | latitude and longitude rounded to 0.01°, render version | `rebuildable` |
| Track outline points | the layout's trace projected for the frame and zoom | trace hash, frame, zoom | `rebuildable` |
A map is kept only when every tile came and the tiles are not all one picture (a provider's placeholder).
Layers live in the module's directory `layers`, class `rebuildable` (backed up; fetched again if lost).
## Finished images (kept, capped)
Every finished picture is stored under a key made of its route, its options and the keys of the layers it was
made from, in the directory `posters`, class `cache`, at most 2 GB; the least recently used go first when it
is full. A picture whose layer did not arrive is not stored.
**What clients keep.** An address that carries the current render version (`?v=<render version>`, as the
Kometa file writes it) is sent `Cache-Control: public, max-age=31536000, immutable`. Any other address is sent
an ETag and `max-age=86400`, and a matching `If-None-Match` gets a 304. A picture served without its layer is
sent `max-age=300` and no ETag.
## Options
Query parameters, the same on `/posters/race/…`, `/posters/season/…` and `/posters/session/…`. An unknown
option or value is answered 422, naming it.
| Option | Values | Default | Drawn |
|:---|:---|:---|:---|
| `style` | `classic`, `minimal` | `classic` | a preset of the options below; any option given overrides it |
| `bg` | `satellite` (alias `aerial`), `osm`, `dark`, `light`, `none` | `satellite` | the kept map or photo layer |
| `photo` | `bw`, `duotone`, `natural` | `bw` | the treatment of a photo layer |
| `show` | a comma list of `wordmark`, `round`, `name`, `subtitle`, `date`, `circuit`, `locality`, `session` | the style's | on the fly |
| `locator` | `on`, `off` | `on` | the kept locator layer |
| `checker` | `on`, `off` | `on` | on the fly |
| `track` | `off`, or a colour `#rrggbb` with an optional width, `#ffffff,6` | white, 6 | on the fly from the kept outline points; an inset over a photo layer |
| `dim` | 0 to 1 | the style's | on the fly |
| `accent` | `#rrggbb` | the style's | the wordmark's colour |
| `width` | 200 up to the frame's own width | the frame's | scaled down at encoding |
| `format` | `png`, `jpg`, `webp` | `png` | encoding |
The credit line is drawn on every picture, at the bottom, at least 12 px high, in every style.
## Season posters
A season poster shows a season's cars only from a photo picked from Wikimedia Commons'
"<year> Formula One season cars" category, credited like any Commons photo; until one is picked, it is drawn
without a photo. Photos without a free licence are never used.
## Picking photos
A tool lists candidates from Commons per layout (aerial photos of the circuit dated in the layout's years) and
per season (that season's cars): only CC0, public domain, CC BY and CC BY-SA; Commons' quality marks, size and
landscape first. The picker page of the example site shows them with the poster treatment, beside the picks of
the circuit's other layouts, and gives the chosen entry to copy. Picks are kept in the repository, in
`circuits/photos.json` (layout → file, licence, author, credit, date) and `seasons/photos.json`.
## Licences, stated
- On every picture: the credit line of each source it was made from.
- In every picture's response: `X-Credits` with the same line, and `Link: </licences>; rel="license"`.
- `/licences`: every source, its licence, its credit and its terms' address, as JSON; the example site's
licences page shows it.
- Posters are offered under CC BY-NC-SA 4.0 (they carry Jolpica's data, and may carry EOX's later mosaics and
share-alike photos); the track files and the GPS traces under the MIT licence.
- The Kometa file says in its first lines that its data comes from Jolpica under CC BY-NC-SA 4.0.
- The unofficial-use disclaimer for the Formula 1 marks is shown at the foot of `/`, `/docs` and the example
site.
## Not in this change
The disk tile store (replaced by kept layers), renaming the service away from "F1", and the four layouts whose
trace is empty or a point (traced separately).