Documentation
¶
Index ¶
- Constants
- Variables
- func NewUUID() (string, error)
- func NewUUID2() (string, error)
- func Round(f float64) float64
- func RoundToPrecision(f float64, places int) float64
- type Database
- func (self *Database) CommitQueueLength() int
- func (self *Database) DeleteLayer(datasource_id string) error
- func (self *Database) EditFeature(datasource_id string, geo_id string, feat *geojson.Feature) error
- func (self *Database) GetLayer(datasource_id string) (*geojson.FeatureCollection, error)
- func (self *Database) GetLayers() ([]string, error)
- func (self *Database) Init()
- func (self *Database) InsertFeature(datasource_id string, feat *geojson.Feature) error
- func (self *Database) InsertLayer(datasource_id string, geojs *geojson.FeatureCollection) error
- func (self *Database) InsertTimeseriesDatasource(datasource_id string, ddata diffstore.DiffStore) error
- func (self *Database) NewLayer() (string, error)
- func (self *Database) SelectTimeseriesDatasource(datasource_id string) (diffstore.DiffStore, error)
- func (self *Database) StartCommitLog()
- func (self *Database) UpdateTimeseriesDatasource(datasource_id string, value []byte) error
Constants ¶
const ( // DEFAULT_PRECISION decimal decimal for storing latitude and longitude. DEFAULT_PRECISION int = 6 //8 // DEFAULT_DATABASE_TABLE Database table used to store data. DEFAULT_DATABASE_TABLE string = "GeoJsonDatasources" )
Variables ¶
var ( // COMMIT_LOG_FILE database commit log file path COMMIT_LOG_FILE string = "geo_skeleton_commit.log" )
Functions ¶
func NewUUID ¶
NewUUID generates and returns url friendly uuid. Source: http://play.golang.org/p/4FkNSiUDMg.
func Round ¶
Round float64. Source: https://gist.github.com/DavidVaini/10308388
func RoundToPrecision ¶
RoundToPrecision rounds float64 to specified decimal precision. Source: https://gist.github.com/DavidVaini/10308388
Types ¶
type Database ¶
type Database struct {
Table string
File string
Precision int
DB skeleton.Database
// contains filtered or unexported fields
}
Database struct for application.
func (*Database) CommitQueueLength ¶
CommitQueueLength returns length of database commit_log_queue.
func (*Database) DeleteLayer ¶
DeleteLayer deletes geojson layer from database
func (*Database) EditFeature ¶
EditFeature edits geojson feature within geojson layer. Updates geojson layer in Database
func (*Database) GetLayer ¶
GetLayer returns geojson layer from database TODO: Switch to timeseries datasource
func (*Database) Init ¶
func (self *Database) Init()
Initiates database. Creates required database tables and starts commit log.
func (*Database) InsertFeature ¶
InsertFeature adds geojson feature to geojson layer. Updates layer in database
func (*Database) InsertLayer ¶
InsertLayer inserts geojson layer into database TODO: Switch to timeseries datasource
func (*Database) InsertTimeseriesDatasource ¶
func (self *Database) InsertTimeseriesDatasource(datasource_id string, ddata diffstore.DiffStore) error
InsertTimeseriesDatasource inserts timeseries geojson layer to database
func (*Database) NewLayer ¶
NewLayer creates new geojson layer. Writes new layer to database. TODO: RENAME TO NewDatasource
func (*Database) SelectTimeseriesDatasource ¶
SelectTimeseriesDatasource selects timeseries geojson layer from database
func (*Database) StartCommitLog ¶
func (self *Database) StartCommitLog()
Starts Database commit log.
