spacenet-speedrun-map / index.html
Rootkit29's picture
Colour legends
4ef532c verified
Raw History Blame Contribute Delete
8.94 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SpaceNet Cloud-Native Map</title>
<meta name="description" content="Buildings, roads, imagery and POIs from the SpaceNet Speedrun, streamed straight from COG, GeoParquet and PMTiles files on Hugging Face. No servers.">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/maplibre-gl@5.24.1/dist/maplibre-gl.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap">
<style>
:root {
--bg: #0b0d12; --panel: rgba(16, 19, 26, 0.92); --line: rgba(255, 255, 255, 0.09); --fg: #e8eaf0; --muted: #9097a6;
--dim: #646b7a; --accent: #ffc400; --accent2: #ff3d81; --ok: #4ade80;
--mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 13px/1.4 Inter, system-ui, sans-serif; overflow: hidden; }
#map { position: absolute; inset: 0; }
.panel { position: absolute; z-index: 2; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
#side { top: 12px; left: 12px; width: 340px; max-height: calc(100% - 24px); overflow: auto; padding: 14px 14px 10px; }
#side h1 { font-size: 16px; margin: 0 0 4px; letter-spacing: -0.01em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#side h1 .tag { font: 500 10px var(--mono); color: #0b0d12; background: var(--accent); padding: 2px 6px; border-radius: 4px; }
#side p { margin: 0 0 10px; color: var(--muted); }
#side p b { color: var(--fg); font-weight: 600; }
#collapse { display: none; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.hosted { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.hosted b { font: 600 18px var(--mono); white-space: nowrap; }
.hosted span { color: var(--muted); font-size: 11.5px; }
.grp { font: 600 10.5px Inter; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 12px 0 4px; }
#cities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.city, .btn { background: rgba(255,255,255,0.04); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
font: 500 12.5px Inter; cursor: pointer; text-align: left; }
.city small { display: block; color: var(--dim); font-size: 10.5px; font-weight: 400; margin-top: 1px; }
.city:hover, .btn:hover { border-color: rgba(255,255,255,0.25); }
.row { display: flex; gap: 6px; margin-top: 8px; }
.btn.on { background: var(--accent); color: #111; border-color: var(--accent); }
.lyr { display: grid; grid-template-columns: 16px 14px 1fr auto; gap: 8px; align-items: start; padding: 5px 2px; cursor: pointer; }
.lyr input { margin: 2px 0 0; accent-color: var(--accent); }
.sw { width: 14px; height: 14px; border-radius: 3px; margin-top: 1px; }
.lt { display: flex; flex-direction: column; min-width: 0; }
.ln { font-weight: 500; }
.ls { color: var(--dim); font-size: 11px; }
.st { color: var(--ok); font: 10.5px var(--mono); }
.lg { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 2px 0 1px; }
.lg i { font-style: normal; font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.lg i::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.st:empty { display: none; }
.mini { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; font: 600 10.5px var(--mono); padding: 2px 6px; cursor: pointer; }
.mini.on { background: var(--accent); color: #111; border-color: var(--accent); }
.foot { color: var(--dim); font-size: 11px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.foot a { color: var(--muted); }
#hud { right: 12px; bottom: 30px; width: 400px; padding: 12px 14px; font-size: 12px; }
#hud .big { display: flex; align-items: baseline; gap: 10px; }
#hud .big b { font: 600 22px var(--mono); color: var(--accent); }
#hud .big span { color: var(--muted); }
#byfmt div, #log div { display: grid; gap: 8px; font: 11px var(--mono); padding: 1px 0; }
#byfmt { margin: 8px 0 6px; }
#byfmt div { grid-template-columns: 1fr 70px 80px; }
#byfmt div span:not(:first-child), #log div span:not(.f) { text-align: right; color: var(--muted); }
#log div { grid-template-columns: minmax(0, 1fr) 160px 52px 52px; color: var(--muted); white-space: nowrap; }
#log .f { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#log { border-top: 1px solid var(--line); padding-top: 6px; }
.hl { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
#inview { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); top: 12px; padding: 6px 12px; font-size: 12px; color: var(--muted);
background: var(--panel); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; max-width: calc(100% - 760px); overflow: hidden; text-overflow: ellipsis; }
#inview:empty { display: none; }
#inview b { color: var(--fg); font-family: var(--mono); font-weight: 500; }
#err { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #fca5a5; }
.tip { background: rgba(12,14,20,0.96) !important; color: var(--fg) !important; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px !important; font: 12px Inter !important; max-width: 320px; }
.tip-h { font-weight: 600; margin-bottom: 4px; }
.tip table { border-collapse: collapse; }
.tip td { padding: 1px 8px 1px 0; vertical-align: top; }
.tip td:first-child { color: var(--muted); white-space: nowrap; }
.tip-m { color: var(--dim); font: 10.5px var(--mono); margin-top: 4px; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.maplibregl-ctrl-group { background: var(--panel) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
@media (max-width: 1100px) { #inview { display: none; } }
@media (max-width: 760px) {
#side { width: auto; right: 12px; max-height: 58%; }
#collapse { display: block; }
body.collapsed #side > :not(h1) { display: none; }
#hud { left: 12px; right: 12px; width: auto; bottom: 26px; padding: 8px 12px; }
#hud #log, #hud .hl, #hud #byfmt { display: none; }
#hud .big b { font-size: 18px; }
#side h1 .tag { display: none; }
.maplibregl-ctrl-top-right { top: auto; bottom: 150px; }
}
</style>
</head>
<body>
<div id="map"></div>
<div id="side" class="panel">
<h1><span>SpaceNet cloud-native map</span><span><span class="tag">0 servers</span><button id="collapse" aria-label="Toggle panel">☰</button></span></h1>
<p>Buildings and roads from the <b>SpaceNet Speedrun</b> models, the SpaceNet labels they learned from, 0.3 m WorldView-3 imagery and Overture Maps data. Every byte is read straight from <b>COG</b>, <b>GeoParquet</b> and <b>PMTiles</b> files in a public Hugging Face dataset, using HTTP range requests.</p>
<div class="hosted"><b id="hosted">…</b><span id="hosted-n">hosted</span></div>
<div class="grp">Go to</div>
<div id="cities"></div>
<div class="row"><button class="btn" id="world">World view</button><button class="btn" id="xray" title="Show COG tiles and Parquet row groups: the units the browser fetches">X-ray: show what streams</button></div>
<div id="layers"></div>
<div class="foot">Hover any feature for its attributes. Model: ConvNeXt-B U-Nets from the <a href="https://github.com/dlindenbaum/Spacenet-Speedrun" target="_blank" rel="noopener">SpaceNet Speedrun</a>. Data: <a id="ds" href="https://huggingface.co/datasets/Rootkit29/spacenet-speedrun-map-data" target="_blank" rel="noopener">dataset on Hugging Face</a>.</div>
</div>
<div id="inview"></div>
<div id="hud" class="panel">
<div class="big"><b id="streamed">0 B</b><span>streamed · <span id="pct">0%</span> of hosted · <span id="nreq">0</span> requests</span></div>
<div id="byfmt"></div>
<div class="hl">Latest range requests</div>
<div id="log"></div>
</div>
<div id="err"></div>
<script src="https://cdn.jsdelivr.net/npm/maplibre-gl@5.24.1/dist/maplibre-gl.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pmtiles@4.5.0/dist/pmtiles.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@protomaps/basemaps@5.7.2/dist/basemaps.js"></script>
<script src="https://cdn.jsdelivr.net/npm/deck.gl@9.4.1/dist.min.js"></script>
<script>if (matchMedia('(max-width: 760px)').matches) document.body.classList.add('collapsed');</script>
<script type="module" src="./app.js"></script>
</body>
</html>