postgis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

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 BBOX = "!BBOX!"

DEFAULT sql for get geometries,

View Source
const DefaultMaxConn = 5
View Source
const DefaultPort = 5432
View Source
const DefaultSRID = tegola.WebMercator
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 provide 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) LayerNames

func (p Provider) LayerNames() (names []string)

func (Provider) MVTLayer

func (p Provider) MVTLayer(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