RisegerDB is an open-source spatial database system designed for efficient spatial data retrieval using R-trees and R*-trees as the primary indexes. This document provides an overview of the startup procedures, example usage, and the syntax for SQL commands supported by RisegerDB.
The name of this project, RisegerDB, is derived from Rapid Search of Geographic Database (Ri-se-ger-DB), emphasizing its focus on fast and efficient searching of geographic data.
To start RisegerDB, use the following startup scripts:
./scripts/startup.sh
./scripts/shell.sh
Here is an example sequence of commands using RisegerDB:
get databases
preload './test/test_data.json';
use database 'test_db';
get maps;
USE
DATABASE 'test_db'|
MAP 'china_mp'|
SCOPE RECT(
[1, 2],
20000
)|
MODEL province_scope.area_scope.building_model
SEARCH
building_model.KEY_LOOP,
building_model.name
WHERE
IN RECT(
[4000, 1000],
5000
)
OR OUT RECT(
[777.5, 72658.1],
45.2
)
AND building_model.floorArea > 1000;
USE use_clause SEARCH search_clause WHERE where_clause
USE use_clause SEARCH search_clause
SEARCH search_clause WHERE where_clause
USE use_clause
SEARCH search_clause
WHERE where_clause
GET DATABASES
GET MAPS
GET MODELS
PRELOAD 'file_path'
use_statement "|" use_statements
use_statement
use_statement:
DATABASE 'database_name'
| MAP 'map_name'
| SCOPE rectangle_expression
| MODEL 'model_expression'
search_clause: strings_expression
where_clause: bool_condition
bool_condition:
"(" bool_condition ")"
| bool_condition_0 "OR" bool_condition_0
| bool_condition_0
bool_condition_0:
bool_condition_1 "AND" bool_condition_1
| bool_condition_1
bool_condition_1:
"!" bool_condition_2
| bool_condition_2
bool_condition_2:
"IN" graphic_expression
| "OUT" graphic_expression
| bool_condition_3
bool_condition_3:
num_condition ">" bool_condition_3
| num_condition ">=" bool_condition_3
| num_condition "<" bool_condition_3
| num_condition "<=" bool_condition_3
| num_condition "=" bool_condition_3
| num_condition
num_condition:
"(" num_condition ")"
| "-" num_condition
| num_condition_0
num_condition_0:
| num_condition_1 "+" num_condition
| num_condition_1 "-" num_condition
| num_condition_1
num_condition_1:
number_entity "*" num_condition
| number_entity "/" num_condition
| number_entity
attribute_expression:
string "." string
graphic_expression:
rectangle_expression
rectangle_expression:
"RECT" "(" coord_expression "," num_condition ")"
coord_expression:
"COORD" "(" num_condition "," num_condition ")"
strings_expression:
string_entity "," strings_expression
| string_entity
number_entity:
number
| attribute_expression
string_entity:
string
| attribute_expression
END:number
END:string
Feel free to use, modify, and contribute to RisegerDB. For more detailed information and updates, check the official RisegerDB repository.
Happy coding! END:string
string_entity -> string | attribute_expression END:number :> org.riseger.protocol.compiler.function.Entity_f END:string :> org.riseger.protocol.compiler.function.Entity_f