forked from mfbonfigli/gocesiumtiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mocks.go
61 lines (56 loc) · 1.52 KB
/
mocks.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
59
60
61
package tiler
import (
"context"
"github.com/mfbonfigli/gocesiumtiler/v2/version"
)
type MockTiler struct {
InputFiles []string
InputFolder string
OutputFolder string
EpsgCode int
Opts *TilerOptions
Ctx context.Context
ProcessFilesCalled bool
ProcessFolderCalled bool
// opts settings
EightBit bool
GeoidElev bool
GridSize float64
PtsPerTile int
Depth int
ElevOffset float64
Version version.TilesetVersion
err error
}
func (m *MockTiler) ProcessFiles(inputLasFiles []string, outputFolder string, epsgCode int, opts *TilerOptions, ctx context.Context) error {
m.InputFiles = inputLasFiles
m.OutputFolder = outputFolder
m.EpsgCode = epsgCode
m.Opts = opts
m.Ctx = ctx
m.ProcessFilesCalled = true
m.EightBit = opts.eightBitColors
m.GeoidElev = opts.geoidElevation
m.GridSize = opts.gridSize
m.PtsPerTile = opts.minPointsPerTile
m.Depth = opts.maxDepth
m.ElevOffset = opts.elevationOffset
m.Version = opts.version
return m.err
}
func (m *MockTiler) ProcessFolder(inputFolder, outputFolder string, epsgCode int, opts *TilerOptions, ctx context.Context) error {
m.InputFolder = inputFolder
m.OutputFolder = outputFolder
m.EpsgCode = epsgCode
m.Opts = opts
m.Ctx = ctx
m.ProcessFolderCalled = true
m.EightBit = opts.eightBitColors
m.GeoidElev = opts.geoidElevation
m.GridSize = opts.gridSize
m.PtsPerTile = opts.minPointsPerTile
m.Depth = opts.maxDepth
m.ElevOffset = opts.elevationOffset
m.Version = opts.version
return m.err
}