Chargement de la carte…
+diff --git a/.gitignore b/.gitignore index 2357e41..97938ed 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ sources/*.3dm *.tgz .DS_Store .cache/ +public/tuiles/*.pmtiles +pmtiles.exe diff --git a/LICENCES.md b/LICENCES.md new file mode 100644 index 0000000..40c5cc9 --- /dev/null +++ b/LICENCES.md @@ -0,0 +1,16 @@ +# Licences des pièces tierces servies par le build + +Le code du dépôt est sous licence MIT (`LICENSE`) ; le contenu de `content/` sous CC BY-SA 4.0 (`content/LICENSE`). Ce fichier liste ce qui vient d'ailleurs et ce que chaque licence demande. + +## Prototype XL (`xl-proto.html`, lot ⑥a) + +| Pièce | Où | Version | Licence | Ce qu'elle demande | +|---|---|---|---|---| +| MapLibre GL JS | `node_modules/maplibre-gl`, groupée par Vite dans `dist/assets/xl-proto-*.js` et `maplibre-gl-worker-*.mjs` | 6.16.0 | BSD 3 clauses (`node_modules/maplibre-gl/LICENSE.txt`) | garder l'avis de copyright ; il reste dans l'en-tête `@license` des fichiers groupés | +| PMTiles (lecteur JS) | `node_modules/pmtiles`, groupé dans `dist/assets/xl-proto-*.js` | 4.5.0 | BSD 3 clauses (champ `license` du paquet ; le paquet npm ne contient pas de fichier LICENSE, le texte est dans le dépôt `protomaps/PMTiles`) | garder l'avis de copyright | +| fflate (décompression, dépendance de PMTiles) | groupé dans `dist/assets/xl-proto-*.js` | 0.8.3 | MIT | garder l'avis | +| Glyphes Noto Sans Regular, plages 0-255 et 256-511 | `public/xl/glyphs/NotoSansRegular/` | `protomaps/basemaps-assets`, commit `028c18f713baecad011301ff7a69acc39bcc2ae7` | SIL Open Font License 1.1 (`OFL.txt` du même dépôt ; Copyright 2022 The Noto Project Authors) | la police peut être servie et redistribuée ; ne pas la vendre seule ; garder la licence avec elle | +| Fond de carte (tuiles) | `public/tuiles/bigorre.pmtiles`, **hors git** (`pipeline/xl/README.md`) | build Protomaps du 06/11/2026 (basemap v4.15.2) | données © les contributeurs d'OpenStreetMap, ODbL 1.0 (« Produced Work ») ; schéma Protomaps sous BSD/ODbL | mention « © OpenStreetMap » lisible sur la carte avec un lien vers `openstreetmap.org/copyright` (fait dans le coin de la carte), et « Protomaps » | +| Outil `pmtiles` (go-pmtiles) | hors dépôt, `C:\Users\jules\dev\_outils\pmtiles\` ; jamais commité, jamais servi | 1.31.2 | BSD 3 clauses (`LICENSE` de l'archive publiée) | — (outil de fabrication, non redistribué) | + +Les épingles (`content/xl-epingles.md`) ne viennent pas d'OpenStreetMap : leurs positions sont les centres de communes de l'API Découpage administratif (`geo.api.gouv.fr`, Licence Ouverte 2.0). Elles restent hors ODbL. diff --git a/content/xl-epingles.md b/content/xl-epingles.md new file mode 100644 index 0000000..324a25c --- /dev/null +++ b/content/xl-epingles.md @@ -0,0 +1,29 @@ +--- +titre: Les épingles de la carte XL (prototype) +source: "Base de connaissances REinNOVER (vault, `REinNOVER/Base de connaissances/`, index du 03/11) ; centres de communes : geo.api.gouv.fr, relevés le 06/11/2026" +statut: prototype du lot ⑥a (06/11) ; toutes les positions sont provisoires, à relever par Jules +licence: CC BY-SA 4.0 +--- + +# Les épingles de la carte XL + +**D'où viennent les coordonnées.** Chaque épingle est posée au **centre de sa commune**, tel que le rend l'API Découpage administratif (`geo.api.gouv.fr/communes`, champ `centre`, Licence Ouverte 2.0), lu le 06/11/2026. Aucune position n'est extraite d'OpenStreetMap : ce fichier reste hors de la licence ODbL du fond de carte, en CC BY-SA comme le reste de `content/`. + +**Toutes les positions sont provisoires, à relever par Jules** : un centre de commune n'est pas l'adresse d'une structure. Deux épingles de la même commune se dessinent écartées l'une de l'autre ; la donnée, elle, reste au centre. + +## Mode d'emploi + +- Une ligne par épingle. `couche` : `existant` (ce qui est là, regardé et critiqué) ou `propose` (ce qu'on propose, ou le relais d'une proposition). L'attribution des couches est celle du prototype : à revoir par Jules. +- `base` : le titre exact de l'entrée de la base de connaissances ; `statut` : le sien, recopié tel quel (il s'affiche quand il appelle une réserve). +- `phrase` : une phrase tirée de l'entrée ; aucun chiffre hors d'une entrée « vérifié ». +- `ouvre` : un lien sortant (`https://…`, nouvel onglet), ou rien. +- Le build s'arrête sur une coordonnée hors du rectangle de la carte (longitude −0,40 à 0,55, latitude 42,65 à 43,55), une couche inconnue ou un identifiant en double, avec la ligne à corriger. + +## Épingles + +| id | lon | lat | couche | titre | base | statut | precision | phrase | ouvre | +|---|---|---|---|---|---|---|---|---|---| +| arbre-paysage-65 | 0.4006 | 43.2895 | propose | Arbre et Paysage 65, à la Maison de la Nature et de l'Environnement | Haies : Réseau Haies et Arbre et Paysage 65 | partiel | Puydarrieux | Le pôle Arbre et Paysage 65 conseille, fournit plants et paillage et suit les plantations de haies, particuliers compris : le premier relais à mettre sur la carte. | https://reseauhaies.fr | +| conservatoire-botanique | 0.1298 | 42.9686 | propose | Conservatoire botanique national des Pyrénées et de Midi-Pyrénées | Plants d'origine locale : Végétal local et le Conservatoire botanique des Pyrénées | à visiter | Bagnères-de-Bigorre | Siège au vallon de Salut : la part locale d'une haie, la palette végétale par biorégion, et un acteur public dans la ville de l'équipe ; son rôle actuel de correspondant Végétal local n'est pas vérifié. | | +| hopital-bagneres | 0.1298 | 42.9686 | existant | L'hôpital de Bagnères | Médecin, maison de santé, hôpital | à vérifier | Bagnères-de-Bigorre | La mobilisation pour l'hôpital de Bagnères rappelle que l'autonomie passe aussi par les services publics. | | +| zero-chomeur-pau | -0.3435 | 43.3219 | propose | Territoire zéro chômeur : des quartiers de Pau | Économie locale depuis le quartier : Territoires zéro chômeur, coopératives d'activité, régies | partiel | Pau | Des quartiers de Pau sont habilités « Territoire zéro chômeur de longue durée » (une seule source) : transformer les gestes du quartier en emplois. | https://tzcld.fr | diff --git a/package-lock.json b/package-lock.json index adbc633..252a5d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,8 @@ "dependencies": { "@fontsource/barlow": "^5.3.0", "@fontsource/barlow-condensed": "^5.3.0", + "maplibre-gl": "^6.16.0", + "pmtiles": "^4.5.0", "three": "^0.170.0", "zod": "^3.23.8" }, @@ -484,6 +486,92 @@ "url": "https://github.com/sponsors/ayuhito" } }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.3.tgz", + "integrity": "sha512-0SElaV0uMxEnxzBhhX9WTuPyUeMsAN/SS0i16tjuba4/mio63MG9khjC1a0JAiPGXAwvwm4UfHJURCN7nyudQg==", + "license": "MIT", + "engines": { + "node": ">= 22" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz", + "integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==", + "license": "ISC" + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.3.0.tgz", + "integrity": "sha512-gBvcNDBBB66bgQYvnaJ6Jk+VCaMmVq5+IZR2kWPisT88Z8s0kBQt6hfVi8QgRW8Vpg0UWZzBA4ZSyzHHC+VeRA==", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/unitbezier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-1.0.0.tgz", + "integrity": "sha512-fqd515fjBmANKGGsQ286E2Wvj/XvDFpGzwJxq4CI6jMQue6Oy04uCKp+JWKF00xRTmk6cEu1jPJ9p3xqH8YWqQ==", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/vector-tile": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-3.0.0.tgz", + "integrity": "sha512-Qf10S1uIHMk20ri/IVBnpS+esUEkVaR5Hftmz88jTInrpmWgPGJfPe3LVjjlE77trLx8tH6qjTG7uWH9hIq/0Q==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "~1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^5.0.0" + } + }, + "node_modules/@maplibre/geojson-vt": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-6.3.0.tgz", + "integrity": "sha512-3Zw2jsU9pIJG3G2CQFbLjWj2MlAHodhD7cSY+15iywUuLmmkgzcKRnueVRZ4AcC/5wOtfhidcJAAzBpoBNs3Xg==", + "license": "ISC", + "dependencies": { + "kdbush": "^4.1.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "26.5.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-26.5.1.tgz", + "integrity": "sha512-9ufQ5LR+Ldn87SILPVyRNz4wVm/sBrM2ZRv9VfjLRKYKIGAcvC1VFw/DEkJLAHqfMV8m03zDz1DUNTIUj/GvdA==", + "license": "ISC", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "^2.0.3", + "@mapbox/unitbezier": "^1.0.0", + "json-stringify-pretty-compact": "^4.0.0", + "minimist": "^1.2.8", + "quickselect": "^3.0.0", + "tinyqueue": "^3.0.0" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@maplibre/mlt": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@maplibre/mlt/-/mlt-1.3.0.tgz", + "integrity": "sha512-7M2O7ABM80Oi8XPkfkrjKB8mOBIxGoVgkA52Mu4RMWoBvvMdagQ522+WxVYujZsMpqIr3BpzrTbXrm4k8lCzCQ==", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "@mapbox/point-geometry": "^1.1.0" + } + }, + "node_modules/@maplibre/vt-pbf": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.3.3.tgz", + "integrity": "sha512-dEe5XUd64RQbxNxy2OzIkJnwNDWjVmSXjCd0A7zLirm7QJ/WWbmtDFIkfsiM4yt1cplqzG6oSivRYeWx1SM1yg==", + "license": "MIT", + "dependencies": { + "@mapbox/point-geometry": "^1.1.0", + "@types/geojson": "^7946.0.16", + "pbf": "^5.1.2" + } + }, "node_modules/@napi-rs/lzma-linux-x64-gnu": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", @@ -865,6 +953,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.20.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.4.tgz", @@ -911,6 +1005,21 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/bidi-js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz", + "integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==", + "license": "MIT", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, + "node_modules/earcut": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.2.4.tgz", + "integrity": "sha512-FHc6yNpnTORB0tM5kmZ03iD2mDuNakDE2lvf4Hw1XkfxtEHIGVi01B/GqUSwx+NcC1WGjidAfpTXzeALtPtfpg==", + "license": "ISC" + }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -975,7 +1084,6 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", - "dev": true, "license": "MIT" }, "node_modules/fsevents": { @@ -993,6 +1101,57 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/gl-matrix": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz", + "integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==", + "license": "MIT" + }, + "node_modules/json-stringify-pretty-compact": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", + "license": "MIT" + }, + "node_modules/kdbush": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.1.0.tgz", + "integrity": "sha512-e9vurzrXJQrFX6ckpHP3bvj5l+9CnYzkxDNnNQ1h2QTqdWsUAJgXiKdGNcOa1EY85dU8KbQ+z/FdQdB7P+9yfQ==", + "license": "ISC" + }, + "node_modules/maplibre-gl": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-6.16.0.tgz", + "integrity": "sha512-gApO66EMtoDZuio680RUBvskR7ahFd/NNhLN4tBAs+Y7FeT4gQV8zVFgYVMRmFxQznOEzecW19w6xOd9XjZjiA==", + "license": "BSD-3-Clause", + "dependencies": { + "@mapbox/point-geometry": "^1.1.0", + "@mapbox/tiny-sdf": "^2.3.0", + "@mapbox/unitbezier": "^1.0.0", + "@mapbox/vector-tile": "^3.0.0", + "@maplibre/geojson-vt": "^6.3.0", + "@maplibre/maplibre-gl-style-spec": "^26.4.4", + "@maplibre/mlt": "^1.3.0", + "@maplibre/vt-pbf": "^4.3.3", + "@types/geojson": "^7946.0.16", + "bidi-js": "^1.1.0", + "earcut": "^3.2.4", + "gl-matrix": "^3.4.4", + "kdbush": "^4.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^5.1.2", + "potpack": "^2.1.0", + "quickselect": "^3.0.0", + "tinyqueue": "^3.0.0" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, "node_modules/meshoptimizer": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", @@ -1000,6 +1159,21 @@ "dev": true, "license": "MIT" }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "license": "MIT" + }, "node_modules/nanoid": { "version": "3.3.19", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", @@ -1019,6 +1193,18 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/pbf": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-5.1.2.tgz", + "integrity": "sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==", + "license": "BSD-3-Clause", + "dependencies": { + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1039,6 +1225,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pmtiles": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-4.5.0.tgz", + "integrity": "sha512-CBeD4SoUluFziGdy/8k7FOjQxQy486n+929W/tWophauvMICpkZ26vGBWhDt/6b1FZQWNaf4jFdT/5+q0Wii5w==", + "license": "BSD-3-Clause", + "dependencies": { + "fflate": "^0.8.2" + } + }, "node_modules/postcss": { "version": "8.5.28", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", @@ -1068,6 +1263,42 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/potpack": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.1.0.tgz", + "integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==", + "license": "ISC" + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.1.tgz", + "integrity": "sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ==", + "license": "MIT" + }, + "node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "license": "ISC" + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "license": "MIT", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, "node_modules/rollup": { "version": "4.63.5", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.5.tgz", @@ -1147,6 +1378,12 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "license": "ISC" + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", diff --git a/package.json b/package.json index 8eb8de9..7c9bf1c 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "dependencies": { "@fontsource/barlow": "^5.3.0", "@fontsource/barlow-condensed": "^5.3.0", + "maplibre-gl": "^6.16.0", + "pmtiles": "^4.5.0", "three": "^0.170.0", "zod": "^3.23.8" }, diff --git a/pipeline/xl/README.md b/pipeline/xl/README.md new file mode 100644 index 0000000..e8c1676 --- /dev/null +++ b/pipeline/xl/README.md @@ -0,0 +1,30 @@ +# pipeline/xl : le fond de carte de la Bigorre (prototype XL, lot ⑥a) + +Le fichier `public/tuiles/bigorre.pmtiles` **n'entre pas dans git** (`.gitignore`). Il se régénère ici, en une commande, et se pose à la main sur le serveur (transfert et `deploy.sh` : au pilotage). + +## La commande (exécutée le 06/11/2026) + +Outil : `pmtiles` 1.31.2 (`protomaps/go-pmtiles`, archive `go-pmtiles_1.31.2_Windows_x86_64.zip`, SHA-256 `a658baa4d7e55020aef6ca17bd9ff9faa1582671266b36f58c52db0ac8e785a1`, identique au `digest` publié sur la page de la version GitHub). Il vit **hors dépôt** : `C:\Users\jules\dev\_outils\pmtiles\pmtiles.exe`. + +``` +C:\Users\jules\dev\_outils\pmtiles\pmtiles.exe extract https://build.protomaps.com/20261106.pmtiles bigorre.pmtiles --bbox=-0.40,42.65,0.55,43.55 --maxzoom=14 +``` + +puis copier `bigorre.pmtiles` dans `public/tuiles/`. L'extraction lit le build mondial par requêtes de plage : 73 requêtes, ≈ 55 Mo transférés, une quinzaine de secondes (06/11). + +| | | +|---|---| +| Build source | `https://build.protomaps.com/20261106.pmtiles` (build quotidien Protomaps v4, publié le 06/11/2026 à 09:03 GMT ; basemap 4.15.2 ; données OSM au 06/11/2026 04:00 UTC) | +| Rectangle | `-0.40,42.65,0.55,43.55` (ouest, sud, est, nord : de Maubourguet à Gavarnie, de Lourdes à Lannemezan ; Pau entre au bord ouest) | +| Zooms | 0 à 14 (`ZOOM_MAX` dans `xl/style.ts`) | +| Taille | 52 084 419 octets (49,7 Mio) ; 3 577 tuiles, compressées gzip dans l'archive | +| SHA-256 du résultat | `89b23dd2bcb8e9baeb39386bddf3834dbd2cf3e2de18b218f7ace6d396cae914` | + +Tailles mesurées pour choisir le zoom maximal (même build, même rectangle) : zoom 12 : 17 446 488 octets · zoom 13 : 30 848 803 · **zoom 14 : 52 084 419** (le plus grand sous 60 Mo, retenu). + +## Ce qu'il faut savoir + +- **Un build quotidien ne reste pas en ligne indéfiniment** : l'adresse du jour se lit sur `docs.protomaps.com/basemaps/downloads` (« daily build channel », `maps.protomaps.com/builds`). Le SHA-256 changera à chaque régénération : le noter ici. +- Le fichier se sert **par requêtes de plage** (HTTP 206) ; Caddy `file_server` le fait. Ne pas le recompresser (les tuiles sont déjà en gzip dans l'archive). +- Licence : données © les contributeurs d'OpenStreetMap, ODbL (voir `LICENCES.md`). L'attribution est affichée dans le coin de la carte. +- Sans le fichier, `xl-proto.html` affiche un message lisible au lieu d'une carte vide. diff --git a/public/xl/glyphs/NotoSansRegular/0-255.pbf b/public/xl/glyphs/NotoSansRegular/0-255.pbf new file mode 100644 index 0000000..7f65901 Binary files /dev/null and b/public/xl/glyphs/NotoSansRegular/0-255.pbf differ diff --git a/public/xl/glyphs/NotoSansRegular/256-511.pbf b/public/xl/glyphs/NotoSansRegular/256-511.pbf new file mode 100644 index 0000000..f030288 Binary files /dev/null and b/public/xl/glyphs/NotoSansRegular/256-511.pbf differ diff --git a/public/xl/glyphs/OFL.txt b/public/xl/glyphs/OFL.txt new file mode 100644 index 0000000..0c037d1 --- /dev/null +++ b/public/xl/glyphs/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Noto Project Authors (https://github.com/notofonts) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/tests/xl-epingles.test.ts b/tests/xl-epingles.test.ts new file mode 100644 index 0000000..7c1b58d --- /dev/null +++ b/tests/xl-epingles.test.ts @@ -0,0 +1,64 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { lireEpingles, filtrerParCouche, statutAffiche, decalages, ErreurEpingles, RECTANGLE } from '../xl/epingles.ts'; +import { construireStyle, ZOOM_MAX, VUE_DEPART } from '../xl/style.ts'; + +const md = readFileSync(new URL('../content/xl-epingles.md', import.meta.url), 'utf8'); +const ENTETE = '| id | lon | lat | couche | titre | base | statut | precision | phrase | ouvre |\n|---|---|---|---|---|---|---|---|---|---|\n'; +const ligne = (id: string, lon: string, lat: string, couche = 'existant') => `| ${id} | ${lon} | ${lat} | ${couche} | Titre | Entrée | partiel | Tarbes | Une phrase. | |\n`; + +test('la table du dépôt se lit : six à dix épingles au plus, toutes dans le rectangle', () => { + const e = lireEpingles(md); + assert.ok(e.length >= 1 && e.length <= 10, `${e.length} épingles`); + for (const p of e) { + assert.ok(p.lon >= RECTANGLE.ouest && p.lon <= RECTANGLE.est && p.lat >= RECTANGLE.sud && p.lat <= RECTANGLE.nord, p.id); + assert.ok(p.base.length > 0 && p.titre.length > 0, p.id); + } + assert.deepEqual(new Set(e.map((p) => p.couche)), new Set(['existant', 'propose'])); +}); + +test('une coordonnée hors du rectangle est refusée, avec la ligne', () => { + assert.throws(() => lireEpingles(ENTETE + ligne('a', '0.06', '43.23') + ligne('b', '1.44', '43.60')), (err: unknown) => err instanceof ErreurEpingles && err.ligne === 4 && /longitude/.test(err.message)); + assert.throws(() => lireEpingles(ENTETE + ligne('a', '0.06', '41.38')), /latitude/); +}); + +test('une couche inconnue est refusée', () => { + assert.throws(() => lireEpingles(ENTETE + ligne('a', '0.06', '43.23', 'futur')), /couche « futur » inconnue/); +}); + +test('un identifiant en double est refusé', () => { + assert.throws(() => lireEpingles(ENTETE + ligne('a', '0.06', '43.23') + ligne('a', '0.10', '43.20')), /en double/); +}); + +test('le filtre par couche garde les seules couches allumées', () => { + const e = lireEpingles(ENTETE + ligne('a', '0.06', '43.23') + ligne('b', '0.10', '43.20', 'propose') + ligne('c', '0.12', '43.10', 'propose')); + assert.deepEqual(filtrerParCouche(e, new Set(['propose'])).map((p) => p.id), ['b', 'c']); + assert.deepEqual(filtrerParCouche(e, new Set(['existant', 'propose'])).length, 3); + assert.deepEqual(filtrerParCouche(e, new Set()), []); +}); + +test('un lien sortant non https est refusé ; le statut de réserve s’affiche', () => { + assert.throws(() => lireEpingles(ENTETE + '| a | 0.06 | 43.23 | existant | T | E | partiel | Tarbes | P. | http://exemple.fr |\n'), /https/); + assert.equal(statutAffiche('à vérifier'), 'à vérifier'); + assert.equal(statutAffiche('vérifié'), null); +}); + +test('deux épingles au même centre de commune s’écartent à l’affichage, la donnée ne bouge pas', () => { + const e = lireEpingles(ENTETE + ligne('a', '0.1298', '42.9686') + ligne('b', '0.1298', '42.9686', 'propose') + ligne('c', '0.06', '43.23')); + const d = decalages(e); + assert.notDeepEqual(d.get('a'), d.get('b')); + assert.deepEqual(d.get('c'), [0, 0]); + assert.equal(e[0]!.lon, e[1]!.lon); +}); + +test('le style ne nomme aucun hôte : glyphes et tuiles viennent de la page', () => { + const s = construireStyle('http://127.0.0.1:4319/xl-proto.html'); + const texte = JSON.stringify(s); + const hotes = new Set([...texte.matchAll(/https?:\/\/([^/"\\]+)/g)].map((m) => m[1]).filter((h) => h !== '127.0.0.1:4319' && h !== 'www.openstreetmap.org' && h !== 'protomaps.com' && h !== 'github.com')); + assert.deepEqual([...hotes], []); + assert.equal('sprite' in s, false); + assert.match(String(s.glyphs), /^http:\/\/127\.0\.0\.1:4319\/xl\/glyphs\/\{fontstack\}\/\{range\}\.pbf$/); + assert.ok(ZOOM_MAX >= 12 && ZOOM_MAX <= 14); + assert.equal(VUE_DEPART.pitch, 45); +}); diff --git a/vite.config.ts b/vite.config.ts index b195e94..c5b5458 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig, type Plugin } from 'vite'; +import { defineConfig, build as construire, type Plugin } from 'vite'; import { execSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; @@ -51,6 +51,29 @@ function contenu(): Plugin { }; } +// Seconde entrée : le prototype XL (lot ⑥a, xl-proto.html, liée depuis aucune page). Bâtie dans une passe à part, +// après la démo : deux entrées HTML dans la même passe font sortir le polyfill modulepreload en morceau partagé, +// et l'entrée de la démo change (mesuré le 06/11 : 292,31 → 291,65 kB, une requête de plus). Ainsi, maplibre-gl +// et pmtiles n'entrent que dans dist/xl-proto.html et la démo reste identique à l'octet près. +function entreeXl(): Plugin { + return { + name: 'quartier-entree-xl', + apply: 'build', + async closeBundle() { + await construire({ + configFile: false, + root: ici('./'), + base: './', + publicDir: false, + logLevel: 'warn', + define: { __BUILD_HASH__: JSON.stringify(BUILD_HASH) }, + plugins: [{ name: 'quartier-xl-hash', transformIndexHtml: (html) => html.replace('__BUILD_HASH__', BUILD_HASH) }], + build: { target: 'es2022', sourcemap: false, emptyOutDir: false, assetsInlineLimit: 0, chunkSizeWarningLimit: 1200, rollupOptions: { input: { 'xl-proto': ici('./xl-proto.html') } } }, + }); + }, + }; +} + export default defineConfig({ // chemins relatifs : la même sortie sert sur quartier.trans-former.fr et en page autonome (lien privé de secours) base: './', @@ -69,6 +92,7 @@ export default defineConfig({ }, plugins: [ contenu(), + entreeXl(), { name: 'quartier-build-json', transformIndexHtml: (html) => html.replace('__BUILD_HASH__', BUILD_HASH), diff --git a/xl-proto.html b/xl-proto.html new file mode 100644 index 0000000..85e4ae0 --- /dev/null +++ b/xl-proto.html @@ -0,0 +1,31 @@ + + +
+ + + + +Chargement de la carte…
+