Files
f1-circuits/examples/licences.html
T
jschoubben 445235ca58 Show bg=photo apart from bg=satellite, on the service's layers
The operator, after seeing real posters: EOX's 2016 mosaic is rejected, and a layout's Commons
photo now serves only an explicit bg=photo, which falls back to what bg=satellite draws. The
picker therefore puts the satellite-or-map choice first, per layout, on the layers the service
uses (PDOK HR, IGN's frozen BD ORTHO 2021-2023, USGS, EOxCloudless 2025), and offers the photos
as optional for bg=photo. One picks entry may carry a photo, "use": "map", or both, and each
choice keeps the other half. The builder and the posters page offer bg=photo; width starts at
400; the licences page sets the options in "used for" as code.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
2026-11-27 15:20:09 +01:00

177 lines
8.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Licences · F1 Circuits API examples</title>
<meta name="description" content="Every source the F1 Circuits posters are made from, its licence and the credit drawn on every picture; the licences of the posters, the track files and the GPS traces.">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="site.css">
</head>
<body>
<header class="site">
<a class="brand" href="index.html">F1 <span>Circuits</span> API</a>
<nav aria-label="Examples">
<a href="index.html">Overview</a>
<a href="circuits.html">Circuit browser</a>
<a href="tracks.html">Track images</a>
<a href="map.html">GPS traces</a>
<a href="grand-prix.html">Grand prix lookup</a>
<a href="posters.html">Posters</a>
<a href="builder.html">Poster builder</a>
<a href="kometa.html">Kometa</a>
<a href="library.html">Library</a>
<a href="picker.html">Photo picker</a>
<a href="licences.html" aria-current="page">Licences</a>
</nav>
<div id="api-base"></div>
</header>
<main>
<h1>Licences</h1>
<p class="lead">
Every picture the API makes is drawn from sources whose licences allow keeping a copy, and each says where it comes
from: the credit of every source it was made from is drawn at its foot, sent in its <code>X-Credits</code> header,
and listed here. A picture’s licence follows its sources, and is sent in its <code>X-License</code> header. Its
<code>Link: &lt;/licences&gt;; rel="license"</code> header points to this list.
</p>
<section class="card" id="call">
<h2>The sources</h2>
<p>What <code>/licences</code> answers, as a table. A credit with <code>&lt;author&gt;</code> and
<code>&lt;licence&gt;</code> is filled in with the photo’s own; one with <code>&lt;year&gt;</code> with the mosaic’s
year. The last column is the licence a picture made from that source gets.</p>
<div class="request"></div>
<div class="status"></div>
<div id="sources"></div>
<details class="result-raw"><summary>The answer as it came</summary><div class="result"></div></details>
</section>
<section class="card">
<h2>What the API offers, and under which licence</h2>
<div id="outputs"></div>
<p class="hint">A race name and its date on a picture are single facts: they do not set its licence. The Kometa
file says in its first lines that its race schedules come from Jolpica, under CC BY-NC-SA 4.0.</p>
</section>
<section class="card">
<h2>Formula 1</h2>
<p>This website is unofficial and is not associated in any way with the Formula 1 companies. F1, FORMULA ONE,
FORMULA 1, FIA FORMULA ONE WORLD CHAMPIONSHIP, GRAND PRIX and related marks are trade marks of Formula One
Licensing B.V.</p>
</section>
</main>
<footer class="pager">
<a rel="prev" href="picker.html">← Photo picker</a>
<a class="home" href="index.html">All examples</a>
<span></span>
</footer>
<footer class="disclaimer">
<p>This website is unofficial and is not associated in any way with the Formula 1 companies. F1, FORMULA ONE,
FORMULA 1, FIA FORMULA ONE WORLD CHAMPIONSHIP, GRAND PRIX and related marks are trade marks of Formula One
Licensing B.V.</p>
<p><a href="licences.html">Licences and credits</a>: every source the pictures are made from, the licence each
picture takes from its sources, and the licence of the track files and the GPS traces (MIT).</p>
</footer>
<script src="site.js"></script>
<script>
(function () {
const { h, api, callJSON, notice } = F1;
const $ = (id) => document.getElementById(id);
const CC = (code) => `https://creativecommons.org/licenses/${code}/4.0/`;
// The rule as the lead settled it (2026-11-27): shown only where /licences does not say it, and marked so.
const STATED = {
pictures: {
rule: 'A picture’s licence follows the sources it is made from.',
licences: [
{ licence: 'CC BY-SA 4.0', licence_url: CC('by-sa'), when: 'made from a CC BY-SA photo' },
{ licence: 'CC BY-NC-SA 4.0', licence_url: CC('by-nc-sa'), when: 'made from EOxCloudless 2025' },
{ licence: 'CC BY 4.0', licence_url: CC('by'), when: 'otherwise' },
],
},
tracks: { licence: 'MIT', licence_url: null },
};
/** The licence a picture from a source gets, by the rule, for a source whose entry does not say it. */
const BY_RULE = {
commons: 'CC BY-SA 4.0 from a CC BY-SA photo, else CC BY 4.0',
eox: 'CC BY-NC-SA 4.0',
jolpica: 'does not set a picture’s licence',
traces: 'does not set a picture’s licence',
};
const link = (href, text) => (href ? h('a', { href, target: '_blank', rel: 'noopener' }, text || href) : text || '–');
/** What a source is used for, its options (bg=photo, bg=satellite, …) set as code so they read as the options they are. */
function usedFor(text) {
const out = h('span');
for (const part of String(text).split(/(\b(?:bg|photo|locator|track)=[a-z0-9#]+(?:\|[a-z0-9]+)*)/)) {
if (part) out.append(/^(bg|photo|locator|track)=/.test(part) ? h('code', {}, part) : part);
}
return out;
}
/** A credit form, its placeholders marked. */
function credit(text) {
const code = h('code');
for (const part of String(text || '').split(/(<[a-z]+>)/)) {
if (!part) continue;
code.append(/^<[a-z]+>$/.test(part) ? h('em', { title: 'Filled in per picture' }, part) : part);
}
return code;
}
function sourcesTable(sources) {
return h('table', { class: 'sources' },
h('thead', {}, h('tr', {}, ...['Source', 'Used for', 'Licence', 'Credit', 'Terms', 'A picture from it'].map((t) => h('th', {}, t)))),
h('tbody', {}, ...sources.map((s) => h('tr', { id: `source-${s.id}` },
h('td', {}, h('b', {}, s.name || s.id), h('br'), h('small', {}, h('code', {}, s.id))),
h('td', {}, s.used_for ? usedFor(s.used_for) : '–'),
h('td', {}, link(s.licence_url, s.licence)),
h('td', {}, credit(s.credit)),
h('td', {}, s.terms ? link(s.terms, new URL(s.terms, location.href).host || s.terms) : '–'),
h('td', {}, s.picture_licence || h('span', { title: 'The answer does not say it; derived from the rule' },
BY_RULE[s.id] || 'CC BY 4.0', h('br'), h('small', {}, h('em', {}, 'by the rule'))))))));
}
function outputs(answer) {
const pictures = (answer && answer.pictures) || STATED.pictures;
const tracks = (answer && answer.tracks) || STATED.tracks;
const missing = [!(answer && answer.pictures) && 'the pictures’ licence', !(answer && answer.tracks) && 'the track files’ licence'].filter(Boolean);
const rows = [
...(pictures.licences || []).map((l, i) => h('tr', {},
i === 0 ? h('td', { rowspan: pictures.licences.length }, 'Race posters, season posters and session thumbnails') : null,
h('td', {}, link(l.licence_url, l.licence)),
h('td', {}, l.when || '–'))),
h('tr', {}, h('td', {}, 'Track files (SVG, PNG, GeoJSON) and the GPS traces'), h('td', {}, link(tracks.licence_url, tracks.licence)),
h('td', {}, 'LICENSE.md in the repository')),
];
$('outputs').replaceChildren(
missing.length ? notice('error', `/licences did not say ${missing.join(' or ')}, so this shows the rule as it was decided, not what the service says.`) : '',
h('p', {}, pictures.rule || ''),
h('table', {},
h('thead', {}, h('tr', {}, h('th', {}, 'What'), h('th', {}, 'Licence'), h('th', {}, 'When'))),
h('tbody', {}, ...rows)));
}
(async () => {
const answer = await callJSON($('call'), api('/licences'));
if (!answer) {
$('sources').replaceChildren(notice('error', 'The sources cannot be listed: /licences did not answer (see above). The service may not serve it yet.'));
outputs(null);
return;
}
if (!Array.isArray(answer.sources)) {
$('sources').replaceChildren(notice('error', 'The answer has no list of sources (no "sources" array).'));
} else {
$('sources').replaceChildren(sourcesTable(answer.sources));
}
outputs(answer);
})();
})();
</script>
</body>
</html>