mbt

package
v0.0.7-a Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	Lat, Lon float64
}

type CsvSource

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

func NewCsvSource

func NewCsvSource(path string, filter []string, delimiter string, fields GeoFields) *CsvSource

func (*CsvSource) Publish

func (c *CsvSource) Publish() (features chan *Feature, err error)

type Feature

type Feature struct {
	Id         *uint64
	Geometry   []*Shape
	Type       string
	Properties map[string]interface{}
}

func MakeFeature

func MakeFeature(length int) *Feature

func NewFeature

func NewFeature(geometryType string, geometry ...*Shape) *Feature

func (*Feature) AddShape

func (f *Feature) AddShape(s *Shape)

func (*Feature) Center

func (f *Feature) Center() (avg Coordinate)

func (*Feature) SetF64Id

func (f *Feature) SetF64Id(id float64)

func (*Feature) ToMvtAdapter

func (f *Feature) ToMvtAdapter(tile ts.Tile) (adapter *mvt.Feature)

func (*Feature) ToTiledShapes

func (f *Feature) ToTiledShapes(tile ts.Tile) (shps []*mvt.Shape)

type FeatureSource

type FeatureSource interface {
	Publish() (chan *Feature, error)
}

type GeoFields

type GeoFields map[string]string

func (GeoFields) Validate

func (g GeoFields) Validate() error

type GeojsonSource

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

func NewGeojsonSource

func NewGeojsonSource(path string, filter []string) *GeojsonSource

func (*GeojsonSource) Publish

func (gj *GeojsonSource) Publish() (features chan *Feature, err error)

type Shape

type Shape struct {
	Coordinates []Coordinate
}

func MakeShape

func MakeShape(length int) *Shape

func NewShape

func NewShape(coords ...Coordinate) *Shape

func (*Shape) AddCoordinate

func (s *Shape) AddCoordinate(c Coordinate)

func (*Shape) Append

func (s *Shape) Append(c Coordinate)

func (*Shape) IsClockwise

func (s *Shape) IsClockwise() bool

func (*Shape) Reverse

func (s *Shape) Reverse()

func (*Shape) ToTileShape

func (s *Shape) ToTileShape(tile ts.Tile) (shp *mvt.Shape)

Unexported b/c the PointXY are still absolute, MVT needs relative

type Tiles

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

func InitTiles

func InitTiles(srcpath, mbtpath string, upsert bool, filter []string, desc string, extent uint) (tiles Tiles, err error)

func (Tiles) Build

func (t Tiles) Build(layerName string, zmin, zmax uint) (err error)

Directories

Path Synopsis
mvt
vector_tile
Package vector_tile provides the go code needed to read and write Mapbox vector tiles (https://github.com/mapbox/vector-tile-spec).
Package vector_tile provides the go code needed to read and write Mapbox vector tiles (https://github.com/mapbox/vector-tile-spec).
package tile_system is a collection of conversion utilities to go between geo/pixel/tile/quadkey space This package uses WGS84 coordinates and a mercator projection
package tile_system is a collection of conversion utilities to go between geo/pixel/tile/quadkey space This package uses WGS84 coordinates and a mercator projection

Jump to

Keyboard shortcuts

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