Convert Figma logo to code with AI

TerriaJS logoterriajs

A library for building rich, web-based geospatial 2D & 3D data platforms.

1,262
381
1,262
912

Top Related Projects

13,852

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:

OpenLayers

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL

43,292

πŸƒ JavaScript library for mobile-friendly interactive maps πŸ‡ΊπŸ‡¦

13,390

WebGL2 powered visualization framework

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.

Quick Overview

TerriaJS is an open-source web-based geospatial data visualization and analysis platform. It provides a flexible and customizable framework for building interactive web applications that can display and explore a wide range of geospatial data, including maps, satellite imagery, and 3D terrain.

Pros

  • Flexible and Customizable: TerriaJS is designed to be highly customizable, allowing developers to create tailored web applications that meet their specific needs.
  • Extensive Data Support: TerriaJS supports a wide range of geospatial data formats, including GeoJSON, Shapefile, and various raster formats, making it suitable for a diverse range of use cases.
  • Interactive Visualization: TerriaJS provides a range of interactive visualization tools, such as 3D terrain rendering, time-series animations, and data overlays, enabling users to explore and analyze geospatial data in depth.
  • Open-Source and Community-Driven: TerriaJS is an open-source project, with a growing community of contributors and users, ensuring ongoing development and support.

Cons

  • Steep Learning Curve: Developing with TerriaJS may have a steeper learning curve, especially for developers who are new to web-based geospatial applications.
  • Performance Limitations: Depending on the size and complexity of the data being visualized, TerriaJS may experience performance issues, particularly on older or less powerful devices.
  • Limited Mobile Support: While TerriaJS is designed to be responsive, its user interface and functionality may not be as optimized for mobile devices as for desktop environments.
  • Dependency on External Libraries: TerriaJS relies on several external libraries and frameworks, which can introduce additional complexity and potential compatibility issues.

Code Examples

// Initializing a TerriaJS application
const terria = new Terria({
  baseUrl: 'https://example.com/terriajs/',
  cesiumBaseUrl: 'https://example.com/cesium/'
});

// Adding a data source to the application
const dataSource = new CatalogItem(terria, {
  name: 'My Data Source',
  type: 'geojson',
  url: 'https://example.com/data.geojson'
});
terria.addInitSource(dataSource);

// Customizing the user interface
terria.userInterface = new UserInterface(terria, {
  showFeedbackButton: true,
  showHelpButton: true,
  showShareButton: true
});
// Handling user interactions
terria.workbench.on('dataSourceAdded', (dataSource) => {
  console.log('New data source added:', dataSource.name);
});

terria.currentViewer.camera.on('cameraChanged', (camera) => {
  console.log('Camera position changed:', camera.position);
});
// Integrating external data sources
const wmsProvider = new WebMapServiceCatalogItem(terria, {
  name: 'WMS Data',
  url: 'https://example.com/wms',
  layers: 'layer1,layer2'
});
terria.addInitSource(wmsProvider);

Getting Started

To get started with TerriaJS, follow these steps:

  1. Install Node.js: TerriaJS requires Node.js to be installed on your system. You can download the latest version from the official website: https://nodejs.org/.

  2. Clone the TerriaJS repository: Clone the TerriaJS repository from GitHub:

    git clone https://github.com/TerriaJS/terriajs.git
    
  3. Install dependencies: Navigate to the cloned repository and install the required dependencies:

    cd terriajs
    npm install
    
  4. Start the development server: Run the following command to start the development server:

    npm start
    

    This will start the TerriaJS development server and open the application in your default web browser.

  5. Customize the application: Explore the TerriaJS documentation to learn how to customize the application, add data sources, and integrate it into your own projects.

Competitor Comparisons

13,852

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:

Pros of Cesium

  • More comprehensive 3D geospatial visualization library
  • Larger community and wider adoption in various industries
  • Better performance for complex 3D scenes and large datasets

Cons of Cesium

  • Steeper learning curve for beginners
  • Less focus on data catalog and sharing features
  • Requires more custom development for creating full-featured mapping applications

Code Comparison

Cesium example:

const viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.globe.enableLighting = true;
viewer.scene.camera.flyTo({
  destination: Cesium.Cartesian3.fromDegrees(-122.4, 37.8, 5000)
});

TerriaJS example:

const terria = new Terria({
  baseUrl: '.',
  useCorsProxy: false
});
terria.start({
  configUrl: 'config.json',
  applicationUrl: 'index.html'
});

TerriaJS is built on top of Cesium and provides a higher-level abstraction for creating web-based geospatial data platforms. It offers a more opinionated approach to building mapping applications with built-in data catalog and sharing features. Cesium, on the other hand, is a lower-level library that provides more flexibility and control over 3D geospatial visualizations but requires more custom development to create full-featured applications.

OpenLayers

Pros of OpenLayers

  • More mature and widely adopted project with a larger community
  • Extensive documentation and examples
  • Supports a broader range of mapping use cases and data formats

Cons of OpenLayers

  • Steeper learning curve for beginners
  • Requires more configuration and setup for advanced features
  • Less focus on 3D visualization capabilities

Code Comparison

TerriaJS example:

const viewer = new Cesium.Viewer('cesiumContainer');
const terria = new Terria({
    baseUrl: '.',
    cesiumBaseUrl: Cesium.buildModuleUrl('.')
});

OpenLayers example:

const map = new ol.Map({
    target: 'map',
    layers: [
        new ol.layer.Tile({
            source: new ol.source.OSM()
        })
    ],
    view: new ol.View({
        center: [0, 0],
        zoom: 2
    })
});

TerriaJS is built on top of Cesium and focuses on creating interactive 3D geospatial data catalogs, while OpenLayers is a more general-purpose mapping library with a focus on 2D map rendering. TerriaJS provides a higher-level abstraction for working with geospatial data, while OpenLayers offers more flexibility and control over map rendering and interactions.

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL

Pros of mapbox-gl-js

  • More lightweight and focused on core mapping functionality
  • Extensive documentation and large community support
  • Better performance for rendering large datasets

Cons of mapbox-gl-js

  • Less out-of-the-box features for data visualization and analysis
  • Requires more custom development for advanced geospatial applications
  • Limited support for 3D terrain and volumetric data

Code Comparison

mapbox-gl-js:

mapboxgl.accessToken = 'YOUR_ACCESS_TOKEN';
const map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v11',
    center: [-74.5, 40],
    zoom: 9
});

terriajs:

const terria = new Terria({
    baseUrl: BASE_URL,
    cesiumBaseUrl: CESIUM_BASE_URL
});
terria.start({
    configUrl: 'config.json',
    applicationUrl: 'init/terria.json'
});

Summary

mapbox-gl-js is a lightweight, high-performance mapping library focused on core functionality, while terriajs offers a more comprehensive geospatial data platform with additional features for visualization and analysis. mapbox-gl-js may be better suited for simpler mapping projects, while terriajs excels in complex geospatial applications and data exploration scenarios.

43,292

πŸƒ JavaScript library for mobile-friendly interactive maps πŸ‡ΊπŸ‡¦

Pros of Leaflet

  • Lightweight and fast, with a smaller file size
  • Simpler API, easier to learn and use for basic mapping needs
  • More extensive plugin ecosystem for additional functionality

Cons of Leaflet

  • Limited 3D mapping capabilities
  • Less built-in support for complex data visualization
  • Fewer out-of-the-box features for advanced geospatial analysis

Code Comparison

Leaflet

var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: 'Β© OpenStreetMap contributors'
}).addTo(map);

TerriaJS

var viewer = new Cesium.Viewer('cesiumContainer');
var terriaMap = new Terria({
    baseUrl: './',
    cesiumBaseUrl: 'build/Cesium'
});
terriaMap.start();

Summary

Leaflet is ideal for simple, lightweight 2D mapping applications, while TerriaJS offers more advanced features for complex geospatial visualization and analysis, including 3D capabilities. Leaflet's simplicity makes it easier to learn and use for basic needs, but TerriaJS provides more built-in functionality for sophisticated geospatial projects.

13,390

WebGL2 powered visualization framework

Pros of deck.gl

  • More flexible and customizable for building complex visualizations
  • Better performance for large datasets and real-time rendering
  • Extensive documentation and examples for various use cases

Cons of deck.gl

  • Steeper learning curve, especially for developers new to WebGL
  • Less out-of-the-box functionality for geospatial data visualization
  • Requires more setup and configuration for basic map applications

Code Comparison

deck.gl example:

import {Deck} from '@deck.gl/core';
import {GeoJsonLayer} from '@deck.gl/layers';

new Deck({
  layers: [new GeoJsonLayer({id: 'geojson', data: GEOJSON_DATA})]
});

TerriaJS example:

import Terria from 'terriajs';

const terria = new Terria({
  baseUrl: 'build/TerriaJS'
});
terria.start();

Summary

deck.gl offers more flexibility and performance for custom visualizations, while TerriaJS provides a more comprehensive solution for geospatial data exploration out of the box. deck.gl requires more setup but allows for greater customization, whereas TerriaJS offers a quicker start for map-based applications with less initial configuration.

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.

Pros of tileserver-gl

  • Lightweight and focused on serving vector tiles
  • Supports multiple tile formats (mbtiles, pmtiles, etc.)
  • Easy to set up and configure for basic tile serving

Cons of tileserver-gl

  • Limited to tile serving and basic styling
  • Less extensive data analysis and visualization capabilities
  • Smaller community and ecosystem compared to TerriaJS

Code Comparison

TerriaJS (JavaScript):

const viewer = new Cesium.Viewer('cesiumContainer');
const terriaMap = new Terria({
    baseUrl: './build/TerriaJS',
    cesiumBaseUrl: '../../node_modules/terriajs-cesium/build/Cesium'
});
terriaMap.start();

tileserver-gl (JavaScript):

const tileserver = require('tileserver-gl');
const config = {
    styles: 'styles/',
    data: 'data/'
};
tileserver.serve(config);

TerriaJS offers a more comprehensive geospatial data visualization platform with advanced features for data analysis and interactive mapping. It provides a rich set of tools for creating complex, interactive 3D and 2D maps with support for various data sources.

tileserver-gl, on the other hand, is a simpler solution focused on serving vector tiles efficiently. It's ideal for projects that primarily need to serve map tiles without extensive data visualization or analysis requirements.

While TerriaJS offers more flexibility and features, tileserver-gl excels in its simplicity and efficiency for basic tile serving tasks. The choice between the two depends on the specific needs of your project and the level of complexity required in your mapping application.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

TerriaJS

Build Status NPM Version Docs

Terria logo

TerriaJS is a library for building rich, web-based geospatial data explorers, used to drive Digital Earth Australia Map, NSW Spatial Digital Twin (and many others). It uses Cesium and WebGL for a full 3D globe in the browser with no plugins. It gracefully falls back to 2D with Leaflet on systems that can't run Cesium. It can handle catalogs of tens of thousands of layers, with dozens of geospatial file and web service types supported. It is almost entirely JavaScript in the browser, meaning it can even be deployed as a static website, making it simple and cheap to host.


We have just released a brand new version of Terria β€” verson 8!

We've put together a list of things we've removed from version 8 and some steps to help you migrate to the new version in our migration guide

Not ready to move to version 8 yet? You can find terriajs version 7 here: https://github.com/TerriaJS/terriajs/tree/terriajs7


Features

  • Nested catalog of layers which can be independently enabled to create mashups of many layers.
  • Supports GeoJSON, KML, CSV (point and region-mapped), GPX, GeoRSS, CZML and zipped shapefile file types natively.
  • Supports WMS, WFS, WMTS, Esri MapServer, Esri FeatureServer, Bing Maps, Carto Maps, Cesium Ion Imagery, OpenStreetMap-style raster tiles, Mapbox, SDMX, 3D Tiles and GTFS and Sensor Observation Service item types.
  • Supports querying WMS, WFS, Esri MapServer, CSW, CKAN, Socrata, OpenDataSoft and SDMX services for groups of items.
  • 3D globe (Cesium) or 2D mode (Leaflet). 3D objects supported in CZML format.
  • Time dimensions supported for CSV, CZML, WMS. Automatically animate layers, or slide the time control forward and backward.
  • Drag-and-drop files from your desktop to the browser, for instant visualisation (no file upload to server required).
  • All ASGS (Australian Statistical Geographic Standard) region types (LGA, SA2, commonwealth electoral district etc) supported for CSV region mapping, plus several others: Primary Health Networks, Statistical Local Areas, ISO 3 letter country codes, etc.
  • Users can generate a reusable URL link of their current map view, to quickly share mashups of web-hosted data.
  • The interface is internationalised and translations are available for French, Italian and Japanese. Partial translations have also been contributed for other languages (see TerriaJS weblate)

Terria screenshot

Who's using TerriaJS?

Sites developed by Data61

Not Data61

Sites we're aware of that are using TerriaJS. These are not endorsements or testimonials.

Technical

  • NodeJS v20 and later are supported
  • Built in TypeScript & ES2020+ JavaScript, compiled with Babel to ES5.
  • Supports modern browsers (recent versions of Microsoft Edge, Mozilla Firefox & Google Chrome).
  • TerriaJS Server component runs in NodeJS and provides proxying for web services that don't support CORS or require authentication. Instead of using TerriaJS-Sever proxy service, an alternative proxying service URL can be specified. See Specify an alternative proxy server URL
  • Dependencies are managed in NPM and assembled using WebPack.

Getting Started

The easiest way to build your own Terria-based map is using the TerriaMap starting point. This gives you the HTML structure, server and build processes you need to get a site up and running immediately.

See Getting Started in the Documentation for all the details.

Components and naming

  • Terria҄’ is the overall name for the spatial data platform and the team that built TerriaJS.
  • TerriaJS is this TypeScript/JavaScript library consisting of the 2D/3D map, catalog management and many spatial data connectors.
  • Cesium is the 3D WebGL rendering library used by TerriaJS, which provides many low-level functions for loading and displaying imagery and spatial formats such as GeoJSON and KML.
  • TerriaMap is a complete website starting point, using TerriaJS.
  • TerriaJS-Server is a NodeJS-based server that provides proxying and support services for TerriaJS.
  • NationalMap is the flagship Terria deployment, and the origin of the TerriaJS library.

Related components

  • TerriaMapStatic, a pre-built version of TerriaMap, which can be deployed as a static HTML website, such as on Github Pages.

Big Thanks

Hosting and contribution framework for community translations of TerriaJS provided by Weblate under the Libre plan for open source software. See our translation progress for different languages:

Translation status

Join the community

Get in touch!

NPM DownloadsLast 30 Days