Documentation
¶
Overview ¶
Package api provides structs for use with OGC API implementations.
See the specifications below for more detail:
Index ¶
- Constants
- type BoundingBox
- type Conformance
- type Link
- type Root
- type TileMatrix
- type TileMatrixSet
- type TileMatrixSetItem
- type TileMatrixSetLimit
- type TileMatrixSetList
- type TileMatrixSetMaxZoom
- type TileMatrixSetMinZoom
- type TileMatrixSetOption
- type TilePoint
- type TileSet
- type TileSetItem
- type TileSetList
- type VariableMatrixWidth
Constants ¶
const ( TopLeft = "topLeft" BottomLeft = "bottomLeft" )
const ( TileDataTypeVector = "vector" TileDataTypeMap = "map" TileDataTypeCoverage = "coverage" )
Data types for tilesets.
const (
TMSWebMercatorQuad = "WebMercatorQuad"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundingBox ¶
type Conformance ¶
type Link ¶
type Link struct { Href string `json:"href"` Rel string `json:"rel"` Type string `json:"type,omitempty"` HrefLang string `json:"hreflang,omitempty"` Title string `json:"title,omitempty"` Length int `json:"length,omitempty"` Templated bool `json:"templated,omitempty"` VarBase string `json:"varBase,omitempty"` }
Link is used to connect resources in an OGC API.
Implementations that conform to the Common Core Conformance class (http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core) must link to associated resources with the fields below.
type TileMatrix ¶
type TileMatrix struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Keywords []string `json:"keywords,omitempty"` ID string `json:"id"` ScaleDenominator float64 `json:"scaleDenominator"` CellSize float64 `json:"cellSize"` CornerOfOrigin string `json:"cornerOfOrigin,omitempty"` PointOfOrigin []float64 `json:"pointOfOrigin"` TileWidth int `json:"tileWidth"` TileHeight int `json:"tileHeight"` MatrixWidth int `json:"matrixWidth"` MatrixHeight int `json:"matrixHeight"` VariableMatrixWidths []*VariableMatrixWidth `json:"variableMatrixWidths,omitempty"` }
TileMatrix includes for a single "level" in a tile matrix set.
Implementations that conform to the Tileset Conformance class (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tileset) must link to a tiling scheme where each level includes this metadata.
func (*TileMatrix) BoundingBox ¶ added in v0.6.0
func (matrix *TileMatrix) BoundingBox() *BoundingBox
BoundingBox returns the map extent of a tile matrix.
func (*TileMatrix) Limit ¶ added in v0.6.0
func (matrix *TileMatrix) Limit(bounds *BoundingBox) (*TileMatrixSetLimit, error)
Limit returns the tile range for a single matrix level. Pass a nil bounds to get the full tile range for a level.
type TileMatrixSet ¶
type TileMatrixSet struct { ID string `json:"id,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Keywords []string `json:"keywords,omitempty"` URI string `json:"uri,omitempty"` OrderedAxes []string `json:"orderedAxes,omitempty"` CRS string `json:"crs"` WellKnownScaleSet string `json:"wellKnownScaleSet,omitempty"` BoundingBox *BoundingBox `json:"boundingBox,omitempty"` TileMatrices []*TileMatrix `json:"tileMatrices"` Links []*Link `json:"links,omitempty"` }
TileMatrixSet includes metadata tiling schema.
Implementations that conform to the Tileset Conformance class (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tileset) must link to a tiling scheme for each tileset.
func GetTileMatrixSet ¶
func GetTileMatrixSet(id string, options ...TileMatrixSetOption) (*TileMatrixSet, error)
func (*TileMatrixSet) Limits ¶ added in v0.6.0
func (tms *TileMatrixSet) Limits(minLevel int, maxLevel int, bounds *BoundingBox) ([]*TileMatrixSetLimit, error)
Limits generates a slice of tile ranges for the given levels and bounds. Pass a nil bounds to get the full tile range for a level.
type TileMatrixSetItem ¶
type TileMatrixSetLimit ¶
type TileMatrixSetLimit struct { TileMatrix string `json:"tileMatrix"` MinTileRow int `json:"minTileRow"` MaxTileRow int `json:"maxTileRow"` MinTileCol int `json:"minTileCol"` MaxTileCol int `json:"maxTileCol"` }
TileMatrixSetLimit adds metadata to a tileset describing limits on the referenced tiling scheme.
Implementations that conform to the TileMatrixSetLimits Conformance class (http://www.opengis.net/spec/tms/2.0/conf/tilematrixsetlimits) may provide these metadata fields.
type TileMatrixSetList ¶
type TileMatrixSetList struct { TileMatrixSets []*TileMatrixSetItem `json:"tileMatrixSets"` Links []*Link `json:"links,omitempty"` }
type TileMatrixSetMaxZoom ¶
type TileMatrixSetMaxZoom int
type TileMatrixSetMinZoom ¶
type TileMatrixSetMinZoom int
type TileMatrixSetOption ¶
type TileMatrixSetOption interface {
// contains filtered or unexported methods
}
type TileSet ¶
type TileSet struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Keywords []string `json:"keywords,omitempty"` Version string `json:"version,omitempty"` PointOfContact string `json:"pointOfContact,omitempty"` Attribution string `json:"attribution,omitempty"` License string `json:"license,omitempty"` AccessConstraints []string `json:"accessConstraints,omitempty"` MediaTypes []string `json:"mediaTypes,omitempty"` DataType string `json:"dataType"` TileMatrixSetURI string `json:"tileMatrixSetURI,omitempty"` TileMatrixSetLimits []*TileMatrixSetLimit `json:"tileMatrixSetLimits,omitempty"` CRS string `json:"crs"` Epoch float64 `json:"epoch,omitempty"` Links []*Link `json:"links"` BoundingBox *BoundingBox `json:"boundingBox,omitempty"` CenterPoint *TilePoint `json:"centerPoint,omitempty"` }
TileSet includes metadata for a tileset.
Implementations that conform to the Tileset Conformance class (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tileset) must provide these metadata fields.
type TileSetItem ¶
type TileSetItem struct { Title string `json:"title,omitempty"` DataType string `json:"dataType"` CRS string `json:"crs"` TileMatrixSetURI string `json:"tileMatrixSetURI,omitempty"` Links []*Link `json:"links"` }
TileSetItem includes metadata for a a list of tilesets.
Implementations that conform to the Tileset List Conformance class (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tilesets-list) must provide these metadata fields when rendering a list of tilesets.
type TileSetList ¶
type TileSetList struct { TileSets []*TileSetItem `json:"tilesets"` Links []*Link `json:"links,omitempty"` }
TileSetList represents a list of tilesets.
Implementations that conform to the Tileset List Conformance class (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tilesets-list) must provide a list of tilesets.