GanosBase includes built-in spatial indexes for Lindorm. When you insert spatio-temporal data, you specify which indexes to create — no manual key-value pair design for HBase tables required. Define the index table schema before inserting any data.
GanosBase supports five types of indexes. By default, all five types of indexes are created, which delivers optimal query performance across all scenarios but uses more storage. To reduce storage usage, create only the index types that match your query patterns.
Index types
Use the following table to match your geometry types and query patterns to the appropriate indexes.
| Index | Geometry | Query type |
|---|---|---|
| ID | Any | Feature ID (FID) lookup; FID must be unique |
| Z2 | Point objects | Spatial queries (geo-fence, range) |
| XZ2 | Line objects, polygons | Spatial queries (geo-fence, range) |
| Z3 | Point objects | Spatio-temporal queries (historical trajectory in a spatial range and time period) |
| XZ3 | Line objects, polygons | Spatio-temporal queries |
| XZ2T | Line objects, polygons | Spatio-temporal queries; more effective for trajectory line model queries |
| XYZ | Point objects only | Three-dimensional queries (longitude, latitude, elevation) |
| Attribute | N/A | Queries on other attribute columns |
How it works
Creating an index table involves two steps:
Specify a
SimpleFeatureTypethat defines the spatial or spatio-temporal data type:Set the schema name. A schema corresponds to an index table.
Define the schema columns: attribute, geometry, and date columns.
(Optional) Set additional parameters: compression method, Tiny Well-Known Binary (TWKB) format, and index-specific parameters.
Create objects based on the specified
SimpleFeatureType.
Create specific indexes
By default, GanosBase creates all five types of indexes. To create only specific indexes, set geomesa.indices.enabled on the SimpleFeatureType before calling createSchema:
// sft is an instance of SimpleFeatureType.
sft.getUserData().put("geomesa.indices.enabled", "{index_name}:{col1}:{col2}:...,{index_name}:{col}");Parameter reference:
| Parameter | Description |
|---|---|
index_name | Index type. Valid values: id, attr, z2, z3, xz2, xz3, xyz |
col | Column name defined in the SimpleFeatureType |
Separate multiple indexes with commas (
,).Separate an index name and its columns with colons (
:).
Example: Create Z3 and attribute indexes only.
The Z3 index covers the start+dtg column pair and the end+dtg column pair. The attribute index covers name+dtg.
sft.getUserData().put("geomesa.indices.enabled", "z3:start:dtg,z3:end:dtg,attr:name:dtg");Spatio-temporal secondary index
GanosBase builds spatio-temporal secondary indexes on top of the native secondary indexes supported by Lindorm. A secondary index on a serialized spatio-temporal column is ineffective.
To make a secondary index work, add an encoded spatio-temporal column to the primary table first. This column stores the space-filling curve encoded values of the spatio-temporal attributes. The secondary index is then built on this encoded column.
By default, no redundant columns exist in the secondary index table. Redundant columns will be supported in future versions.
Limitations
Do not create an index table while historical data synchronization is in progress.