Documentation
¶
Index ¶
- Constants
- type DetailsEntity
- type Storage
- func (s *Storage) BeginTxx() (*sqlx.Tx, error)
- func (s *Storage) Close()
- func (s *Storage) CommitTxx(txx *sqlx.Tx) error
- func (s *Storage) CreatePartitionTableIfNotExist(txx *sqlx.Tx, tableName string)
- func (s *Storage) GenerateTableName(key quadmap.QuadKey) string
- func (s *Storage) GetAllDetails() ([]DetailsEntity, error)
- func (s *Storage) GetDetails(id int) (*DetailsEntity, error)
- func (s *Storage) GetTile(qk quadmap.QuadKey) (*TileEntity, error)
- func (s *Storage) HasIdentifier(identifier string, tileType quadmap.TileType) bool
- func (s *Storage) InsertDetails(details DetailsEntity) (int64, error)
- func (s *Storage) InsertIdentifier(identifier string, tileType quadmap.TileType) error
- func (s *Storage) InsertTileWith(txx *sqlx.Tx, tile TileEntity) error
- func (s *Storage) InsertTileWithTableName(txx *sqlx.Tx, tableName string, tile TileEntity) error
- func (s *Storage) SearchDetailsBetweenQuadKeys(qk1 quadmap.QuadKey, qk2 quadmap.QuadKey, tileTypes []quadmap.TileType, ...) ([]DetailsEntity, error)
- func (s *Storage) SearchDetailsWithinQuadKey(qk quadmap.QuadKey, tileTypes []quadmap.TileType, includeSimpleBorder bool, ...) ([]DetailsEntity, error)
- func (s *Storage) SearchQuadKeysWithinQuadKey(qk quadmap.QuadKey) ([]int64, error)
- func (s *Storage) UpdateDetails(details DetailsEntity) error
- type TileEntity
Constants ¶
const (
TablePartitionZoomLevel = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetailsEntity ¶
type DetailsEntity struct {
Id uint64 `db:"id"`
Border string `db:"border"`
SimpleBorder string `db:"simple_border"`
SimpleBorderWKB []byte `db:"simple_border_wkb"`
TileType uint16 `db:"tiletype"`
DateTime int64 `db:"datetime"`
Enabled bool `db:"enabled"`
Identifier string `db:"identifier"`
Scale uint16 `db:"scale"`
}
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) CreatePartitionTableIfNotExist ¶
func (*Storage) GenerateTableName ¶
GenerateTableName generates the table name that should be associated with the provided quadkey. Currently the assumption is that the table name will be associated with an ancestor of the quadkey at level 10. This is an attempt to find a sweet spot between performance and the number of tables. If the provided quadkey is already smaller than 10, then the table name will be "quadmap_high".
func (*Storage) GetAllDetails ¶
func (s *Storage) GetAllDetails() ([]DetailsEntity, error)
func (*Storage) GetDetails ¶
func (s *Storage) GetDetails(id int) (*DetailsEntity, error)
func (*Storage) HasIdentifier ¶
func (*Storage) InsertDetails ¶
func (s *Storage) InsertDetails(details DetailsEntity) (int64, error)
func (*Storage) InsertIdentifier ¶
func (*Storage) InsertTileWith ¶
func (s *Storage) InsertTileWith(txx *sqlx.Tx, tile TileEntity) error
func (*Storage) InsertTileWithTableName ¶
func (*Storage) SearchDetailsBetweenQuadKeys ¶
func (s *Storage) SearchDetailsBetweenQuadKeys(qk1 quadmap.QuadKey, qk2 quadmap.QuadKey, tileTypes []quadmap.TileType, includeSimpleBorder bool, limit int) ([]DetailsEntity, error)
SearchDetailsWithinQuadKey returns details for any hits within a particular QuadKey
func (*Storage) SearchDetailsWithinQuadKey ¶
func (*Storage) SearchQuadKeysWithinQuadKey ¶
func (*Storage) UpdateDetails ¶
func (s *Storage) UpdateDetails(details DetailsEntity) error
type TileEntity ¶
type TileEntity struct {
QuadKey quadmap.QuadKey `db:"quadkey"`
TileType uint16 `db:"tiletype"`
Full bool `db:"full"`
DetailsMask uint64 `db:"details_mask"`
DetailsID int64 `db:"details_id"`
}
Entities: TileEntity has quadkey and details mask. The details mask will indicate if there are QuadKey is NOT the primary key... but will be indexed and will be main column we search on.