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 *osm.Element, geom *geom.Geometry, match Match) interface{}
- func Bool(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func BoolInt(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func DefaultWayZOrder(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func Direction(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func Geometry(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func ID(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func Integer(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func KeyName(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func RelationMemberID(rel *osm.Relation, member *osm.Member, memberIndex int, match Match) interface{}
- func RelationMemberIndex(rel *osm.Relation, member *osm.Member, memberIndex int, match Match) interface{}
- func RelationMemberRole(rel *osm.Relation, member *osm.Member, memberIndex int, match Match) interface{}
- func RelationMemberType(rel *osm.Relation, member *osm.Member, memberIndex int, match Match) interface{}
- func String(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func ValueName(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- func WebmercArea(val string, elem *osm.Element, geom *geom.Geometry, match Match) interface{}
- type ColumnType
- type DestTable
- type Key
- type MakeMakeValue
- type MakeMemberValue
- type MakeValue
- func MakeCategorizeInt(fieldName string, fieldType ColumnType, field config.Column) (MakeValue, error)
- func MakeEnumerate(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeHStoreString(columnName string, columnType ColumnType, column config.Column) (MakeValue, error)
- func MakeIntersectsFeatureField(fieldName string, fieldType ColumnType, field config.Column) (MakeValue, error)
- func MakeIntersectsField(fieldName string, fieldType ColumnType, field 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 MakeCategorizeInt ¶ added in v0.9.0
func MakeEnumerate ¶
func MakeHStoreString ¶
func MakeIntersectsFeatureField ¶ added in v0.9.0
func MakeIntersectsField ¶ added in v0.9.0
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 (*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 }