postgis

package
v0.4.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func NewProvider(config map[string]interface{}) (mvt.Provider, error)
	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 Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides the postgis data provider.

func (Provider) Layers added in v0.4.0

func (p Provider) Layers() ([]mvt.LayerInfo, error)

func (Provider) MVTLayer

func (p Provider) MVTLayer(ctx context.Context, layerName string, tile tegola.Tile, tags map[string]interface{}) (layer *mvt.Layer, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL