Documentation ¶
Overview ¶
Package tegola describes the basic geometeries that can be used to convert to and from.
Index ¶
- Constants
- Variables
- func GeometeryDecorator(g Geometry, ptsPerLine int, comment string, ptDecorator func(pt Point) string) string
- func GeometryAsJSON(g Geometry, w io.Writer) error
- func GeometryAsMap(g Geometry) map[string]interface{}
- func GeometryAsString(g Geometry) string
- func IsCollectionEqual(c1, c2 Collection) bool
- func IsGeometryEqual(g1, g2 Geometry) bool
- func IsLineStringEqual(l1, l2 LineString) bool
- func IsMultiLineEqual(ml1, ml2 MultiLine) bool
- func IsMultiPointEqual(mp1, mp2 MultiPoint) bool
- func IsMultiPolygonEqual(mp1, mp2 MultiPolygon) bool
- func IsPoint3Equal(p1, p2 Point3) bool
- func IsPointEqual(p1, p2 Point) bool
- func IsPolygonEqual(p1, p2 Polygon) bool
- func LineAsPointPairs(l LineString) (pp []float64)
- func Tile2Lat(y, z uint64) float64
- func Tile2Lon(x, z uint64) float64
- type Collection
- type Geometry
- type LineString
- type MultiLine
- type MultiPoint
- type MultiPolygon
- type Point
- type Point3
- type Polygon
- type Tile
- func (t *Tile) Bounds() [4]float64
- func (t *Tile) Deg2Num() (x, y int)
- func (t *Tile) FromPixel(srid int, pt [2]float64) (npt [2]float64, err error)
- func (t *Tile) Init()
- func (t *Tile) Num2Deg() (lat, lng float64)
- func (t *Tile) PixelBufferedBounds() (bounds [4]float64, err error)
- func (t *Tile) ToPixel(srid int, pt [2]float64) (npt [2]float64, err error)
- func (t *Tile) ZEpislon() float64
- func (t *Tile) ZLevel() uint
- func (t *Tile) ZRes() float64
Constants ¶
const ( WebMercator = 3857 WGS84 = 4326 )
const ( DefaultEpislon = 10.0 DefaultExtent = 4096 DefaultTileBuffer = 64.0 MaxZ = 22 )
Variables ¶
var ( WebMercatorBounds = &geom.Extent{-20026376.39, -20048966.10, 20026376.39, 20048966.10} WGS84Bounds = &geom.Extent{-180.0, -85.0511, 180.0, 85.0511} )
var UnknownConversionError = fmt.Errorf("do not know how to convert value to requested value")
Functions ¶
func GeometeryDecorator ¶ added in v0.4.0
func GeometryAsMap ¶ added in v0.4.0
func GeometryAsString ¶ added in v0.4.0
func IsCollectionEqual ¶ added in v0.4.0
func IsCollectionEqual(c1, c2 Collection) bool
CollectionIsEqual will check to see if the provided collections are equal. This function does not check to see if the collections contain any recursive structures, and if there are any recursive structures it will hang. If the collections contains any unknown geometries it will be assumed to not match.
func IsGeometryEqual ¶ added in v0.4.0
GeometryIsEqual will check to see if the two given geometeries are equal. This function does not check to see if there are any recursive structures if there are any recursive structures it will hang. If the type of the geometry is unknown, it is assumed that it does not match any other geometries.
func IsLineStringEqual ¶ added in v0.4.0
func IsLineStringEqual(l1, l2 LineString) bool
IsLineStringEqual will check to see if the two linesstrings provided are equal.
func IsMultiLineEqual ¶ added in v0.4.0
IsMultiLineEqual will check to see if the two Multilines that are provided are equal.
func IsMultiPointEqual ¶ added in v0.4.0
func IsMultiPointEqual(mp1, mp2 MultiPoint) bool
IsMultiPointEqual will check to see if the two provided multipoints are equal
func IsMultiPolygonEqual ¶ added in v0.4.0
func IsMultiPolygonEqual(mp1, mp2 MultiPolygon) bool
MultiPolygonIsEqual will check to see if the two provided multi-polygons are equal.
func IsPoint3Equal ¶ added in v0.4.0
IsPoint3Equal will check to see if the two 3d tegola points are equal.
func IsPointEqual ¶ added in v0.4.0
IsPointEqual will check to see if the two tegola points are equal.
func IsPolygonEqual ¶ added in v0.4.0
PolygonIsEqual will check to see if the two provided polygons are equal.
func LineAsPointPairs ¶ added in v0.4.0
func LineAsPointPairs(l LineString) (pp []float64)
Types ¶
type Collection ¶
Collection is a collections of different geometries.
type LineString ¶
LineString is a Geometry of a line.
type MultiLine ¶
type MultiLine interface { Geometry Lines() []LineString }
MultiLine is a Geometry with multiple individual lines.
type MultiPoint ¶
MultiPoint is a Geometry with multiple individual points.
type MultiPolygon ¶
MultiPolygon describes a Geometry multiple intersecting polygons. There should only one exterior polygon, and the rest of the polygons should be interior polygons. The interior polygons will exclude the area from the exterior polygon.
type Point3 ¶
Point3 is a point with three dimensions; at current is just converted and treated as a point.
type Polygon ¶
type Polygon interface { Geometry Sublines() []LineString }
Polygon is a multi-line Geometry where all the lines connect to form an enclose space.
type Tile ¶
type Tile struct { Z uint X uint Y uint Lat float64 Long float64 Tolerance float64 Extent float64 Buffer float64 // contains filtered or unexported fields }
Tile slippy map tilenames http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
func NewTileLatLong ¶ added in v0.6.0
NewTileLatLong will return a non-nil tile object.
func (*Tile) Bounds ¶ added in v0.7.0
Bounds returns the bounds of the Tile as defined by the North most Longitude, East most Latitude, South most Longitude, West most Latitude.
func (*Tile) PixelBufferedBounds ¶ added in v0.6.0
func (*Tile) ZRes ¶
ZRes takes a web mercator zoom level and returns the pixel resolution for that scale, assuming t.Extent x t.Extent pixel tiles. Non-integer zoom levels are accepted. ported from: https://raw.githubusercontent.com/mapbox/postgis-vt-util/master/postgis-vt-util.sql 40075016.6855785 is the equator in meters for WGS84 at z=0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package atlas provides an abstraction for a collection of Maps.
|
Package atlas provides an abstraction for a collection of Maps. |
cmd
|
|
Package config loads and understands the tegola config format.
|
Package config loads and understands the tegola config format. |
container
|
|
draw
|
|
!build
|
!build |
internal
|
|
cmd
Package cmd contains the Context type that can be used to cleanly terminate an application upon receiving a Termination signal.
|
Package cmd contains the Context type that can be used to cleanly terminate an application upon receiving a Termination signal. |
env
dict is a helper function that allow one to easily get concreate values out of a map[string]interface{}
|
dict is a helper function that allow one to easily get concreate values out of a map[string]interface{} |
p
pacakge p takes in values and returns a pointer to the value
|
pacakge p takes in values and returns a pointer to the value |
mapbox
|
|
tilejson
TileJSON https://github.com/mapbox/tilejson-spec
|
TileJSON https://github.com/mapbox/tilejson-spec |
Package math contins generic math functions that we need for doing transforms.
|
Package math contins generic math functions that we need for doing transforms. |
webmercator
Package webmercator does the translation to and from WebMercator and WGS84 Gotten from: http://wiki.openstreetmap.org/wiki/Mercator#C.23
|
Package webmercator does the translation to and from WebMercator and WGS84 Gotten from: http://wiki.openstreetmap.org/wiki/Mercator#C.23 |
mvtprovider
|
|
postgis
Package postgis is a placeholder for the postgis database.
|
Package postgis is a placeholder for the postgis database. |
debug
The debug provider returns features that are helpful for debugging a tile including a box for the tile edges and a point in the middle of the tile with z,x,y values encoded
|
The debug provider returns features that are helpful for debugging a tile including a box for the tile edges and a point in the middle of the tile with z,x,y values encoded |
Package server implements the http frontend
|
Package server implements the http frontend |