Documentation
¶
Overview ¶
Package postgis implements the database interfaces for PostGIS.
Index ¶
- func New(conf database.Config, m *config.Mapping) (database.DB, error)
- type ColumnSpec
- type ColumnType
- type GeneralizedTableSpec
- type PostGIS
- func (pg *PostGIS) Abort() error
- func (pg *PostGIS) Begin() error
- func (pg *PostGIS) BeginBulk() error
- func (pg *PostGIS) Close() error
- func (pg *PostGIS) Delete(id int64, matches []mapping.Match) error
- func (pg *PostGIS) Deploy() error
- func (pg *PostGIS) EnableGeneralizeUpdates()
- func (pg *PostGIS) End() error
- func (pg *PostGIS) Finish() error
- func (pg *PostGIS) Generalize() error
- func (pg *PostGIS) GeneralizeUpdates() error
- func (pg *PostGIS) Init() error
- func (pg *PostGIS) InsertLineString(elem element.OSMElem, geom geom.Geometry, matches []mapping.Match) error
- func (pg *PostGIS) InsertPoint(elem element.OSMElem, geom geom.Geometry, matches []mapping.Match) error
- func (pg *PostGIS) InsertPolygon(elem element.OSMElem, geom geom.Geometry, matches []mapping.Match) error
- func (pg *PostGIS) InsertRelationMember(rel element.Relation, m element.Member, geom geom.Geometry, ...) error
- func (pg *PostGIS) Open() error
- func (pg *PostGIS) Optimize() error
- func (pg *PostGIS) RemoveBackup() error
- func (pg *PostGIS) RevertDeploy() error
- type SQLError
- type SQLInsertError
- type TableSpec
- type TableTx
- type TxRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColumnSpec ¶
type ColumnSpec struct {
Name string
FieldType mapping.ColumnType
Type ColumnType
}
func (*ColumnSpec) AsSQL ¶
func (col *ColumnSpec) AsSQL() string
type ColumnType ¶
type ColumnType interface {
Name() string
PrepareInsertSql(i int,
spec *TableSpec) string
GeneralizeSql(colSpec *ColumnSpec, spec *GeneralizedTableSpec) string
}
type GeneralizedTableSpec ¶
type GeneralizedTableSpec struct {
Name string
FullName string
Schema string
SourceName string
Source *TableSpec
SourceGeneralized *GeneralizedTableSpec
Tolerance float64
Where string
Generalizations []*GeneralizedTableSpec
// contains filtered or unexported fields
}
func NewGeneralizedTableSpec ¶
func NewGeneralizedTableSpec(pg *PostGIS, t *config.GeneralizedTable) *GeneralizedTableSpec
func (*GeneralizedTableSpec) DeleteSQL ¶
func (spec *GeneralizedTableSpec) DeleteSQL() string
func (*GeneralizedTableSpec) InsertSQL ¶
func (spec *GeneralizedTableSpec) InsertSQL() string
type PostGIS ¶
type PostGIS struct {
Db *sql.DB
Params string
Config database.Config
Tables map[string]*TableSpec
GeneralizedTables map[string]*GeneralizedTableSpec
Prefix string
// contains filtered or unexported fields
}
func (*PostGIS) EnableGeneralizeUpdates ¶
func (pg *PostGIS) EnableGeneralizeUpdates()
func (*PostGIS) Generalize ¶
func (*PostGIS) GeneralizeUpdates ¶
func (*PostGIS) InsertLineString ¶
func (*PostGIS) InsertPoint ¶
func (*PostGIS) InsertPolygon ¶
func (*PostGIS) InsertRelationMember ¶
func (*PostGIS) RemoveBackup ¶
func (*PostGIS) RevertDeploy ¶
type SQLInsertError ¶
type SQLInsertError struct {
SQLError
// contains filtered or unexported fields
}
func (*SQLInsertError) Error ¶
func (e *SQLInsertError) Error() string
type TableSpec ¶
type TableSpec struct {
Name string
FullName string
Schema string
Columns []ColumnSpec
GeometryType string
Srid int
Generalizations []*GeneralizedTableSpec
}
func (*TableSpec) CreateTableSQL ¶
type TableTx ¶
type TableTx interface {
Begin(*sql.Tx) error
Insert(row []interface{}) error
Delete(id int64) error
End()
Commit() error
Rollback()
}
func NewBulkTableTx ¶
func NewSynchronousTableTx ¶
Click to show internal directories.
Click to hide internal directories.