Documentation
¶
Index ¶
- Constants
- func CRSFromEPSG(epsg int) (*godal.SpatialRef, error)
- func CRSFromUserInput(input string) (*godal.SpatialRef, int, error)
- func CreateLonLatProj(crs *godal.SpatialRef, inverse bool) (*godal.Transform, error)
- func FlatCoordToXY(flat []float64) (x []float64, y []float64)
- func NewPolygonFromExtent(pixToCrs *affine.Affine, width, height int) *geom.Polygon
- func Srid(crs *godal.SpatialRef) int
- func XYToFlatCoord(x []float64, y []float64) []float64
- type GeographicRing
- type GeographicShape
- type GeometricRing
- type GeometricShape
- type Ring
- type Shape
Constants ¶
const ( RadToDeg = 180 / math.Pi DegToRad = math.Pi / 180 )
Variables ¶
This section is empty.
Functions ¶
func CRSFromEPSG ¶
func CRSFromEPSG(epsg int) (*godal.SpatialRef, error)
CRSFromEPSG initialize a crs from epsg (only once per epsg) DO NOT release the crs (it is kept for further uses)
func CRSFromUserInput ¶
func CRSFromUserInput(input string) (*godal.SpatialRef, int, error)
CRSFromUserInput initialize a crs from epsg, proj4 or Wkt format Return the SRID if known
func CreateLonLatProj ¶
CreateLonLatProj create a CoordinateTransform from/to the geographic lon/lat coordinates
func FlatCoordToXY ¶
FlatCoordToXY splits flat into two arrays x, y
func NewPolygonFromExtent ¶ added in v0.3.0
NewPolygonFromExtent returns the polygon corresponding to the extent
func Srid ¶
func Srid(crs *godal.SpatialRef) int
SRID returns the SRID from the crs or 0 if not found Warning : this function is not reliable...
func XYToFlatCoord ¶
XYToFlatCoord merge two arrays x, y into one, interleaving coordinates.
Types ¶
type GeographicRing ¶ added in v0.3.0
type GeographicRing struct{ Ring }
GeographicShape is a geographic polygon of lon/lat (following geodesic lines)
func NewGeographicRingFromExtent ¶ added in v0.3.0
func NewGeographicRingFromExtent(pixToCrs *affine.Affine, width, height int, crs *godal.SpatialRef) (GeographicRing, error)
NewGeographicRingFromExtent creates a ring in geographic coordinates that covers the geometric extent in planar crs
type GeographicShape ¶
type GeographicShape struct{ Shape }
GeographicShape is a geographic polygon of lon/lat (following geodesic lines)
func NewGeographicShapeFromShape ¶
func NewGeographicShapeFromShape(shape Shape, crs *godal.SpatialRef) (GeographicShape, error)
NewGeographicShapeFromShape creates a shape in geographic coordinates that covers the shape in planar crs
type GeometricRing ¶ added in v0.3.0
type GeometricRing struct{ Ring }
GeometricShape is a polygon of lon/lat (4326)
type GeometricShape ¶
type GeometricShape struct{ Shape }
GeometricShape is a polygon of lon/lat (4326)
func NewGeometricShapeFromShape ¶
func NewGeometricShapeFromShape(shape Shape, crs *godal.SpatialRef) (g GeometricShape, err error)
NewGeometricShapeFromShape creates a shape in 4326 lon/lat coordinates that covers the shape in planar crs
type Ring ¶ added in v0.3.0
type Ring struct {
geom.LinearRing
}
func NewRingFlat ¶ added in v0.3.0
NewRingFlat create a new ring
func NewRingFromExtent ¶ added in v0.3.0
NewRingFromExtent returns the ring corresponding to the extent
func (*Ring) Equal ¶ added in v0.3.0
Equal returns true if the shapes have the same SRID and the same FlatCoords
type Shape ¶
type Shape struct {
geom.MultiPolygon
}
Shape is a XY-Multipolygon implementing Scan & Value Warning: SRID is not reliable