Skip to content

Latest commit

 

History

History
193 lines (148 loc) · 3.95 KB

README-eng.md

File metadata and controls

193 lines (148 loc) · 3.95 KB

RisegerDB - README

image

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.

RisegerDB

中文

Getting Started

To start RisegerDB, use the following startup scripts:

./scripts/startup.sh
./scripts/shell.sh

Example Usage

Here is an example sequence of commands using RisegerDB:

get databases

image

preload './test/test_data.json';

use database 'test_db';

get maps;

image

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;

image

SQL Syntax

Search SQL

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

Create SQL

PRELOAD 'file_path'

Use Statements

use_statement "|" use_statements
use_statement

use_statement:
  DATABASE 'database_name'
  | MAP 'map_name'
  | SCOPE rectangle_expression
  | MODEL 'model_expression'

Search Clause

search_clause: strings_expression

Where Clause

where_clause: bool_condition

Boolean Conditions

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

Entity Definitions

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