Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRSToCRS ¶
func CRSToCRS(source, target CRS, ts ...Transformation) error
CRSToCRS facilitates transformations between two coordinate reference systems.
Example ¶
package main import ( "fmt" "github.com/everystreet/go-proj/proj" ) func main() { coord := proj.XYZ{ X: 2, Y: 49, Z: 10, } if err := proj.CRSToCRS(proj.CRS("+proj=latlong"), proj.CRS("EPSG:3857"), proj.TransformForward(&coord)); err != nil { panic(err) } fmt.Printf("%.2f %.2f %.2f", coord.X, coord.Y, coord.Z) }
Output: 222638.98 6274861.39 10.00
Types ¶
type CRS ¶
type CRS string
CRS is a coordinate reference system definition.
type Coordinate ¶
Coordinate wraps functions that allow communication with the cproj package.
type LP ¶
LP is a geodetic coordinate expressed in radians.
func (*LP) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (LP) PutCoordinate ¶
PutCoordinate updates coord with the values in c.
type LPZ ¶
LPZ is a geodetic coordinate expressed in radians, with a vertical component.
func (*LPZ) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (LPZ) PutCoordinate ¶
PutCoordinate updates coord with the values in c.
type LPZT ¶
LPZT is a geodetic coordinate expressed in radians, with vertical and time components.
func (*LPZT) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (LPZT) PutCoordinate ¶
PutCoordinate updates coord with the values in c.
type Transformation ¶
Transformation functions are passed to CRSToCRS.
func TransformForward ¶
func TransformForward(coord Coordinate) Transformation
TransformForward performs a forward transformation of the supplied coordinate.
func TransformInverse ¶
func TransformInverse(coord Coordinate) Transformation
TransformInverse performs an inverse transformation of the supplied coordinate.
type XY ¶
XY is a 2D cartesian coordinate.
func (*XY) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (XY) PutCoordinate ¶
PutCoordinate updates coord with the values in c.
type XYZ ¶
XYZ is a 3D cartesian coordinate.
func (*XYZ) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (XYZ) PutCoordinate ¶
PutCoordinate updates coord with the values in c.
type XYZT ¶
XYZT is a 3D cartesian coordinate with a time component.
func (*XYZT) FromCoordinate ¶
FromCoordinate updates c with the values in coord.
func (XYZT) PutCoordinate ¶
PutCoordinate updates coord with the values in c.