Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateFilePathForNewDiskFile(dirPath, fileName, suffix string) (string, errorsx.Error)
- type ChosenConnForBounds
- type DBConnSet
- type DBFileConnectionURL
- type DBFileType
- type DataSourceConn
- type DefaultPBFReader
- type GetInBoundsFilter
- type GetNodeByIDType
- type GetRelationByIDType
- type GetWayByIDType
- type ImportQueue
- type ImportQueueItem
- type ImportRunType
- type ImportStatus
- type Importer
- type MatchLevel
- type NodeOccurenceMap
- type OnImportedSuccessfullyFunc
- type OnNodeReceivedFuncType
- type OnRelationReceivedFuncType
- type OnWayReceivedFuncType
- type PBFReader
- type PathsConfig
- type ProcessImportFunc
- type ReadDAL
- type Rescan
- type RescanMap
- type RescanResult
- type TagKeyWithType
- type TagNodeMap
- type TagRelationMap
- type TagWayMap
- type WayOccurenceMap
Constants ¶
View Source
const ConnectionPathSeparator = "://"
View Source
const (
PBFFileSuffix = ".pbf"
)
Variables ¶
View Source
var (
ErrNoDataAvailable = errors.New("no data available")
)
Functions ¶
Types ¶
type ChosenConnForBounds ¶
type ChosenConnForBounds struct { MatchLevel MatchLevel DataSourceConn }
type DBConnSet ¶
type DBConnSet struct {
// contains filtered or unexported fields
}
func NewDBConnSet ¶
func NewDBConnSet(conns []DataSourceConn) *DBConnSet
func (*DBConnSet) AddDBConn ¶
func (dbcs *DBConnSet) AddDBConn(conn DataSourceConn)
func (*DBConnSet) GetConns ¶
func (dbcs *DBConnSet) GetConns() []DataSourceConn
func (*DBConnSet) GetConnsForBounds ¶
GetConnForBounds selects a connection to use to provide data for a given bounds
type DBFileConnectionURL ¶
type DBFileConnectionURL struct { Type DBFileType ConnectionPath string }
func ParseDBConnFilePath ¶
func ParseDBConnFilePath(str string) (DBFileConnectionURL, errorsx.Error)
type DBFileType ¶
type DBFileType string
const ( DBFileTypeMapmakerDB DBFileType = "ownmapdb" DBFileTypePostgresql DBFileType = "postgresql" )
type DataSourceConn ¶
type DataSourceConn interface { // Info methods Name() string DatasetInfo() (*ownmap.DatasetInfo, errorsx.Error) // Data fetch methods GetInBounds(ctx context.Context, bounds osm.Bounds, filter *GetInBoundsFilter) (TagNodeMap, TagWayMap, TagRelationMap, errorsx.Error) }
type DefaultPBFReader ¶
func NewDefaultPBFReader ¶
func NewDefaultPBFReader(file gofs.File) (*DefaultPBFReader, errorsx.Error)
func (*DefaultPBFReader) Reset ¶
func (r *DefaultPBFReader) Reset() errorsx.Error
func (*DefaultPBFReader) TotalSize ¶
func (r *DefaultPBFReader) TotalSize() int64
type GetInBoundsFilter ¶
type GetInBoundsFilter struct {
Objects []*TagKeyWithType
}
func (*GetInBoundsFilter) Filter ¶
func (f *GetInBoundsFilter) Filter(objectType ownmap.ObjectType, tagKey ownmap.TagKey) bool
returns true if the object should be fetched
type GetRelationByIDType ¶
type GetRelationByIDType func(id int64) (*ownmap.OSMRelation, errorsx.Error)
type ImportQueue ¶
type ImportQueue struct {
// contains filtered or unexported fields
}
func NewImportQueue ¶
func NewImportQueue(pathsConfig *PathsConfig) *ImportQueue
func (*ImportQueue) AddItemToQueue ¶
func (q *ImportQueue) AddItemToQueue(rawData io.Reader, fileName string, processFunc ProcessImportFunc, onImportedSuccessfully OnImportedSuccessfullyFunc) errorsx.Error
func (*ImportQueue) GetItems ¶
func (q *ImportQueue) GetItems() []*ImportQueueItem
type ImportQueueItem ¶
type ImportQueueItem struct { RawDataFilePath string Status ImportStatus ProgressPercent float64 TimeInProgress time.Duration // contains filtered or unexported fields }
type ImportRunType ¶
type ImportRunType struct { Bounds osm.Bounds RequiredTagKeysMap map[string]bool Rescan *Rescan MaxItemsPerBatch uint64 }
func (*ImportRunType) Validate ¶
func (importRun *ImportRunType) Validate() errorsx.Error
type ImportStatus ¶
type ImportStatus int
const ( ImportStatusQueued ImportStatus = 1 ImportStatusInProgress ImportStatus = 2 ImportStatusDone ImportStatus = 3 )
func (ImportStatus) String ¶
func (i ImportStatus) String() string
type Importer ¶
type Importer interface { GetNodeByID(id int64) (*ownmap.OSMNode, error) GetWayByID(id int64) (*ownmap.OSMWay, error) GetRelationByID(id int64) (*ownmap.OSMRelation, error) ImportNode(obj *ownmap.OSMNode) errorsx.Error ImportWay(obj *ownmap.OSMWay) errorsx.Error ImportRelation(obj *ownmap.OSMRelation) errorsx.Error Commit() (DataSourceConn, errorsx.Error) Rollback() errorsx.Error }
type MatchLevel ¶
type MatchLevel int
const ( MatchLevelNone MatchLevel = iota MatchLevelPartial MatchLevelFull )
func (MatchLevel) String ¶
func (i MatchLevel) String() string
type NodeOccurenceMap ¶
type NodeOccurenceMap map[ownmap.TagKey]*ownmap.IndexIDList
type OnImportedSuccessfullyFunc ¶
type OnImportedSuccessfullyFunc func(dataSource DataSourceConn)
type OnWayReceivedFuncType ¶
type PathsConfig ¶
type PathsConfig struct { StylesDir string DataDir string RawDataFilesDir string TempDir string TraceDir string }
func (*PathsConfig) EnsurePaths ¶
func (pc *PathsConfig) EnsurePaths() errorsx.Error
type ProcessImportFunc ¶
type ProcessImportFunc func(pbfReader PBFReader) (DataSourceConn, errorsx.Error)
type ReadDAL ¶
type ReadDAL interface { GetInBounds(dataSourceConn DataSourceConn, bounds osm.Bounds, filter *GetInBoundsFilter) (NodeOccurenceMap, WayOccurenceMap, errorsx.Error) GetNodeMapFromTagOccurences(dataSourceConn DataSourceConn, tagOccurenceMap NodeOccurenceMap) (TagNodeMap, errorsx.Error) GetWayMapFromTagOccurences(dataSourceConn DataSourceConn, tagOccurenceMap WayOccurenceMap) (TagWayMap, errorsx.Error) GetDatasetInfo(dataSourceConn DataSourceConn) (*ownmap.DatasetInfo, errorsx.Error) }
type Rescan ¶
type Rescan struct {
WayRescanMap, RelationRescanMap *RescanMap
}
func (*Rescan) GetRescanItemRequestsThisIteration ¶
func (*Rescan) MarkNewIteration ¶
func (r *Rescan) MarkNewIteration()
type RescanMap ¶
type RescanMap struct {
// contains filtered or unexported fields
}
func NewRescanMap ¶
func NewRescanMap() *RescanMap
func (*RescanMap) GetValueOfWayMarkedForRescan ¶
func (r *RescanMap) GetValueOfWayMarkedForRescan(id int64) RescanResult
func (*RescanMap) IsItemRequestedForRescan ¶
func (*RescanMap) MarkIDAsScannedButNotInBounds ¶
func (*RescanMap) RequestIDToBeRescanned ¶
RequestWayIDToBeRescanned marks a Way ID to be rescanned
type RescanResult ¶
type RescanResult struct { KnownToBeOutOfBounds bool // contains filtered or unexported fields }
type TagKeyWithType ¶
type TagKeyWithType struct { ObjectType ownmap.ObjectType TagKey ownmap.TagKey }
type TagRelationMap ¶
type TagRelationMap map[ownmap.TagKey][]*ownmap.RelationData
type WayOccurenceMap ¶
type WayOccurenceMap map[ownmap.TagKey]*ownmap.IndexIDList
Source Files ¶
Click to show internal directories.
Click to hide internal directories.