Documentation
¶
Overview ¶
Package proj is a Go wrapper around the Proj4 C library.
It provides coordinate reference system definition and transformation functionalities.
No shared library is required at runtime as the C code is ntegrated in the package. The PROJ_LIB environment variable must be set or the SetFinder function must be called in order to identify the location of the share folder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFinder ¶
func SetFinder(paths []string)
SetFinder add one or more directories to search for proj definition files. Multiple calls overwrite the previous search paths.
func TransformPoints ¶
TransformPoints transforms the points inplace from the source coordinate system to the destination coordinate system.
Types ¶
type Proj ¶
type Proj struct {
// contains filtered or unexported fields
}
Proj represents a coordinate reference system. It is not safe for concurent use
func InitPlus ¶
InitPlus initializes a new projection from a proj4 plus string (eg. "+init=epsg:4326" )
func (*Proj) Close ¶
func (p *Proj) Close()
Close deallocates the projection immediately. Otherwise, it will be deallocated on garbage collection.
type Transformation ¶
type Transformation struct {
// contains filtered or unexported fields
}
Transformation projects coordinates from a source to a destination
func NewTransformation ¶
func NewTransformation(src, dst *Proj) (Transformation, error)
NewTransformation initializes a new transformation with src and dst
func (Transformation) TransformPoints ¶
func (t Transformation) TransformPoints(points []geom.Point) error
TransformPoints transforms the points inplace from the source coordinate system to the destination coordinate system.
func (Transformation) TransformRaw ¶
func (t Transformation) TransformRaw(xs, ys, zs []float64) error
TransformRaw transforms the x/y/z points from the source coordinate system to the destination coordinate system. zs can be nil or must have the same length as xs and ys.