seed

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProgressMismatch = errors.New("the progress file describes a different seed run")

Resuming would seed the wrong tiles, so the caller must reuse the same arguments or start over

Functions

This section is empty.

Types

type Progress

type Progress struct {
	Version   int        `json:"version"`
	LayerName string     `json:"layer"`
	Bounds    pkg.Bounds `json:"bounds"`
	Zooms     []uint     `json:"zooms"`
	Total     uint64     `json:"total"`
	Position  uint64     `json:"position"`
}

How far a seed got. A position only means the same tile when the layer, bounds and zooms match

func LoadProgress

func LoadProgress(path string) (*Progress, error)

A missing file just means nothing to resume, so both return values are nil

func NewProgress

func NewProgress(layerName string, e *SeedJob) *Progress

func (*Progress) Finish

func (p *Progress) Finish(path string, out io.Writer, verbose bool) error

func (*Progress) Matches

func (p *Progress) Matches(layerName string, e *SeedJob) bool

Any change to the enumeration, including bounds and zoom levels, makes a recorded position refer to a different tile

func (*Progress) Save

func (p *Progress) Save(path string, out io.Writer, verbose bool) error

Writes via a temp file so a seed killed mid-write leaves the previous position, not a truncated file

type SeedJob

type SeedJob struct {
	// contains filtered or unexported fields
}

func NewSeedJob

func NewSeedJob(layerName string, bounds pkg.Bounds, zooms []uint) (*SeedJob, error)

func (*SeedJob) All

func (e *SeedJob) All() iter.Seq2[uint64, pkg.TileRequest]

Ascending zoom, then x, then y

func (*SeedJob) Bounds

func (e *SeedJob) Bounds() pkg.Bounds

func (*SeedJob) Count

func (e *SeedJob) Count() uint64

Total tiles the run covers

func (*SeedJob) From

func (e *SeedJob) From(start uint64) iter.Seq2[uint64, pkg.TileRequest]

Skips everything before start in the sequence

func (*SeedJob) Zooms

func (e *SeedJob) Zooms() []uint

In enumeration order

type SingleZoomRange added in v0.13.0

type SingleZoomRange struct {
	Z                      uint
	XMin, XMax, YMin, YMax int
}

Tiles within a single zoom level

func NewSingleZoomRange added in v0.13.0

func NewSingleZoomRange(b pkg.Bounds, zoom uint) (SingleZoomRange, error)

func (SingleZoomRange) Count added in v0.13.0

func (r SingleZoomRange) Count() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL