Skip to content
프로젝트

소개

Three.js shape loaders for GeoJSON and WKT formats

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

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.

관련 프로젝트 살펴보기

불러오는 중…