repository

package
v0.0.0-...-313f127 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object interface {
	// ID returns an unique ID of the object
	ID() int64
	// Bounds returns the bounding box of the object.
	Bounds() *vec3.Box
	// GeometryData returns raw geometry data of the object
	GeometryData() []byte
	// Metadata returns arbitrary JSON-convertible metadata for
	// the object.
	Metadata() interface{}
}

type Repository

type Repository interface {
	// Add puts the object given in the database. Returns the ID of the inserted
	// object or an error.
	Add(o db.Object) (int64, error)
	// GetInsideVolume returns all objects inside the bounding box. Returns two channels,
	// one for geometry object and one for error. The operation is aborted on the first error.
	// Optionally, one or more Options may be provided to alter the behaviour of the
	// operation.
	GetInsideVolume(bounds vec3.Box, options ...interface{}) (<-chan db.Object, <-chan error)
	// GetInsideVolumeIDs returns the same result as GetInsideVolume, but only returns
	// object IDs as a flat array rather than a channel of objects.
	GetInsideVolumeIDs(bounds vec3.Box, options ...interface{}) ([]int64, error)
	// GetWithIds returns objects with the given IDs. Returns two channels,
	// one for geometry object and one for error. The operation is aborted on the first error.
	GetWithIDs(ids []int64) (<-chan db.Object, <-chan error)
	// GetWithID returns object the the given ID, or an error if the operation fails.
	GetWithID(id int64) (db.Object, error)
}

Repository represents a spatial database with fast spatial lookups.

func NewRepository

func NewRepository(database db.Objects) (Repository, error)

type SimpleObject

type SimpleObject struct {
	// contains filtered or unexported fields
}

func NewSimpleObject

func NewSimpleObject(bounds vec3.Box, geometryData []byte, metadata interface{}) *SimpleObject

func (*SimpleObject) Bounds

func (o *SimpleObject) Bounds() *vec3.Box

func (*SimpleObject) GeometryData

func (o *SimpleObject) GeometryData() []byte

func (*SimpleObject) ID

func (o *SimpleObject) ID() int64

func (*SimpleObject) Metadata

func (o *SimpleObject) Metadata() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL