• Stars
    star
    59
  • Rank 492,243 (Top 10 %)
  • Language
    Erlang
  • License
    Other
  • Created over 11 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Erlang implementation of the R*-tree spacial data structure

Erlang Rstar Build Status

This application provides a pure Erlang implementation of the R*-tree data structure. The R*-tree structure is particularly suited for indexing multi-dimensional data, with relatively low dimensionality. It is a commonly used data structure for geo-spacial data for this reason. In addition to efficiently supporting window queries, it can also quickly find the nearest neighbors of a point.

This implementation is in-memory only and does not provide builtin support for disk-backed usaged.

Modules

  • rstar : The primary top level module used to manipulate the tree
  • rstar_geometry : Used to modify the geometry type associated with trees
  • rstar_util: Contains a various utility methods that may be useful

Usage

Below are some examples of usage. Simple creation of trees and population of points:

% Creates a two dimensional R-tree
Tree = rstar:new(2),

% Create a point, at X:1, Y:3, opaque value foo
Point = rstar_geometry:point2d(1, 3, foo),

% Insert into the tree, returning a new tree
T2 = rstar:insert(Tree, Point),

% Delete the point
T3 = rstar:delete(T2, Point).

Creating various geometries:

% Create a 2D box from the origin to 2,2
Box = rstar_geometry:new(2, [{0, 2}, {0, 2}], small_box),

% Create a 3D box
Box3D = rstar_geometry:new(3, [{2, 3}, {2, 3}, {2, 3}], three_d_box),

% Create a 3D point
Point3D = rstar_geometry:point3d(0, 1, 2, point3d),

% Create a 4D point at the origin
Origin4D = rstar_geometry:origin(4).

Various queries:

% Create a tree and populate it
T = rstar:new(2),
....
TFinal = rstar:insert(...),

% Do box query
Box = rstar_geometry:new(2, [{0, 2}, {0, 2}], small_box),
Matching = rstar:search_within(TFinal, Box),

% Do a circular query around a point within a distance of 10 units
% Distance is Euclidean distance
Point = rstar_geometry:point2d(1, 3, undefined),
Matching = rstar:search_around(TFinal, Point, 10.0),

% Find the nearest 20 points
Matching = rstar:search_nearest(TFinal, Point, 20),

Dependencies

Requires Erlang 18.0 or higher.

References

Related works:

More Repositories

1

go-socks5

SOCKS5 server in Golang
Go
1,844
star
2

bloomd

C network daemon for bloom filters
C
1,238
star
3

go-radix

Golang implementation of Radix trees
Go
846
star
4

libart

Adaptive Radix Trees implemented in C
C
745
star
5

hlld

C network daemon for HyperLogLogs
C
446
star
6

go-proxyproto

Golang package to handle HAProxy Proxy Protocol
Go
198
star
7

circbuf

Golang circular (ring) buffer
Go
168
star
8

relay

Golang framework for simple message passing using an AMQP broker
Go
131
star
9

go-chord

Golang implementation of the Chord protocol
Go
130
star
10

consul-api

Golang API client for Consul
Go
123
star
11

pypred

A Python library for simple evaluation of natural language predicates
Python
57
star
12

c-minheap-array

Implements a Min-Heap / Priority Queue in C using a simple array.
C
54
star
13

counterd

A lightweight daemon for counting unique events using Redis and PostgreSQL
Go
35
star
14

consul-kv

Golang K/V client for Consul
Go
33
star
15

DjangoProjectExample

An example Django project
Python
28
star
16

c-minheap-indirect

Implements a Min-Heap / Priority Queue in C using an indirection table for memory efficiency.
C
28
star
17

go-hlld

Golang client for HyperLogLog daemon (hlld)
Go
21
star
18

cse473-ai-csp

A Constraint Satisfaction Solver (CSP) using Backtracking and Forward Checking
Java
21
star
19

cuda-hll

A CUDA accelerated utility for using HyperLogLog's for cardinality estimation
18
star
20

teles

An Erlang network service for manipulating geographic data
Erlang
15
star
21

bloomd_ring

Provides a Riak core interface to bloomd to allow for horizontal scalability and high availability
Erlang
14
star
22

Erlang-Naive-Bayes-Movies

An Erlang naive bayes text classifier to classify movie reviews as positive or negative.
Erlang
13
star
23

pyhlld

A Python driver for the hlld server
Python
10
star
24

ememcached

An Erlang Implementation of the Memcached binary protocol
Erlang
9
star
25

erl-bloomd

An Erlang driver for speaking the Bloomd network protocol
Erlang
8
star
26

DotFiles

Misc. dot files
Vim Script
3
star
27

pyteles

A Python client for the Teles server
Python
1
star