proj

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: BSD-2-Clause, GPL-3.0 Imports: 6 Imported by: 21

README

projgeom

Go library for geodesic reprojections of Open GIS Consortium-style geometry objects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SR

type SR struct {
	Name, Title                string
	SRSCode                    string
	DatumCode                  string
	Rf                         float64
	Lat0, Lat1, Lat2, LatTS    float64
	Long0, Long1, Long2, LongC float64
	Alpha                      float64
	X0, Y0, K0, K              float64
	A, A2, B, B2               float64
	Ra                         bool
	Zone                       float64
	UTMSouth                   bool
	DatumParams                []float64
	ToMeter                    float64
	Units                      string
	FromGreenwich              float64
	NADGrids                   string
	Axis                       string

	Ellps       string
	EllipseName string
	Es          float64
	E           float64
	Ep2         float64
	DatumName   string
	NoDefs      bool

	Czech bool
	// contains filtered or unexported fields
}

SR holds information about a spatial reference (projection).

func NewSR

func NewSR() *SR

NewSR initializes a SR object and sets fields to default values.

func Parse

func Parse(code string) (*SR, error)

Parse parses a WKT- or PROJ4-formatted projection string into a Proj object.

func (*SR) DeriveConstants

func (json *SR) DeriveConstants()

DeriveConstants calculates some properties of the spatial reference based on other properties

func (*SR) Equal

func (sr *SR) Equal(sr2 *SR, ulp uint) bool

Equal determines whether spatial references sr and sr2 are equal to within ulp floating point units in the last place.

func (*SR) NewTransform

func (source *SR) NewTransform(dest *SR) (Transformer, error)

NewTransform creates a function that transforms a point from sr to the destination spatial reference. If source ~= dest, the returned Transformer will be nil.

func (*SR) Transformers

func (sr *SR) Transformers() (forward, inverse Transformer, err error)

Transformers returns forward and inverse transformation functions for this projection.

type Transformer

type Transformer func(X, Y float64) (x, y float64, err error)

A Transformer takes input coordinates and returns output coordinates and an error.

func AEA

func AEA(this *SR) (forward, inverse Transformer, err error)

AEA is an Albers Conical Equal Area projection.

func EqdC

func EqdC(this *SR) (forward, inverse Transformer, err error)

EqdC is an Equidistant Conic projection.

func Krovak

func Krovak(this *SR) (forward, inverse Transformer, err error)

Krovak is a Krovak projection.

func LCC

func LCC(this *SR) (forward, inverse Transformer, err error)

LCC is a Lambert Conformal Conic projection.

func LongLat

func LongLat(this *SR) (forward, inverse Transformer, err error)

LongLat is a longitude-latitude (i.e., no projection) projection.

func Merc

func Merc(this *SR) (forward, inverse Transformer, err error)

Merc is a mercator projection.

func TMerc

func TMerc(this *SR) (forward, inverse Transformer, err error)

TMerc is a transverse Mercator projection.

func UTM

func UTM(this *SR) (forward, inverse Transformer, err error)

UTM is a universal transverse Mercator projection.

type TransformerFunc

type TransformerFunc func(*SR) (forward, inverse Transformer, err error)

A TransformerFunc creates forward and inverse Transformers from a projection.

Jump to

Keyboard shortcuts

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