-
Notifications
You must be signed in to change notification settings - Fork 1
/
factory.go
58 lines (53 loc) · 1.01 KB
/
factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package osmpbfparser
import (
"github.com/jneo8/logger-go"
"github.com/jneo8/osmpbfparser-go/bitmask"
"github.com/vbauerster/mpb/v5"
)
// New return new PBFParser.
func New(
args Args,
) PBFParser {
return &pbfParser{
Args: args,
Logger: logger.NewLogger(),
Report: Report{PBFFile: args.PBFFile},
}
}
func newPBFIndexer(
pbfFile string,
pbfMasks *bitmask.PBFMasks,
nodeBar *mpb.Bar,
wayBar *mpb.Bar,
relationBar *mpb.Bar,
) pbfDataParser {
return &PBFIndexer{
PBFFile: pbfFile,
PBFMasks: pbfMasks,
NodeBar: nodeBar,
WayBar: wayBar,
RelationBar: relationBar,
}
}
func newPBFRelationMemberIndexer(
pbfFile string,
pbfMasks *bitmask.PBFMasks,
nodeBar *mpb.Bar,
wayBar *mpb.Bar,
relationBar *mpb.Bar,
) pbfDataParser {
return &PBFRelationMemberIndexer{
PBFFile: pbfFile,
PBFMasks: pbfMasks,
NodeBar: nodeBar,
WayBar: wayBar,
RelationBar: relationBar,
}
}
func newPBFCounter(
pbfFile string,
) pbfDataCounter {
return &PBFCounter{
PBFFile: pbfFile,
}
}