Documentation ¶
Overview ¶
Package mapping provides implements mapping and convertion between OSM elements and database tables, rows and columns.
The core logic of Imposm is accesible with the Mapping struct. A Mapping creates filters and matchers based on mapping configuration (.yaml or .json file).
Filters are for initial filtering (during -read). They remove all tags that are not needed.
Matchers map OSM elements to zero or more destination tables. Each Match results can convert an OSM element to a row with all mapped column values. The matching is dependend on the element type (node, way, relation), the element tags and the destination table type (point, linestring, polygon, relation, relation_member).
Index ¶
- Variables
- func Area(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func Bool(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func BoolInt(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func DefaultWayZOrder(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func Direction(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func Geometry(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func Id(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func Integer(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func KeyName(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func RelationMemberID(rel *element.Relation, member *element.Member, match Match) interface{}
- func RelationMemberIndex(rel *element.Relation, member *element.Member, match Match) interface{}
- func RelationMemberRole(rel *element.Relation, member *element.Member, match Match) interface{}
- func RelationMemberType(rel *element.Relation, member *element.Member, match Match) interface{}
- func String(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func ValueName(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- func WebmercArea(val string, elem *element.OSMElem, geom *geom.Geometry, match Match) interface{}
- type ColumnType
- type DestTable
- type Key
- type MakeMakeValue
- type MakeMemberValue
- type MakeValue
- func MakeEnumerate(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeHStoreString(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakePseudoArea(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeSuffixReplace(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeWayZOrder(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeZOrder(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- type Mapping
- type Match
- type NodeMatcher
- type RelWayMatcher
- type RelationMatcher
- type TableType
- type TagFilterer
- type TagTableMapping
- type Value
- type WayMatcher
Constants ¶
This section is empty.
Variables ¶
var AvailableColumnTypes map[string]ColumnType
Functions ¶
func DefaultWayZOrder ¶
func RelationMemberID ¶
func RelationMemberIndex ¶
func RelationMemberRole ¶
func RelationMemberType ¶
Types ¶
type ColumnType ¶
type ColumnType struct { Name string GoType string Func MakeValue MakeFunc MakeMakeValue MemberFunc MakeMemberValue FromMember bool }
func MakeColumnType ¶
func MakeColumnType(c *config.Column) (*ColumnType, error)
type MakeMakeValue ¶
type MakeMemberValue ¶
type MakeValue ¶
func MakeEnumerate ¶
func MakeHStoreString ¶
func MakePseudoArea ¶
func MakeSuffixReplace ¶
func MakeWayZOrder ¶
func MakeZOrder ¶
type Mapping ¶
type Mapping struct { Conf config.Mapping PointMatcher NodeMatcher LineStringMatcher WayMatcher PolygonMatcher RelWayMatcher RelationMatcher RelationMatcher RelationMemberMatcher RelationMatcher }
func NewMapping ¶
func (*Mapping) NodeTagFilter ¶
func (m *Mapping) NodeTagFilter() TagFilterer
func (*Mapping) RelationTagFilter ¶
func (m *Mapping) RelationTagFilter() TagFilterer
func (*Mapping) WayTagFilter ¶
func (m *Mapping) WayTagFilter() TagFilterer
type Match ¶
type Match struct { Key string Value string Table DestTable // contains filtered or unexported fields }
type NodeMatcher ¶
type RelWayMatcher ¶
type RelWayMatcher interface { WayMatcher RelationMatcher }