Coder Social home page Coder Social logo

terriajs-indexer's Introduction

Note: Experimental tool. Expect the API to break as we make changes

terriajs-indexer

A tool for generating search index for TerriaJS datasets.

Formats supported:

  • Cesium 3D Tiles
  • KML-glTFs

Installation

yarn install
yarn build

3d Tiles

Generating index for Cesium 3d Tiles

./bin/index-3d-tiles </path/to/tileset.json> </path/to/config.json> </path/to/output/directory>

Script parameters:

  1. Path to tileset.json file.
  2. An index configuration file (See sample configuration).
  3. An output directory to write the index

This generates an index in the given output directory. Check the indexRoot.json to see how the index is structured.

Indexer Configuration options

  • idProperty: string

    • Required
    • Name of the property to be used as the ID for indexing
  • indexes: Record<string, IndexConfig>

    • Required

    • An object with the property name as the key and an index configuration as its value. Only the properties specified in this object will be indexed.

      To index the automatically computed feature heights, use a configuration like:

       "indexes": {"height": {"type": "numeric"}}

Index configuration

The configuration for an individual properties index.

  • type: string
    • Required
    • The type of the index.

KML-glTF files

Generating index for KML-glTF files

The KML files should be formatted as given below:

<Placemark>
  <name>Independence Hall</name>
  <Model>
    <Link><href>123.gltf</href></Link>
    <Location>
      <longitude>152.78600626966184</longitude>
      <latitude>-27.54602173027532</latitude>
      <altitude>78.79797821225782</altitude>
    </Location>
  </Model>
  <ExtendedData>                       
    <Data name="Address">
      <value>500-36 CHESTNUT ST</value>
    </Data>
    <Data name="Parcel_ID">
      <value>313762</value>
    </Data>
    <Data name="Is_City_Owned">
      <value>True</value>
    </Data>
  </ExtendedData> 
</Placemark>
./bin/index-kml-gltf </path/to/kml-gltfs> </path/to/config.json> </path/to/output/directory>

The index configuration format is similar to configuration in the 3d-tiles example.

terriajs-indexer's People

Contributors

na9da avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ykiu

terriajs-indexer's Issues

Use gltf-transform for reading glTF files

Currently we use custom code for reading glTF json and meshes. However, this implementation is pretty simple and does not support extensions like Draco compression which are becoming common.

Switching to gltf-transform library will ensure support for a wide range of input.

Remove duplication of type definitions by importing them from TerriaJS

Currently we duplicate the type definitions in Index which is also defined in [Terria]. This is bad because we have to make changes in two places. Instead, we should import the definitions from Terria.

I had some trouble adding Terria as a dependency and getting it to build properly.
Investigate and fix this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.