Documentation ¶
Index ¶
- Constants
- func NewProvider(config map[string]interface{}) (mvt.Provider, error)
- type Layer
- type Provider
- func (p *Provider) ForEachFeature(ctx context.Context, layerName string, tile tegola.Tile, ...) error
- func (p *Provider) Layer(name string) (Layer, bool)
- func (p Provider) Layers() ([]mvt.LayerInfo, error)
- func (p Provider) MVTLayer(ctx context.Context, layerName string, tile tegola.Tile, ...) (layer *mvt.Layer, err error)
Constants ¶
View Source
const ( DefaultPort = 5432 DefaultSRID = tegola.WebMercator DefaultMaxConn = 100 )
View Source
const ( ConfigKeyHost = "host" ConfigKeyPort = "port" ConfigKeyDB = "database" ConfigKeyUser = "user" ConfigKeyPassword = "password" ConfigKeyMaxConn = "max_connection" ConfigKeySRID = "srid" ConfigKeyLayers = "layers" ConfigKeyLayerName = "name" ConfigKeyTablename = "tablename" ConfigKeySQL = "sql" ConfigKeyFields = "fields" ConfigKeyGeomField = "geometry_fieldname" ConfigKeyGeomIDField = "id_fieldname" )
View Source
const Name = "postgis"
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
NewProvider Setups and returns a new postgis provider or an error; if something is wrong. The function will validate that the config object looks good before trying to create a driver. This means that the Provider expects the following fields to exists in the provided map[string]interface{} map: host (string) — the host to connect to. port (uint16) — the port to connect on. database (string) — the database name user (string) — the user name password (string) — the Password max_connections (*uint8) // Default is 5 if nil, 0 means no max. layers (map[string]struct{}) — This is map of layers keyed by the layer name. tablename (string || sql string) — This is the sql to use or the tablename to use with the default query. fields ([]string) — This is a list, if this is nil or empty we will get all fields. geometry_fieldname (string) — This is the field name of the geometry, if it's an empty string or nil, it will defaults to 'geom'. id_fieldname (string) — This is the field name for the id property, if it's an empty string or nil, it will defaults to 'gid'.
Types ¶
type Layer ¶ added in v0.4.0
type Layer struct {
// contains filtered or unexported fields
}
layer holds information about a query.
func (Layer) GeomFieldName ¶ added in v0.4.0
func (Layer) IDFieldName ¶ added in v0.4.0
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider provides the postgis data provider.
func (*Provider) ForEachFeature ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.