PlanetX Lite 0.22.0 - a 3D globe in Rust and wgpu for desktop and WebAssembly, now with GIS file layers

PlanetX Lite is a 3D globe viewer. One Cargo workspace builds a desktop program for Windows, Linux and macOS and the same program for wasm32-unknown-unknown as a web page:

It shows terrain, imagery and labels, opens KML/KMZ and scenes from our QGIS plugin, plays tours and shows point clouds and 3D models. Version 0.22.0 adds vector file layers - GeoPackage, Shapefile, GeoJSON, GPX, GML, MapInfo, FlatGeobuf, DXF and DWG - with styles, labels by a field and extrusion by a number field.

Some details that may be of interest:

  • Rendering is wgpu, the same code on desktop and in the browser.
    • World coordinates are ECEF on WGS84 in f64. The GPU only gets offsets from tile centres and an eye-relative matrix, so there is no float32 jitter at street level.
    • XYZ Web Mercator tiles, levels chosen by screen-space error with a 1.5 px threshold, skirts at tile edges. A tile is replaced by its children only when they are ready, so there are no holes by construction.
    • Camera flights use the van Wijk-Nuij method.
    • Network never blocks the main thread, also on the web. Time is web_time, not std::time.
    • Add-ins are WebAssembly modules run by wasmi in a sandbox with a narrow versioned API, in the program and on the page.
    • Input files are treated as hostile. There is no unsafe, unwrap, expect or panic! in production code.
    • File formats are read with the terrio crate.
      License Apache 2.0. Builds are not signed yet, so Windows and macOS warn on first start.

Source and downloads: GitHub - Valery35/planetx-lite: 3D globe in Rust for Windows, Linux, macOS and the browser - terrain, imagery, KML/KMZ, tours, GeoPackage, Shapefile, GeoJSON, DXF layers, point clouds and 3D models · GitHub

Feedback on the architecture is welcome.

PlanetX Lite 0.23.0 is out.

  • My layers stay between launches: the objects of a layer are written as GeoJSON into the user data folder (dirs::data_dir), the list and styles go to the eframe storage. On the web page they stay in localStorage up to 1 MB.
  • Layers gather in folders, "Save as GeoJSON" exports a layer with all fields.
  • One Recognition window replaces four analysis windows. On "OK" the class raster is also traced into smoothed polygons (merge of small regions, shared border chains, Potrace-like corners) that become a coloured layer.

Release: Release PlanetX Lite 0.23.0 · Valery35/planetx-lite · GitHub
Issues: Sign in to GitHub · GitHub