tiled

package
v0.0.0-...-4c2d33b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyFile = errors.New("empty file (nothing to tile)")
View Source
var ErrNoFiles = errors.New("no files (nothing to tile)")
View Source
var ErrNotReady = errors.New("tile daemon not ready")

Functions

This section is empty.

Types

type PushFeaturesRequestArgs

type PushFeaturesRequestArgs struct {
	SourceSchema

	// TippeConfigName refers to a named default (or otherwise available?) tippecanoe configuration.
	// Should be like 'laps', 'naps',...
	// These might be generalized to linestrings, points, etc.,
	// but either way its arbitrary.
	TippeConfigName params.TippeConfigName

	TippeConfigRaw params.CLIFlagsT

	// JSONBytes is data to be written to the source file.
	// It will be written to a .geojson.gz file.
	// It must be JSON, obviously.
	JSONBytes []byte

	// GzippedJSONBytes is pre-gzipped data to be written to the source file.
	GzippedJSONBytes []byte

	Versions    []TileSourceVersion
	SourceModes []SourceMode
}

type PushFeaturesResponse

type PushFeaturesResponse struct {
	Error     error
	WrittenTo string
}

type SourceMode

type SourceMode string
const (
	SourceModeAppend   SourceMode = "append"
	SourceModeTruncate SourceMode = "trunc"
)

type SourceSchema

type SourceSchema struct {
	CatID conceptual.CatID

	// SourceName is the name of the source file, the mbtiles file, and the tileset name.
	// Should be like 'laps', 'naps', or 'snaps'.
	// It will be used as a base name.
	SourceName string

	// LayerName is the name of the layer in the .mbtiles file.
	// Currently this is passed to tippecanoe --layer name.
	// Only one layer is supported per source file. FIXME?
	LayerName string
	// contains filtered or unexported fields
}

func (SourceSchema) Validate

func (s SourceSchema) Validate() error

type TileD

type TileD struct {
	*TileDaemon
}

TileD hides the Daemon from the RPC service.

func (*TileD) Ping

func (*TileD) PushFeatures

func (d *TileD) PushFeatures(args *PushFeaturesRequestArgs, reply *PushFeaturesResponse) error

func (*TileD) RequestTiling

func (d *TileD) RequestTiling(args *TilingRequestArgs, reply *TilingResponse) error

RequestTiling requests tiling of a source file. It uses a combination of debouncing and enqueuing to cause it to run at most end-to-end per source file. (Once it finishes, it can be run again.)

func (*TileD) SourcePathFor

func (d *TileD) SourcePathFor(schema SourceSchema, version TileSourceVersion) (string, error)

func (*TileD) TargetPathFor

func (d *TileD) TargetPathFor(schema SourceSchema, version TileSourceVersion) (string, error)

TargetPathFor returns the final output path for some source schema and version. It will have a .mbtiles extension

func (*TileD) TmpTargetPathFor

func (d *TileD) TmpTargetPathFor(schema SourceSchema, version TileSourceVersion) (string, error)

TmpTargetPathFor returns a deterministic temporary target path for a source schema and version. This value (filepath) is not safe for use by concurrent processes.

type TileDaemon

type TileDaemon struct {
	Config *params.TileDaemonConfig
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(config *params.TileDaemonConfig) (*TileDaemon, error)

func (*TileDaemon) Interrupt

func (d *TileDaemon) Interrupt()

func (*TileDaemon) Start

func (d *TileDaemon) Start() error

Run starts the tiling daemon and does not wait for it to complete. It can be stopped gracefully with a call to Stop then Wait.

func (*TileDaemon) Wait

func (d *TileDaemon) Wait()

type TileSourceVersion

type TileSourceVersion string

TileSourceVersion is a name of a version of the source file to write, and to tile. Versions are (called) canonical and edge. The canonical source contains all the data. The edge source contains a subset of the data: the latest data. This scheme addresses the potential for (very) long-running canonical-data tiling processes because of potentially large source files. On a tiling request for some (canonical) data source, first, the edge source is tiled. If edge tiling takes longer than some threshold (or canonical tiles DNE), the canonical source is tiled. Everytime after the canonical source is tiled, the edge source is flushed (and re-tiled, tabula rasa). The edge epsilon threshold will be exceeded by the edge tiling process (probably) because it may continue to tile on new Requests and won't flush until the canonical tiling completes.

const (
	SourceVersionCanonical TileSourceVersion = "canonical"
	SourceVersionEdge      TileSourceVersion = "edge"
)

type TilingRequestArgs

type TilingRequestArgs struct {
	SourceSchema

	TippeConfigName params.TippeConfigName
	TippeConfigRaw  params.CLIFlagsT

	Version TileSourceVersion
	// contains filtered or unexported fields
}

TilingRequestArgs are the arguments to a tiling request. So far, only the tiler itself will call this method - when it handles a PushFeatures requests successfully. The PushFeatures request delegates associated tiling requests, based on source versions (edge v. canonical).

func (*TilingRequestArgs) Validate

func (a *TilingRequestArgs) Validate() error

type TilingResponse

type TilingResponse struct {
	Success     bool
	Error       string
	Elapsed     time.Duration
	MBTilesPath string
	// RequestArgs are the arguments that were used to run the tiling.
	// These will have been modified by the tiler to reflect the actual CLI args for the source file used.
	// TODO Uglyaf.
	RequestArgs *TilingRequestArgs
}

TilingResponse is the response to a tiling request.

Jump to

Keyboard shortcuts

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