first commit

This commit is contained in:
Fabio 2026-02-18 22:04:45 +01:00
commit 9b5770d8bb
1320 changed files with 3800 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
data/

8
Dockerfile Normal file
View file

@ -0,0 +1,8 @@
# Dockerfile
FROM nginx:alpine
# Config Nginx
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# Contenuti statici
COPY public/ /usr/share/nginx/html/

55
README.md Normal file
View file

@ -0,0 +1,55 @@
# Mondo usando pmtiles
mappa con terrain 3D, hillshade e curve di livello
## Download i file pmtiles
per il 2D nel sito protomaps scaricare
wget -c https://build.protomaps.com/20260217.pmtiles
per il terrain 3D e hillshade
wget -c https://download.mapterhorn.com/planet.pmtiles
### Download parziale
per esempio
pmtiles extract https://build.protomaps.com/20260217.pmtiles my_area.pmtiles --bbox=4.742883,51.830755,5.552837,52.256198
per scaricare 3d solo alpi
pmtiles extract \
--bbox=7.51,45.90,7.80,46.05 \
https://download.mapterhorn.com/planet.pmtiles \
public/assets/terrain/w_alps.pmtiles
### altri files
dentro project/public/assets
MapLibre GL JS + CSS
curl -L https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js -o maplibre/maplibre-gl.js
curl -L https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css -o maplibre/maplibre-gl.css
PMTiles JS
curl -L https://unpkg.com/pmtiles@4.4.0/dist/pmtiles.js -o pmtiles/pmtiles.js
Protomaps basemaps (solo JS runtime per generare i layers)
curl -L https://unpkg.com/@protomaps/basemaps@5/dist/basemaps.js -o basemaps/basemaps.js
Glyphs + sprites dal repo ufficiale (ZIP)
Apri https://protomaps.github.io/basemaps-assets/ e scarica lo ZIP;
wget https://github.com/protomaps/basemaps-assets/archive/refs/heads/main.zip
unzip main.zip
poi estrai in public/assets/fonts e public/assets/sprites/v4
- fonts/{fontstack}/{range}.pbf
- sprites/v4/light.png, light.json, light@2x.png, light@2x.json

8
backup/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
# Dockerfile
FROM nginx:alpine
# Config Nginx
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# Contenuti statici
COPY public/ /usr/share/nginx/html/

31
backup/default.conf Normal file
View file

@ -0,0 +1,31 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 1) Carica le MIME standard (html, css, js, png, svg, ecc.)
include /etc/nginx/mime.types;
# 2) NON mettere default_type application/octet-stream qui.
# 3) Opzionale: CORS utili se servirai asset da origini diverse
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Range" always;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
# 4) Statici
location / {
try_files $uri $uri/ =404;
}
# 5) Solo per i .pmtiles indica l'octet-stream (e/o gli header utili)
location ~ \.pmtiles$ {
# estende (non sostituisce) le MIME; vale solo in questa location
types { application/octet-stream pmtiles; }
add_header Accept-Ranges "bytes" always; # comodo per debug; Nginx già supporta le Range
}
# Se usi la variante con alias /data (solo se ne hai bisogno):
# location /data/ { alias /data/; }
}

12
backup/docker-compose.yml Normal file
View file

@ -0,0 +1,12 @@
version: "3.8"
services:
web:
build: .
ports:
- "13000:80"
volumes:
# Tutti i contenuti statici (index.html, js, css, glyphs, sprites…)
- ./public:/usr/share/nginx/html:ro
# Monta la cartella host che contiene planet.pmtiles dentro /usr/share/nginx/html/tiles
- /home/nvme/dockerdata/pmtiles/data:/usr/share/nginx/html/tiles:ro
restart: unless-stopped

53
backup/index_ok.html Normal file
View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8" />
<title>Basemap Protomaps + PMTiles (locale)</title>
<link rel="stylesheet" href="./assets/maplibre/maplibre-gl.css">
<style>html,body,#map{height:100%;margin:0}</style>
</head>
<body>
<div id="map"></div>
<script src="/assets/maplibre/maplibre-gl.js"></script>
<script src="/assets/pmtiles/pmtiles.js"></script>
<script src="/assets/basemaps/basemaps.js" crossorigin="anonymous"></script>
<script>
// 1) PMTiles protocol
const protocol = new pmtiles.Protocol({ metadata: true });
maplibregl.addProtocol("pmtiles", protocol.tile);
// 2) Il tuo archivio locale
const PMTILES_URL = "tiles/planet.pmtiles";
protocol.add(new pmtiles.PMTiles(PMTILES_URL));
// 3) Costruisci URL assoluti per sprite e glyphs
// (http(s)://host:porta/...)
const origin = window.location.origin;
const spriteUrl = `${origin}/assets/sprites/v4/light`; // <-- base senza estensione
const glyphsUrl = `${origin}/assets/fonts/{fontstack}/{range}.pbf`; // <-- con {fontstack}/{range}
// 4) Crea la mappa
const map = new maplibregl.Map({
container: "map",
style: {
version: 8,
glyphs: glyphsUrl, // assoluto + {fontstack}/{range} (richiesto dalla spec)
sprite: spriteUrl, // assoluto (MapLibre aggiunge .json/.png e @2x)
sources: {
protomaps: {
type: "vector",
url: "pmtiles://" + PMTILES_URL,
attribution: 'https://protomaps.comProtomaps</a> © https://openstreetmap.orgOpenStreetMap</a>'
}
},
layers: basemaps.layers("protomaps", basemaps.namedFlavor("light"), { lang: "en" })
},
center: [12.05, 44.22],
zoom: 8
});
map.addControl(new maplibregl.NavigationControl(), "top-right");
</script>
</body>
</html>

19
docker-compose.yml Normal file
View file

@ -0,0 +1,19 @@
version: "3.8"
services:
web:
build: .
ports:
- "13000:80"
volumes:
# 1) Contenuti statici (index.html, js, css, glyphs, sprites…)
- ./public:/usr/share/nginx/html:ro
# 2) Basemap planet.pmtiles servito dalla webroot: /tiles/planet.pmtiles
# (lascia questo mount se vuoi continuare a usare PMTILES_URL = "tiles/planet.pmtiles")
- /home/nvme/dockerdata/pmtiles/data:/usr/share/nginx/html/tiles:ro
# 3) DEM planet.pmtiles OUTSIDE webroot, servito via alias /data/
# (punto a TUTTA la cartella; dentro ci sarà /data/planet.pmtiles)
- /home/nvme/dockerdata/pmtiles/data:/data:ro
restart: unless-stopped

34
nginx/default.conf Normal file
View file

@ -0,0 +1,34 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 1) Mappa MIME standard (html, css, js, png, svg, ecc.)
include /etc/nginx/mime.types;
# 2) CORS opzionali
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Range" always;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
# 3) Statici in webroot
location / {
try_files $uri $uri/ =404;
}
# 4) Alias per i dati fuori webroot (PMTiles in /data)
# ^~ => questa location ha la precedenza sui regex match, es. \.pmtiles$
location ^~ /data/ {
alias /data/;
# Solo qui: tipi per .pmtiles + header "Accept-Ranges"
types { application/octet-stream pmtiles; }
add_header Accept-Ranges "bytes" always;
}
# 5) (Opzionale) .pmtiles sotto webroot
location ~ \.pmtiles$ {
types { application/octet-stream pmtiles; }
add_header Accept-Ranges "bytes" always;
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,3 @@

Noto Sans Bold 10240-10495

View file

@ -0,0 +1,3 @@

Noto Sans Bold 10496-10751

View file

@ -0,0 +1,3 @@

Noto Sans Bold 10752-11007

View file

@ -0,0 +1,3 @@

Noto Sans Bold 11008-11263

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,3 @@

Noto Sans Bold 12032-12287

View file

@ -0,0 +1,3 @@

Noto Sans Bold 12288-12543

View file

@ -0,0 +1,3 @@

Noto Sans Bold 12544-12799

Binary file not shown.

View file

@ -0,0 +1,3 @@

Noto Sans Bold 12800-13055

View file

@ -0,0 +1,3 @@

Noto Sans Bold 13056-13311

View file

@ -0,0 +1,3 @@

Noto Sans Bold 13312-13567

View file

@ -0,0 +1,3 @@

Noto Sans Bold 13568-13823

View file

@ -0,0 +1,3 @@

Noto Sans Bold 13824-14079

View file

@ -0,0 +1,3 @@

Noto Sans Bold 14080-14335

View file

@ -0,0 +1,3 @@

Noto Sans Bold 14336-14591

View file

@ -0,0 +1,3 @@

Noto Sans Bold 14592-14847

View file

@ -0,0 +1,3 @@

Noto Sans Bold 14848-15103

View file

@ -0,0 +1,3 @@

Noto Sans Bold 15104-15359

View file

@ -0,0 +1,3 @@

Noto Sans Bold 1536-1791

View file

@ -0,0 +1,3 @@

Noto Sans Bold 15360-15615

View file

@ -0,0 +1,3 @@

Noto Sans Bold 15616-15871

View file

@ -0,0 +1,3 @@

Noto Sans Bold 15872-16127

View file

@ -0,0 +1,3 @@

Noto Sans Bold 16128-16383

View file

@ -0,0 +1,3 @@

Noto Sans Bold 16384-16639

View file

@ -0,0 +1,3 @@

Noto Sans Bold 16640-16895

View file

@ -0,0 +1,3 @@

Noto Sans Bold 16896-17151

View file

@ -0,0 +1,3 @@

Noto Sans Bold 17152-17407

View file

@ -0,0 +1,3 @@

Noto Sans Bold 17408-17663

View file

@ -0,0 +1,3 @@

Noto Sans Bold 17664-17919

View file

@ -0,0 +1,3 @@

Noto Sans Bold 1792-2047

View file

@ -0,0 +1,3 @@

Noto Sans Bold 17920-18175

View file

@ -0,0 +1,3 @@

Noto Sans Bold 18176-18431

View file

@ -0,0 +1,3 @@

Noto Sans Bold 18432-18687

View file

@ -0,0 +1,3 @@

Noto Sans Bold 18688-18943

View file

@ -0,0 +1,3 @@

Noto Sans Bold 18944-19199

View file

@ -0,0 +1,3 @@

Noto Sans Bold 19200-19455

View file

@ -0,0 +1,3 @@

Noto Sans Bold 19456-19711

View file

@ -0,0 +1,3 @@

Noto Sans Bold 19712-19967

View file

@ -0,0 +1,3 @@

Noto Sans Bold 19968-20223

View file

@ -0,0 +1,3 @@

Noto Sans Bold 20224-20479

View file

@ -0,0 +1,3 @@

Noto Sans Bold 2048-2303

View file

@ -0,0 +1,3 @@

Noto Sans Bold 20480-20735

View file

@ -0,0 +1,3 @@

Noto Sans Bold 20736-20991

View file

@ -0,0 +1,3 @@

Noto Sans Bold 20992-21247

View file

@ -0,0 +1,3 @@

Noto Sans Bold 21248-21503

View file

@ -0,0 +1,3 @@

Noto Sans Bold 21504-21759

View file

@ -0,0 +1,3 @@

Noto Sans Bold 21760-22015

View file

@ -0,0 +1,3 @@

Noto Sans Bold 22016-22271

View file

@ -0,0 +1,3 @@

Noto Sans Bold 22272-22527

View file

@ -0,0 +1,3 @@

Noto Sans Bold 22528-22783

View file

@ -0,0 +1,3 @@

Noto Sans Bold 22784-23039

Binary file not shown.

View file

@ -0,0 +1,3 @@

Noto Sans Bold 23040-23295

View file

@ -0,0 +1,3 @@

Noto Sans Bold 23296-23551

View file

@ -0,0 +1,3 @@

Noto Sans Bold 23552-23807

View file

@ -0,0 +1,3 @@

Noto Sans Bold 23808-24063

View file

@ -0,0 +1,3 @@

Noto Sans Bold 24064-24319

View file

@ -0,0 +1,3 @@

Noto Sans Bold 24320-24575

View file

@ -0,0 +1,3 @@

Noto Sans Bold 24576-24831

View file

@ -0,0 +1,3 @@

Noto Sans Bold 24832-25087

View file

@ -0,0 +1,3 @@

Noto Sans Bold 25088-25343

View file

@ -0,0 +1,3 @@

Noto Sans Bold 25344-25599

Binary file not shown.

View file

@ -0,0 +1,3 @@

Noto Sans Bold 2560-2815

View file

@ -0,0 +1,3 @@

Noto Sans Bold 25600-25855

View file

@ -0,0 +1,3 @@

Noto Sans Bold 25856-26111

View file

@ -0,0 +1,3 @@

Noto Sans Bold 26112-26367

View file

@ -0,0 +1,3 @@

Noto Sans Bold 26368-26623

View file

@ -0,0 +1,3 @@

Noto Sans Bold 26624-26879

View file

@ -0,0 +1,3 @@

Noto Sans Bold 26880-27135

View file

@ -0,0 +1,3 @@

Noto Sans Bold 27136-27391

View file

@ -0,0 +1,3 @@

Noto Sans Bold 27392-27647

View file

@ -0,0 +1,3 @@

Noto Sans Bold 27648-27903

View file

@ -0,0 +1,3 @@

Noto Sans Bold 27904-28159

View file

@ -0,0 +1,3 @@

Noto Sans Bold 2816-3071

View file

@ -0,0 +1,3 @@

Noto Sans Bold 28160-28415

View file

@ -0,0 +1,3 @@

Noto Sans Bold 28416-28671

View file

@ -0,0 +1,3 @@

Noto Sans Bold 28672-28927

View file

@ -0,0 +1,3 @@

Noto Sans Bold 28928-29183

View file

@ -0,0 +1,3 @@

Noto Sans Bold 29184-29439

View file

@ -0,0 +1,3 @@

Noto Sans Bold 29440-29695

View file

@ -0,0 +1,3 @@

Noto Sans Bold 29696-29951

View file

@ -0,0 +1,3 @@

Noto Sans Bold 29952-30207

View file

@ -0,0 +1,3 @@

Noto Sans Bold 30208-30463

View file

@ -0,0 +1,3 @@

Noto Sans Bold 30464-30719

Some files were not shown because too many files have changed in this diff Show more