Documentation ¶
Index ¶
- func WithBufferRatio(n int) func(*StandardWriter)
- func WithGeometryEncoder(e GeometryEncoder) func(*StandardConsumer)
- func WithNumWorkers(n int) func(*StandardWriter)
- func WithTilesetVersion(v version.TilesetVersion) func(*StandardWriter)
- type Asset
- type BoundingVolume
- type Child
- type Consumer
- type Content
- type GeometryEncoder
- type GltfEncoder
- type MockConsumer
- type MockProducer
- type MockWriter
- type PntsEncoder
- type Producer
- type Root
- type StandardConsumer
- type StandardProducer
- type StandardWriter
- type Tileset
- type WorkUnit
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBufferRatio ¶
func WithBufferRatio(n int) func(*StandardWriter)
WithBufferRation defines how many jobs per writer worker to allow enqueuing.
func WithGeometryEncoder ¶
func WithGeometryEncoder(e GeometryEncoder) func(*StandardConsumer)
WithGeometryEncoder sets the consumer geometry encoder to the given one
func WithNumWorkers ¶
func WithNumWorkers(n int) func(*StandardWriter)
WithNumWorkers defines how many writer goroutines to launch when writing the tiles.
func WithTilesetVersion ¶
func WithTilesetVersion(v version.TilesetVersion) func(*StandardWriter)
WithTilesetVersion sets the version of the generated tilesets. version 1.0 generates .pnts gemetries while version 1.1 generates .glb (gltf) geometries.
Types ¶
type Asset ¶
type Asset struct {
Version version.TilesetVersion `json:"version"`
}
type BoundingVolume ¶
type BoundingVolume struct {
Box [12]float64 `json:"box"`
}
type Child ¶
type Child struct { Content Content `json:"content"` BoundingVolume BoundingVolume `json:"boundingVolume"` GeometricError float64 `json:"geometricError"` Refine string `json:"refine"` }
type Consumer ¶
type Consumer interface {
Consume(workchan chan *WorkUnit, errchan chan error, waitGroup *sync.WaitGroup)
}
func NewStandardConsumer ¶
func NewStandardConsumer(optFn ...func(*StandardConsumer)) Consumer
type GeometryEncoder ¶
type GeometryEncoder interface { Write(n tree.Node, folderPath string) error TilesetVersion() version.TilesetVersion Filename() string }
GeometryEncoder encodes a tree.Node into a binary file, like a .pnts or .glb/.gltf files.
type GltfEncoder ¶
type GltfEncoder struct{}
GltfEncoder writes a node data as Gltf/Glb binary file (3D Tiles 1.1 specs) Encodes intensity and classification using the EXT_structural_metadata GLTF extension
func NewGltfEncoder ¶
func NewGltfEncoder() *GltfEncoder
func (*GltfEncoder) Filename ¶
func (e *GltfEncoder) Filename() string
func (*GltfEncoder) TilesetVersion ¶
func (e *GltfEncoder) TilesetVersion() version.TilesetVersion
type MockConsumer ¶
type MockProducer ¶
type MockWriter ¶
type PntsEncoder ¶
type PntsEncoder struct{}
PntsEncoder writes a node data as Pnts file (3D Tiles 1.0 specs)
func NewPntsEncoder ¶
func NewPntsEncoder() *PntsEncoder
func (*PntsEncoder) Filename ¶
func (e *PntsEncoder) Filename() string
func (*PntsEncoder) TilesetVersion ¶
func (e *PntsEncoder) TilesetVersion() version.TilesetVersion
type Producer ¶
type Producer interface {
Produce(work chan *WorkUnit, errchan chan error, wg *sync.WaitGroup, node tree.Node, ctx context.Context)
}
func NewStandardProducer ¶
type StandardConsumer ¶
type StandardConsumer struct {
// contains filtered or unexported fields
}
func (*StandardConsumer) Consume ¶
func (c *StandardConsumer) Consume(workchan chan *WorkUnit, errchan chan error, waitGroup *sync.WaitGroup)
Continually consumes WorkUnits submitted to a work channel producing corresponding gometry .pnts/.glb files and tileset.json files continues working until work channel is closed or if an error is raised. In this last case submits the error to an error channel before quitting
type StandardProducer ¶
type StandardProducer struct {
// contains filtered or unexported fields
}
func (*StandardProducer) Produce ¶
func (p *StandardProducer) Produce(work chan *WorkUnit, errchan chan error, wg *sync.WaitGroup, node tree.Node, ctx context.Context)
Parses a tree node and submits WorkUnits the the provided workchannel. Should be called only on the tree root node. Closes the channel when all work is submitted.
type StandardWriter ¶
type StandardWriter struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(basePath string, options ...func(*StandardWriter)) (*StandardWriter, error)
type WorkUnit ¶
type WorkUnit struct { // Node contains the data for the current tile Node tree.Node // BasePath is the path of the folder where to write the content.pnts and tileset.json files for this workunit BasePath string }
WorkUnit contains the minimal data needed to produce a single 3d tile, i.e. a binary content.pnts file, a tileset.json file