Documentation ¶
Index ¶
- Constants
- Variables
- func Cleanup()
- func CreateConnection(config dict.Dicter) (*sql.DB, error)
- func NewMVTTileProvider(config dict.Dicter, maps []provider.Map) (provider.MVTTiler, error)
- func NewTileProvider(config dict.Dicter, maps []provider.Map) (provider.Tiler, error)
- func OpenDB(uri string) (*sql.DB, error)
- type DataType
- type ErrGeomFieldNotFound
- type ErrInvalidURI
- type ErrLayerNotFound
- type FieldDescription
- type Layer
- type Provider
- func (p *Provider) Close()
- func (p *Provider) Collectors(prefix string, cfgFn func(configKey string) map[string]interface{}) ([]observability.Collector, error)
- func (p *Provider) Layer(name string) (Layer, bool)
- func (p Provider) Layers() ([]provider.LayerInfo, error)
- func (p Provider) MVTForLayers(ctx context.Context, tile provider.Tile, params provider.Params, ...) ([]byte, error)
- func (p Provider) TileFeatures(ctx context.Context, layer string, tile provider.Tile, params provider.Params, ...) error
Constants ¶
const ( EnvSQLDebugName = "TEGOLA_SQL_DEBUG" EnvSQLDebugLayer = "LAYER_SQL" EnvSQLDebugExecute = "EXECUTE_SQL" )
const ( DefaultURI = "" DefaultMaxConn = 100 DefaultMaxConnIdleTime = "30m" DefaultMaxConnLifetime = "1h" )
const ( ConfigKeyName = "name" ConfigKeyURI = "uri" ConfigKeyMaxConn = "max_connections" ConfigKeyMaxConnIdleTime = "max_connection_idle_time" ConfigKeyMaxConnLifetime = "max_connection_life_time" ConfigKeySRID = "srid" ConfigKeyLayers = "layers" ConfigKeyLayerName = "name" ConfigKeyTablename = "tablename" ConfigKeySQL = "sql" ConfigKeyFields = "fields" ConfigKeyGeomField = "geometry_fieldname" ConfigKeyFeatureIDField = "id_fieldname" ConfigKeyGeomType = "geometry_type" ConfigKeyBuffer = "buffer" ConfigKeyClipGeometry = "clip_geometry" )
const ( MVTProviderType = "mvt_hana" ProviderType = "hana" )
const Name = "hana"
const (
PLANAR_SRID_OFFSET = 1000000000
)
Variables ¶
var (
ErrNilLayer = errors.New("layer is nil")
)
Functions ¶
func Cleanup ¶
func Cleanup()
Cleanup will close all database connections and destroy all previously instantiated Provider instances
func CreateConnection ¶
CreateConnection creates a connection from config values
func NewMVTTileProvider ¶
func NewTileProvider ¶
NewTileProvider instantiates and returns a new HANA provider or an error. The function will validate that the config object looks good before trying to create a driver. This Provider supports the following fields in the provided map[string]interface{} map:
uri (string): [Required] HANA connection string name (string): [Required] Provider name is referenced from map layers srid (int): [Optional] The default SRID for the provider. Defaults to WebMercator (3857) but also supports WGS84 (4326) type (string): [Required] The type of data provider. must be "hana" to use this data provider layers (map[string]struct{}) — This is map of layers keyed by the layer name. Supports the following properties name (string): [Required] the name of the layer. This is used to reference this layer from map layers. tablename (string): [*Required] the name of the database table to query against. Required if sql is not defined. geometry_fieldname (string): [Optional] the name of the filed which contains the geometry for the feature. defaults to geom id_fieldname (string): [Optional] the name of the feature id field. defaults to gid fields ([]string): [Optional] a list of fields to include alongside the feature. Can be used if sql is not defined. srid (int): [Optional] the SRID of the layer. Supports 3857 (WebMercator) or 4326 (WGS84). sql (string): [*Required] custom SQL to use use. Required if tablename is not defined. Supports the following tokens: !BBOX! - [Required] will be replaced with the bounding box of the tile before the query is sent to the database. !ZOOM! - [Optional] will be replaced with the "Z" (zoom) value of the requested tile.
Types ¶
type ErrGeomFieldNotFound ¶
func (ErrGeomFieldNotFound) Error ¶
func (e ErrGeomFieldNotFound) Error() string
type ErrInvalidURI ¶
func (ErrInvalidURI) Error ¶
func (e ErrInvalidURI) Error() string
func (ErrInvalidURI) Unwrap ¶
func (e ErrInvalidURI) Unwrap() error
type ErrLayerNotFound ¶
type ErrLayerNotFound struct {
LayerName string
}
func (ErrLayerNotFound) Error ¶
func (e ErrLayerNotFound) Error() string
type FieldDescription ¶
type FieldDescription struct {
// contains filtered or unexported fields
}
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
layer holds information about a query.
func (Layer) FieldDescriptions ¶
func (l Layer) FieldDescriptions() []FieldDescription
func (Layer) GeomFieldName ¶
func (Layer) IDFieldName ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides the HANA data provider.
func CreateProvider ¶
func CreateProvider(config dict.Dicter, maps []provider.Map, providerType string) (*Provider, error)
CreateProvider instantiates and returns a new postgis provider or an error. The function will validate that the config object looks good before trying to create a driver. This Provider supports the following fields in the provided map[string]interface{} map:
uri (string): [Required] HANA database host srid (int): [Optional] The default SRID for the provider. Defaults to WebMercator (3857) but also supports WGS84 (4326) max_connections : [Optional] The max connections to maintain in the connection pool. Default is 100. 0 means no max. layers (map[string]struct{}) — This is map of layers keyed by the layer name. supports the following properties name (string): [Required] the name of the layer. This is used to reference this layer from map layers. tablename (string): [*Required] the name of the database table to query against. Required if sql is not defined. geometry_fieldname (string): [Optional] the name of the filed which contains the geometry for the feature. defaults to geom id_fieldname (string): [Optional] the name of the feature id field. defaults to gid fields ([]string): [Optional] a list of fields to include alongside the feature. Can be used if sql is not defined. srid (int): [Optional] the SRID of the layer. Supports 3857 (WebMercator) or 4326 (WGS84). sql (string): [*Required] custom SQL to use use. Required if tablename is not defined. Supports the following tokens: !BBOX! - [Required] will be replaced with the bounding box of the tile before the query is sent to the database. !ZOOM! - [Optional] will be replaced with the "Z" (zoom) value of the requested tile.
func (*Provider) Close ¶
func (p *Provider) Close()
Close will close the Provider's database connectio
func (*Provider) Collectors ¶
func (*Provider) Layer ¶
Layer fetches an individual layer from the provider, if it's configured if no name is provider, the first layer is returned
func (Provider) Layers ¶
Layers returns meta data about the various layers which are configured with the provider