Skip to content
Projects

gkjohnson/three-geojson has 242 GitHub stars and 22 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 23:36 UTC. Last push 2026-09-30.

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

Three.js shape loaders for GeoJSON and WKT formats

Creative & Media

README.md

Original

three-geojson

build docs github twitter sponsors

Three.js shape loaders for GeoJSON (readable html) and WKT formats. Supports generation of three.js line geometry in addition to flat and extruded tringulated meshes. All generated geometry are transformed and centered using 64-bit Javascript floating point operations with meshes are offset to retain precision in GPU operations.

Uses @turfjs/unkink-polygon, @mapbox/delaunator, @kninnug/constrainautor, and @placemark/betterknown packages for polygon triangulation and WKT parsing. World GeoJSON file courtesy of geojson-maps.

Some key features supported by this project:

  • Support for detecting and fixing self-intersecting polygons so they tringulate correctly.
  • Uses constrained delaunay triangulation for correct, high quality triangulation and support for inner vertices.
  • Smooth surface normals are generated for ellipsoid-projected shapes.
  • Outputs centered geometry with and matrix transform offset to avoid preceision-related artifacts on CPU and GPU when processing high-detail shapes.
  • Supports altitude values.

[!NOTE] This project is not hosted on npm and must be installed via Github repository.

Examples

WGS84 Lines

WGS84 Extruded Polygons

WGS84 Wireframe Polygons

Extruded Polygon

WKT Polygon

Installation

npm install github:@gkjohnson/three-geojson

Use

// load the content
const result = await new GeoJSON().loadAsync( url );

// extract polygon lines and project them onto the globe
const transformer = new GeoJSONTransformer();
result.polygons.forEach( polygon => {

  const line = polygon.getLineObject();
  transformer.transformObject( line );
  scene.add( line );

} );

API

See the docs site for full API documentation.

The same documentation is also available as markdown in API.md.