MCPcopy Index your code
hub / github.com/TerriaJS/terriajs

github.com/TerriaJS/terriajs @8.12.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 8.12.4 ↗ · + Follow
6,531 symbols 16,794 edges 1,278 files 410 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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.

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. Refer to the active mappings for a complete list of supported regions and how to reference them.
  • 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!

Extension points exported contracts — how you extend this code

LoginTokenPersistence (Interface)
* An interface getting and setting the user's Cesium ion login token obtained via OAuth2. [9 implementers]
packages/terriajs/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/CesiumIonConnector.tsx
IGlobalScss (Interface)
(no doc)
apps/terriamap/lib/Views/global.scss.d.ts
HasLocalData (Interface)
(no doc) [17 implementers]
packages/terriajs/lib/Models/HasLocalData.ts
ILoaderScss (Interface)
(no doc)
apps/terriamap/lib/Views/loader.scss.d.ts
SelectableDimensions (Interface)
Interface to be implemented by BaseModels (eg CatalogMembers) to add selectableDimensions [4 implementers]
packages/terriajs/lib/Models/SelectableDimensions/SelectableDimensions.ts
GeoJsonFunctionParameter (Interface)
(no doc) [5 implementers]
packages/terriajs/lib/Models/FunctionParameters/GeoJsonParameter.ts
Analytics (Interface)
(no doc) [3 implementers]
packages/terriajs/lib/Core/Analytics/types.ts

Core symbols most depended-on inside this repo

setTrait
called by 1561
packages/terriajs/lib/Models/Definition/Model.ts
isDefined
called by 939
packages/terriajs/lib/Core/isDefined.ts
get
called by 681
packages/terriajs/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/CesiumIonConnector.tsx
primitiveTrait
called by 660
packages/terriajs/lib/Traits/Decorators/primitiveTrait.ts
createStratumInstance
called by 407
packages/terriajs/lib/Models/Definition/createStratumInstance.ts
find
called by 232
packages/terriajs/lib/Models/Definition/ModelFactory.ts
forEach
called by 194
packages/terriajs/lib/Models/Definition/createCombinedModel.ts
set
called by 176
packages/terriajs/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/CesiumIonConnector.tsx

Shape

Method 2,642
Function 1,789
Class 1,320
Interface 742
Enum 38

Languages

TypeScript100%
Python1%

Modules by API surface

packages/terriajs/lib/Models/Catalog/Gtfs/GtfsRealtimeProtoBufReaders.ts70 symbols
packages/terriajs/lib/Models/BoxDrawing.ts68 symbols
packages/terriajs/lib/ReactViewModels/ViewState.ts62 symbols
packages/terriajs/lib/Models/Cesium.ts60 symbols
packages/terriajs/lib/ModelMixins/GeojsonMixin.ts60 symbols
packages/terriajs/lib/Models/Catalog/Ows/SensorObservationServiceCatalogItem.ts57 symbols
packages/terriajs/lib/Models/Terria.ts54 symbols
packages/terriajs/lib/Table/TableStyle.ts48 symbols
packages/terriajs/lib/Models/Catalog/Esri/ArcGisImageServerCatalogItem.ts46 symbols
packages/terriajs/lib/Map/Leaflet/LeafletVisualizer.ts46 symbols
packages/terriajs/lib/Models/Catalog/Esri/ArcGisMapServerCatalogItem.ts43 symbols
packages/terriajs/lib/Models/Catalog/CatalogItems/OpenDataSoftCatalogItem.ts43 symbols

For agents

$ claude mcp add terriajs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact