tiles

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2018 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTileBbox

func FormatTileBbox(tileID mercantile.TileID) string

FormatTileBbox converts tile (x, y, z) to bbox string (l,b,r,t)

func Save

func Save(tile *Tile) error

Save saves the tile passed in argument on hard drive.

Types

type Bbox

type Bbox struct {
	Left   float64
	Bottom float64
	Right  float64
	Top    float64
}

Bbox stores a web mercator bounding box, for which tiles should be downloaded.

func (*Bbox) Set

func (bbox *Bbox) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Converts comma-separated values (string in "left,bottom,right,top" format) to Bbox struct.

func (*Bbox) String

func (bbox *Bbox) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

type JobStats

type JobStats struct {
	Start     time.Time
	All       int
	Succeeded int
	Failed    int
}

JobStats stores number of jobs, that will be executed, jobs which have been resolved successfully or failed and Start timestamp.

func (*JobStats) ShowCurrentState

func (jobs *JobStats) ShowCurrentState()

ShowCurrentState prints current state of jobs.

func (*JobStats) ShowSummary

func (jobs *JobStats) ShowSummary()

ShowSummary prints summary along with execution time after all jobs have been processed.

type Options

type Options struct {
	URL         string
	Layer       string
	Format      string
	Service     string
	Version     string
	Width       string
	Height      string
	Styles      string
	Zooms       Zooms
	Bbox        Bbox
	Concurrency int
	Help        bool
	// If all options are correct,
	// build base URL for all tiles
	// requests.
	BaseURL string
}

Options struct stores all available flags and their values set by user.

func (*Options) ParseBaseURL

func (options *Options) ParseBaseURL() error

ParseBaseURL builds base URL for all tiles requests based on passed arguments.

func (*Options) ValidateOptions

func (options *Options) ValidateOptions() error

ValidateOptions validates options supplied by user. Downloading will start only, if all required options have been passed in correct format.

type Tile

type Tile struct {
	Content []byte
	Path    string
	Name    string
}

Tile contains content received from WMS server and other metadata about tile itself. For example tile's path in z/x tree, name under which the tile will be saved (y.png).

func Get

func Get(tileID mercantile.TileID, options Options) (*Tile, error)

Get sends http.Get request to WMS Server and returns response content.

type Zooms

type Zooms []int

Zooms stores zoom levels, for which tiles should be downloaded.

func (*Zooms) Set

func (zooms *Zooms) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Converts comma-separated values (string in "int,int,int,(...)" format) to Zooms type.

func (*Zooms) String

func (zooms *Zooms) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

Jump to

Keyboard shortcuts

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