Documentation ¶
Overview ¶
Package tms20 implements the OGC Tile Matrix Set standard (v2.0) as a slippy.Grid See https://www.ogc.org/standard/tms/
Index ¶
- Constants
- func IsLatLon(crs CRS) (bool, error)
- func ToXYPoint(tms *TileMatrixSet, point [2]float64) (geom.Point, error)
- type CRS
- type CornerOfOrigin
- type ProjJSON
- type ProjJSONID
- type ReferenceSystemCRS
- func (crs *ReferenceSystemCRS) Authority() string
- func (crs *ReferenceSystemCRS) Code() string
- func (crs *ReferenceSystemCRS) Description() string
- func (crs *ReferenceSystemCRS) MarshalJSON() ([]byte, error)
- func (crs *ReferenceSystemCRS) UnmarshalJSON(data []byte) error
- func (crs *ReferenceSystemCRS) UnmarshalJSONFromMap(data interface{}) error
- func (crs *ReferenceSystemCRS) Version() string
- type TMID
- type TileMatrix
- type TileMatrixSet
- func (tms *TileMatrixSet) FromNative(zoom uint, pt geom.Point) (*slippy.Tile, bool)
- func (tms *TileMatrixSet) MarshalJSON() ([]byte, error)
- func (tms *TileMatrixSet) MatrixBoundingBox(tmID TMID) (bottomLeft geom.Point, topRight geom.Point, err error)
- func (tms *TileMatrixSet) MatrixSize(tmID TMID) (width float64, height float64)
- func (tms *TileMatrixSet) SRID() uint
- func (tms *TileMatrixSet) Size(zoom uint) (*slippy.Tile, bool)
- func (tms *TileMatrixSet) ToNative(tile *slippy.Tile) (geom.Point, bool)
- func (tms *TileMatrixSet) UnmarshalJSON(data []byte) error
- type TwoDBoundingBox
- type TwoDPoint
- type URICRS
- func (crs *URICRS) Authority() string
- func (crs *URICRS) Code() string
- func (crs *URICRS) Description() string
- func (crs *URICRS) MarshalJSON() ([]byte, error)
- func (crs *URICRS) UnmarshalJSON(data []byte) error
- func (crs *URICRS) UnmarshalJSONFromMap(data interface{}) error
- func (crs *URICRS) Version() string
- type VariableMatrixWidth
- type WKTCRS
- func (crs *WKTCRS) Authority() string
- func (crs *WKTCRS) Code() string
- func (crs *WKTCRS) Description() string
- func (crs *WKTCRS) MarshalJSON() ([]byte, error)
- func (crs *WKTCRS) UnmarshalJSON(data []byte) error
- func (crs *WKTCRS) UnmarshalJSONFromMap(data interface{}) error
- func (crs *WKTCRS) Version() string
Constants ¶
const ( CoordPrecision = 9 StandardizedRenderingPixelSize = 0.00028 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CornerOfOrigin ¶
type CornerOfOrigin string
const ( TopLeft CornerOfOrigin = "topLeft" BottomLeft CornerOfOrigin = "bottomLeft" )
func (*CornerOfOrigin) UnmarshalJSONFromMap ¶
func (c *CornerOfOrigin) UnmarshalJSONFromMap(data interface{}) error
type ProjJSON ¶
type ProjJSON struct {
ID ProjJSONID `validate:"required" json:"id"`
}
TODO expand the ProjJSON type
type ProjJSONID ¶
type ReferenceSystemCRS ¶
type ReferenceSystemCRS struct {
// contains filtered or unexported fields
}
func (*ReferenceSystemCRS) Authority ¶
func (crs *ReferenceSystemCRS) Authority() string
func (*ReferenceSystemCRS) Code ¶
func (crs *ReferenceSystemCRS) Code() string
func (*ReferenceSystemCRS) Description ¶
func (crs *ReferenceSystemCRS) Description() string
func (*ReferenceSystemCRS) MarshalJSON ¶
func (crs *ReferenceSystemCRS) MarshalJSON() ([]byte, error)
func (*ReferenceSystemCRS) UnmarshalJSON ¶
func (crs *ReferenceSystemCRS) UnmarshalJSON(data []byte) error
func (*ReferenceSystemCRS) UnmarshalJSONFromMap ¶
func (crs *ReferenceSystemCRS) UnmarshalJSONFromMap(data interface{}) error
func (*ReferenceSystemCRS) Version ¶
func (crs *ReferenceSystemCRS) Version() string
type TileMatrix ¶
type TileMatrix struct { // Identifier selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile. // Implementation of 'identifier' ID string `validate:"required" json:"id"` // Title of this tile matrix, normally used for display to a human Title string `json:"title,omitempty"` // Brief narrative description of this tile matrix set, normally available for display to a human Description string `json:"description,omitempty"` // Unordered list of one or more commonly used or formalized word(s) or phrase(s) used to describe this dataset Keywords []string `json:"keywords,omitempty"` // Scale denominator of this tile matrix ScaleDenominator float64 `validate:"required,gt=0" json:"scaleDenominator"` // Cell size of this tile matrix CellSize float64 `validate:"required,gt=0" json:"cellSize"` // The corner of the tile matrix (_topLeft_ or _bottomLeft_) used as the origin for numbering tile rows and columns. // This corner is also a corner of the (0, 0) tile. CornerOfOrigin CornerOfOrigin `validate:"omitempty,oneof=topLeft bottomLeft" json:"cornerOfOrigin,omitempty"` // Precise position in CRS coordinates of the corner of origin (e.g. the top-left corner) for this tile matrix. This position is also a corner of the (0, 0) tile. In previous version, this was 'topLeftCorner' and 'cornerOfOrigin' did not exist. PointOfOrigin *TwoDPoint `validate:"required" json:"pointOfOrigin"` // Width of each tile of this tile matrix in pixels TileWidth uint `validate:"required,min=1" json:"tileWidth"` // Height of each tile of this tile matrix in pixels TileHeight uint `validate:"required,min=1" json:"tileHeight"` // Width of the matrix (number of tiles in width) MatrixWidth uint `validate:"required,min=1" json:"matrixWidth"` // Height of the matrix (number of tiles in height) MatrixHeight uint `validate:"required,min=1" json:"matrixHeight"` // Describes the rows that have variable matrix width VariableMatrixWidths []VariableMatrixWidth `json:"variableMatrixWidths,omitempty"` }
A tile matrix, usually corresponding to a particular zoom level of a TileMatrixSet.
func (*TileMatrix) UnmarshalJSON ¶
func (tm *TileMatrix) UnmarshalJSON(data []byte) error
func (*TileMatrix) UnmarshalJSONFromMap ¶
func (tm *TileMatrix) UnmarshalJSONFromMap(data interface{}) error
type TileMatrixSet ¶
type TileMatrixSet struct { // Tile matrix set identifier. Implementation of 'identifier' ID string `json:"id,omitempty"` // Title of this tile matrix set, normally used for display to a human Title string `json:"title,omitempty"` // Brief narrative description of this tile matrix set, normally available for display to a human Description string `json:"description,omitempty"` // Unordered list of one or more commonly used or formalized word(s) or phrase(s) used to describe this tile matrix set Keywords []string `json:"keywords,omitempty"` // Reference to an official source for this TileMatrixSet URI string `validate:"omitempty,uri" json:"uri,omitempty"` // (This is informative, the CRS is authoritative) OrderedAxes []string `validate:"omitnil,min=1" json:"orderedAxes"` // Coordinate Reference System (CRS) CRS CRS `validate:"required" json:"-"` // Reference to a well-known scale set WellKnownScaleSet string `validate:"omitempty,uri" json:"wellKnownScaleSet,omitempty"` // Minimum bounding rectangle surrounding the tile matrix set, in the supported CRS BoundingBox *TwoDBoundingBox `json:"boundingBox,omitempty"` // Describes scale levels and its tile matrices TileMatrices map[TMID]TileMatrix `validate:"required,min=1" json:"-"` }
TileMatrixSet is a definition of a tile matrix set following the Tile Matrix Set standard. For tileset metadata, such a description (in `TileMatrixSet` property) is only required for offline use, as an alternative to a link with a `http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme` relation type.
func LoadEmbeddedTileMatrixSet ¶
func LoadEmbeddedTileMatrixSet(id string) (TileMatrixSet, error)
func LoadJSONTileMatrixSet ¶
func LoadJSONTileMatrixSet(path string) (TileMatrixSet, error)
func (*TileMatrixSet) FromNative ¶
func (*TileMatrixSet) MarshalJSON ¶
func (tms *TileMatrixSet) MarshalJSON() ([]byte, error)
func (*TileMatrixSet) MatrixBoundingBox ¶
func (tms *TileMatrixSet) MatrixBoundingBox(tmID TMID) (bottomLeft geom.Point, topRight geom.Point, err error)
MatrixBoundingBox returns the bounding box of a TileMatrix, in native CRS
func (*TileMatrixSet) MatrixSize ¶
func (tms *TileMatrixSet) MatrixSize(tmID TMID) (width float64, height float64)
MatrixSize returns the width and height of a TileMatrix in native CRS units
func (*TileMatrixSet) SRID ¶
func (tms *TileMatrixSet) SRID() uint
func (*TileMatrixSet) UnmarshalJSON ¶
func (tms *TileMatrixSet) UnmarshalJSON(data []byte) error
type TwoDBoundingBox ¶
type TwoDBoundingBox struct { LowerLeft *TwoDPoint `validate:"required" json:"lowerLeft"` UpperRight *TwoDPoint `validate:"required" json:"upperRight"` CRS CRS `json:"-"` OrderedAxes []string `validate:"omitempty,len=2" json:"orderedAxes,omitempty"` }
Minimum bounding rectangle surrounding a 2D resource in the CRS indicated elsewhere
func (*TwoDBoundingBox) MarshalJSON ¶
func (bb *TwoDBoundingBox) MarshalJSON() ([]byte, error)
func (*TwoDBoundingBox) UnmarshalJSON ¶
func (bb *TwoDBoundingBox) UnmarshalJSON(data []byte) error
type URICRS ¶
type URICRS struct {
// contains filtered or unexported fields
}
func (*URICRS) Description ¶
func (*URICRS) MarshalJSON ¶
func (*URICRS) UnmarshalJSON ¶
func (*URICRS) UnmarshalJSONFromMap ¶
type VariableMatrixWidth ¶
type VariableMatrixWidth struct { // Number of tiles in width that coalesce in a single tile for these rows Coalesce uint `validate:"required,min=2" json:"coalesce"` // First tile row where the coalescence factor applies for this tilematrix MinTileRow uint `validate:"required,min=0" json:"minTileRow"` // Last tile row where the coalescence factor applies for this tilematrix MaxTileRow uint `validate:"required,min=0" json:"maxTileRow"` }
Variable Matrix Width data structure
type WKTCRS ¶
type WKTCRS struct {
// contains filtered or unexported fields
}