Documentation
¶
Overview ¶
Package api provides structs for use with OGC API implementations.
See the specifications below for more detail:
Index ¶
- Constants
- type BoundingBox
- type Collection
- type CollectionsList
- type Conformance
- type Extension
- type Extent
- type Feature
- type FeatureCollection
- type Link
- type RecordCore
- type Root
- type SpatialExtent
- type TemporalExtent
- 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 Collection ¶ added in v0.9.0
type Collection struct { Id string `json:"id"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Links []*Link `json:"links"` Extent *Extent `json:"extent,omitempty"` ItemType string `json:"itemType,omitempty"` Crs []string `json:"crs,omitempty"` Extensions []Extension `json:"-"` }
func (Collection) MarshalJSON ¶ added in v0.9.0
func (collection Collection) MarshalJSON() ([]byte, error)
func (*Collection) UnmarshalJSON ¶ added in v0.9.0
func (collection *Collection) UnmarshalJSON(data []byte) error
type CollectionsList ¶ added in v0.9.0
type CollectionsList struct { Collections []*Collection `json:"collections"` Links []*Link `json:"links"` }
type Conformance ¶
type Extent ¶ added in v0.9.0
type Extent struct { Spatial *SpatialExtent `json:"spatial,omitempty"` Temporal *TemporalExtent `json:"temporal,omitempty"` }
type Feature ¶ added in v0.9.0
type Feature struct { Id string `json:"id,omitempty"` Geometry any `json:"geometry"` Properties map[string]any `json:"properties"` Links []*Link `json:"links,omitempty"` Extensions []Extension `json:"-"` }
func (Feature) MarshalJSON ¶ added in v0.9.0
type FeatureCollection ¶ added in v0.9.0
type Link ¶
type Link struct { Href string `mapstructure:"href"` Rel string `mapstructure:"rel"` Type string `mapstructure:"type,omitempty"` HrefLang string `mapstructure:"hreflang,omitempty"` Title string `mapstructure:"title,omitempty"` Length int `mapstructure:"length,omitempty"` Templated bool `mapstructure:"templated,omitempty"` VarBase string `mapstructure:"varBase,omitempty"` AdditionalFields map[string]any `mapstructure:",remain"` }
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.
The AdditionalFields map will be populated with any additional fields when unmarshalling JSON. You can use this map to add additional fields when marshalling JSON.
func (*Link) MarshalJSON ¶ added in v0.9.0
func (*Link) UnmarshalJSON ¶ added in v0.9.0
type RecordCore ¶ added in v0.9.0
type RecordCore struct { Id string Type string Title string Description string Time time.Time Created time.Time Updated time.Time }
func (*RecordCore) Decode ¶ added in v0.9.0
func (r *RecordCore) Decode(data []byte) error
func (*RecordCore) Encode ¶ added in v0.9.0
func (r *RecordCore) Encode(featureMap map[string]any) error
func (*RecordCore) URI ¶ added in v0.9.0
func (r *RecordCore) URI() string
type SpatialExtent ¶ added in v0.9.0
type TemporalExtent ¶ added in v0.9.0
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 ¶
func (matrix *TileMatrix) BoundingBox() *BoundingBox
BoundingBox returns the map extent of a tile matrix.
func (*TileMatrix) Limit ¶
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 ¶
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.