Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRSToCRS ¶
func CRSToCRS(source, target string, transform func(Projection)) error
CRSToCRS facilitates transformations between two coordinate reference systems.
Example ¶
package main import ( "fmt" "github.com/everystreet/go-proj/v6/proj" ) func main() { coord := proj.XYZ{ X: 2, Y: 49, Z: 10, } if err := proj.CRSToCRS("+proj=latlong", "EPSG:3857", func(pj proj.Projection) { proj.TransformForward(pj, &coord) // transform more coordinates }); err != nil { panic(err) } fmt.Printf("%.2f %.2f %.2f", coord.X, coord.Y, coord.Z) }
Output: 222638.98 6274861.39 10.00
func TransformForward ¶
func TransformForward(pj Projection, coord Coordinate)
TransformForward performs a forward transformation of the supplied coordinate.
func TransformInverse ¶
func TransformInverse(pj Projection, coord Coordinate)
TransformInverse performs an inverse transformation of the supplied coordinate.
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 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.