plateau-city-glb / README.md
anxuanng's picture
Dataset Viewer: default config reads data/*.parquet (mesh as Mesh, thumbnail as Image)
517b3a5 verified
|
Raw History Blame Contribute Delete
8.96 kB
metadata
license: cc-by-4.0
license_link: https://www.mlit.go.jp/plateau/site-policy/
pretty_name: PLATEAU Japan City Tiles GLB
tags:
  - 3d
  - glb
  - gltf
  - city
  - buildings
  - japan
  - tokyo
  - plateau
  - citygml
  - threejs
  - webgpu
  - game-assets
  - streaming
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*.parquet

PLATEAU Japan City Tiles as GLB

All 797 city tiles

Japan's government 3D city models (MLIT Project PLATEAU) cut into streamable 1 km tiles: all of Tokyo's 23 wards plus central Osaka, Yokohama, Nagoya and Sapporo. Every tile has textured LOD2 buildings where PLATEAU photographed them, LOD1 blocks elsewhere, terrain and roads, as web, KTX2, LOD, phone and engine GLB with a collision mesh, and tiles.json places every tile in metres for streaming.

Not made or endorsed by MLIT (Ministry of Land, Infrastructure, Transport and Tourism) or the local governments. Source credited per the PLATEAU Site Policy; this is a modified copy by CodePawl. No PLATEAU logo is used. Not for survey use: accuracy is as published and then simplified.

797 city tiles from Project PLATEAU 3D city models by Japan's MLIT, 6.33 GB of source files packed into 758.0 MB of GLB (web tier). Credit: Source: MLIT Project PLATEAU 3D city models (https://www.mlit.go.jp/plateau/), 2020 releases on G-spatial Information Center: Tokyo 23 wards (https://www.geospatial.jp/ckan/dataset/plateau-tokyo23ku), Osaka (https://www.geospatial.jp/ckan/dataset/plateau-27100-osaka-shi-2020), Yokohama (https://www.geospatial.jp/ckan/dataset/plateau-14100-yokohama-city-2020), Nagoya (https://www.geospatial.jp/ckan/dataset/plateau-23100-nagoya-shi-2020), Sapporo (https://www.geospatial.jp/ckan/dataset/plateau-01100-sapporo-shi-2020). Copyright of the data: each local government.

Viewer: https://huggingface.co/spaces/codepawl/plateau-city-glb-viewer

Stream a city

tiles.json lists every tile by city: its mesh code, latitude and longitude bounds, the plane CRS, its offset in metres from the city origin, and the path of every tier. Tiles are third-level Japanese mesh cells (about 1.1 x 0.9 km). Each GLB is in local metres around its cell centre (x east, y up as orthometric height, z south), so a game places it at offset_m and loads the tiles near the camera:

const index = await (await fetch(`${base}/tiles.json`)).json();
const tokyo = index.cities.tokyo;
for (const tile of tokyo.tiles) {
  const near = Math.hypot(tile.offset_m[0] - camera.position.x, tile.offset_m[2] - camera.position.z) < 1500;
  if (!near || loaded.has(tile.id)) continue;
  loaded.add(tile.id);
  loader.load(`${base}/${tile.files.web}`, (gltf) => { gltf.scene.position.fromArray(tile.offset_m); scene.add(gltf.scene); });
}

In 67js, give the lens with the clip planes so a whole tile fits: renderer.render({ eye, target, fov: 45, near: 1, far: 5000 }). The default far plane is 100 m.

Each tile has up to four nodes under its root: buildings_lod2 (textured where PLATEAU has facade photos), buildings_lod1 (blocks for the rest), terrain and roads. The root node's extras carry the city, mesh code, CRS and cell centre. collision/ holds every LOD1 block of the tile plus terrain as plain triangle meshes, for a static trimesh collider.

Files

Folder Size What For
objects/ 758.0 MB meshopt geometry, WebP textures three.js, Babylon.js, any glTF viewer with the meshopt decoder
objects_ktx2/ 164.4 MB meshopt, KTX2 textures (ETC1S colour, UASTC normals), mipmaps WebGPU and WebGL games: textures stay compressed on the GPU
lods/ 1.90 GB three simplified levels: 50, 20 and 6 % of the triangles distance LOD, crowds, far props
mobile/ 630.7 MB 25 % of the triangles, textures at most 512 px in KTX2 phones and light laptops
engine/ 3.80 GB no meshopt, no quantization Blender and desktop engines that cannot decode meshopt
collision/ 1.24 GB convex collision shapes, plain glTF Rapier, Jolt, PhysX, Unity colliders

metadata.jsonl has one line per item: title, kind, licence, authors, triangle count and the path and size of every tier. Thumbnails are in thumbs/.

For web games and WebGPU

Load the objects_ktx2/ files for games: KTX2 textures stay block-compressed on the GPU (BC7 on desktop, ASTC or ETC2 on phones), so they take a fraction of the memory of decoded WebP. Switch to lods/ by distance and to mobile/ on phones. collision/ holds convex shapes for physics.

Measured on 12 items spread over triangle count. Phone page: 390x844 at 3x, pixel ratio capped at 2, CPU throttled 4x, network at Chrome's Fast 4G (150 ms, 9 Mbit/s), so phone load includes the download. The GPU is a desktop RTX 3060 and is not throttled: frame time shows the CPU side only, a real phone GPU is slower. VRAM is geometry plus texture bytes on the GPU.

Tier File (median) VRAM (median) Triangles Phone load (4G) Frame time WebGPU load (local)
web (12) 0.9 MB 3.3 MiB 110,792 950 ms 0.5 ms 7 ms
ktx2 (2) 2.7 MB 15.8 MiB 173,250 2578 ms 0.7 ms 58 ms
lod2 (12) 0.9 MB 2.7 MiB 82,968 913 ms 0.5 ms 7 ms
mobile (12) 0.9 MB 2.7 MiB 83,221 916 ms 0.5 ms 7 ms

three.js WebGPU:

import * as THREE from 'three';
import { WebGPURenderer } from 'three/webgpu';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';

const renderer = new WebGPURenderer({ antialias: true });
await renderer.init(); // KTX2Loader needs to know which compressed formats this device takes
const ktx2 = new KTX2Loader().setTranscoderPath('https://cdn.jsdelivr.net/npm/three@0.187.0/examples/jsm/libs/basis/').detectSupport(renderer);
const loader = new GLTFLoader().setKTX2Loader(ktx2).setMeshoptDecoder(MeshoptDecoder);
const gltf = await loader.loadAsync('https://huggingface.co/datasets/codepawl/plateau-city-glb/resolve/main/objects_ktx2/tokyo-53392633/tokyo-53392633.glb');

Use it in 67js

67js loads these files as they are:

npm install 67js@npm:@codepawlhq/67js meshoptimizer
import { Renderer67 } from '67js';
import { loadGltf } from '67js/addons/gltf';
import { MeshoptDecoder } from 'meshoptimizer';

const asset = await loadGltf('https://huggingface.co/datasets/codepawl/plateau-city-glb/resolve/main/objects/tokyo-53392633/tokyo-53392633.glb', { decoders: { meshopt: MeshoptDecoder } });
const renderer = new Renderer67(document.querySelector('canvas'), asset.parts, { ground: true });
renderer.render({ eye: [1.5, 1.2, 2], target: [0, 0.5, 0] });

Tested

Every file was loaded and drawn (drawn pixels counted) in each engine, three.js 0.187.0 and 67js 0.15.0, files from a local copy of this repository.

Tier three.js WebGL three.js WebGPU 67js
web 797/797 797/797 797/797
ktx2 107/107 107/107 107/107
lod1 797/797 797/797 797/797
lod2 797/797 797/797 797/797
lod3 797/797 797/797 797/797
mobile 797/797 797/797 797/797
engine 797/797 797/797 797/797
collision 797/797 797/797 797/797

Blender 5.2 import: engine 797/797, objects 797/797, collision 797/797.

Licence and credit

Source: MLIT Project PLATEAU 3D city models (https://www.mlit.go.jp/plateau/), 2020 releases on G-spatial Information Center: Tokyo 23 wards (https://www.geospatial.jp/ckan/dataset/plateau-tokyo23ku), Osaka (https://www.geospatial.jp/ckan/dataset/plateau-27100-osaka-shi-2020), Yokohama (https://www.geospatial.jp/ckan/dataset/plateau-14100-yokohama-city-2020), Nagoya (https://www.geospatial.jp/ckan/dataset/plateau-23100-nagoya-shi-2020), Sapporo (https://www.geospatial.jp/ckan/dataset/plateau-01100-sapporo-shi-2020). Copyright of the data: each local government. Licence: CC-BY-4.0 (https://www.mlit.go.jp/plateau/site-policy/).

Changes made: Processed by CodePawl from the PLATEAU OBJ releases: cut into third-level mesh cells (about 1 km), buildings kept whole by their centre, LOD1 blocks under LOD2 buildings removed, LOD2 facade textures packed into atlases, roads draped on the terrain where the source had them at height 0, every layer moved to local metres around the cell centre (y up), then meshopt-compressed with WebP and KTX2 textures, simplified LODs, a phone tier, an uncompressed engine tier and LOD1 plus terrain collision meshes added. This is a modified copy made by CodePawl, not by MLIT or the local governments.

Source: https://www.mlit.go.jp/plateau/open-data/. Packed by CodePawl.