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_connections" 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 NewTileProvider ¶ added in v0.6.0
NewTileProvider 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:
host (string): [Required] postgis database host port (int): [Required] postgis database port (required) database (string): [Required] postgis database name user (string): [Required] postgis database user password (string): [Required] postgis database password 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.
Types ¶
type ErrLayerNotFound ¶ added in v0.6.0
type ErrLayerNotFound struct {
LayerName string
}
func (ErrLayerNotFound) Error ¶ added in v0.6.0
func (e ErrLayerNotFound) Error() string
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) Layer ¶ added in v0.4.0
Layer fetches an individual layer from the provider, if it's configured if no name is provider, the first layer is returned
Click to show internal directories.
Click to hide internal directories.