gocog

package module
v0.0.0-...-8c76e7f Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

README

gocog

A Cloud Optimised GeoTIFF (COG) file reader written in Go https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF

[Disclaimer: this is very early stages for this project. Please do not rely on this code for the moment]

Documentation

Overview

Package tiff implements a TIFF image decoder and encoder.

The TIFF specification is at http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf

Index

Constants

View Source
const (

	//This tag is used to store all of the DOUBLE valued GeoKeys, referenced by the
	//GeoKeyDirectoryTag. The meaning of any value of this double array is determined
	//from the GeoKeyDirectoryTag reference pointing to it. FLOAT values should first
	//be converted to DOUBLE and stored here.
	GeoDoubleParamsTag = 34736 // Type = DOUBLE (IEEE Double precision) N = variable

	//This tag is used to store all of the ASCII valued GeoKeys, referenced by the
	//GeoKeyDirectoryTag. Since keys use offsets into tags, any special comments
	//may be placed at the beginning of this tag. For the most part, the only keys
	//that are ASCII valued are "Citation" keys, giving documentation and references
	//for obscure projections, datums, etc.
	GeoAsciiParamsTag = 34737 // Type = ASCII N = variable
)
View Source
const (
	//GeoTIFF Configuration Keys
	GTModelTypeGeoKey  = 1024 // Section 6.3.1.1 Codes
	GTRasterTypeGeoKey = 1025 // Section 6.3.1.2 Codes
	GTCitationGeoKey   = 1026 // documentation

	// Geographic CS Parameter Keys
	GeographicTypeGeoKey        = 2048 // Section 6.3.2.1 Codes
	GeogCitationGeoKey          = 2049 // documentation
	GeogGeodeticDatumGeoKey     = 2050 // Section 6.3.2.2 Codes
	GeogPrimeMeridianGeoKey     = 2051 // Section 6.3.2.4 codes
	GeogLinearUnitsGeoKey       = 2052 // Section 6.3.1.3 Codes
	GeogLinearUnitSizeGeoKey    = 2053 // meters
	GeogAngularUnitsGeoKey      = 2054 // Section 6.3.1.4 Codes
	GeogAngularUnitSizeGeoKey   = 2055 // radians
	GeogEllipsoidGeoKey         = 2056 // Section 6.3.2.3 Codes
	GeogSemiMajorAxisGeoKey     = 2057 // GeogLinearUnits
	GeogSemiMinorAxisGeoKey     = 2058 // GeogLinearUnits
	GeogInvFlatteningGeoKey     = 2059 // ratio
	GeogAzimuthUnitsGeoKey      = 2060 // Section 6.3.1.4 Codes
	GeogPrimeMeridianLongGeoKey = 2061 // GeogAngularUnit

	// Projected CS Parameter Keys
	ProjectedCSTypeGeoKey          = 3072 // Section 6.3.3.1 codes
	PCSCitationGeoKey              = 3073 // documentation
	ProjectionGeoKey               = 3074 // Section 6.3.3.2 codes
	ProjCoordTransGeoKey           = 3075 // Section 6.3.3.3 codes
	ProjLinearUnitsGeoKey          = 3076 // Section 6.3.1.3 codes
	ProjLinearUnitSizeGeoKey       = 3077 // meters
	ProjStdParallel1GeoKey         = 3078 // GeogAngularUnit
	ProjStdParallel2GeoKey         = 3079 // GeogAngularUnit
	ProjNatOriginLongGeoKey        = 3080 // GeogAngularUnit
	ProjNatOriginLatGeoKey         = 3081 // GeogAngularUnit
	ProjFalseEastingGeoKey         = 3082 // ProjLinearUnits
	ProjFalseNorthingGeoKey        = 3083 // ProjLinearUnits
	ProjFalseOriginLongGeoKey      = 3084 // GeogAngularUnit
	ProjFalseOriginLatGeoKey       = 3085 // GeogAngularUnit
	ProjFalseOriginEastingGeoKey   = 3086 // ProjLinearUnits
	ProjFalseOriginNorthingGeoKey  = 3087 // ProjLinearUnits
	ProjCenterLongGeoKey           = 3088 // GeogAngularUnit
	ProjCenterLatGeoKey            = 3089 // GeogAngularUnit
	ProjCenterEastingGeoKey        = 3090 // ProjLinearUnits
	ProjCenterNorthingGeoKey       = 3091 // ProjLinearUnits
	ProjScaleAtNatOriginGeoKey     = 3092 // ratio
	ProjScaleAtCenterGeoKey        = 3093 // ratio
	ProjAzimuthAngleGeoKey         = 3094 // GeogAzimuthUnit
	ProjStraightVertPoleLongGeoKey = 3095 // GeogAngularUnit

)

Key ID Summary

View Source
const (
	Projected  ModelType = "Projected"
	Geographic ModelType = "Geographic"
	Geocentric ModelType = "Geocentric"

	PixelIsArea  RasterType = "PixelIsArea"
	PixelIsPoint RasterType = "PixelIsPoint"

	//Section 6.3.1.3 codes
	LinearMeter ProjLinearUnits = "metre"

	//Section 6.3.1.4 codes
	AngularRadian GeogAngularUnits = "radian"
	AngularDegree GeogAngularUnits = "degree"

	//Section 6.3.2.1 codes
	GCS_WGS84           GeographicType = "WGS_84"
	UserDefinedGeogType GeographicType = "user-defined"

	//Section 6.3.2.2 codes
	DatumWGS84           GeogGeodeticDatum = "WGS_84"
	UserDefinedGeodDatum GeogGeodeticDatum = "user-defined"

	//Section 6.3.2.3 codes
	EllipseWGS84             GeogEllipsoid = "WGS_84"
	EllipseSphere            GeogEllipsoid = "Sphere"
	UserDefinedGeogEllipsoid GeogEllipsoid = "user-defined"

	//Section 6.3.3.2 codes
	UserDefinedProjection Projection = "user-defined"

	//Section 6.3.3.3 codes
	EPSG3857               ProjCSTType = "EPSG:3857"
	PCS_WGS84_UTM_zone_1N  ProjCSTType = "WGS84_UTM_zone_1N"
	PCS_WGS84_UTM_zone_33N ProjCSTType = "WGS84_UTM_zone_33N"
	UserDefinedCSTType     ProjCSTType = "user-defined"

	//Section 6.3.3.3 codes
	CTTransverseMercator ProjCoordTrans = "TransverseMercator"
	CTAlbersEqualArea    ProjCoordTrans = "AlbersEqualArea"
	CTSinusoidal         ProjCoordTrans = "Sinusoidal"
)

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (img image.Image, err error)

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfig returns the color model and dimensions of a TIFF image without decoding the entire image.

func DecodeConfigLevel

func DecodeConfigLevel(r io.Reader, level int) (image.Config, error)

func DecodeLevel

func DecodeLevel(r io.Reader, level int) (img image.Image, err error)

func DecodeLevelSubImage

func DecodeLevelSubImage(r io.Reader, level int, rect image.Rectangle) (img image.Image, err error)

Types

type Citation

type Citation struct {
	GCS       string
	Datum     string
	Ellipsoid string
	Primem    string
}

type CompressionType

type CompressionType int

CompressionType describes the type of compression used in Options.

const (
	Uncompressed CompressionType = iota
	Deflate
)

type FormatError

type FormatError string

A FormatError reports that the input is not a valid TIFF image.

func (FormatError) Error

func (e FormatError) Error() string

type GeoData

type GeoData struct {
	ModelType
	RasterType
	Citation string

	GeographicType
	GeogCitation string
	GeogGeodeticDatum
	GeogAngularUnits
	GeogEllipsoid
	GeogSemiMajorAxis     float64
	GeogSemiMinorAxis     float64
	GeogPrimeMeridian     string
	GeogPrimeMeridianLong float64

	ProjCSTType
	Projection
	ProjCoordTrans
	ProjLinearUnits
	ProjFalseEasting  float64
	ProjFalseNorthing float64
	ProjCenterLong    float64
}

func (GeoData) Proj4

func (gd GeoData) Proj4() (string, error)

func (GeoData) WKT

func (gd GeoData) WKT() (string, error)

type GeoInfo

type GeoInfo struct {
	Type      string       `json:"type"`
	Size      [2]uint32    `json:"size"`
	GeoTrans  Geotransform `json:"geoTransform"`
	Proj4     string       `json:"proj4"`
	NoData    float64      `json:"noDataValue"`
	Overviews []Overview   `json:"overviews"`
}

Slightly inspired on GDALInfo json output

func DecodeGeoInfo

func DecodeGeoInfo(r io.Reader) (GeoInfo, error)

func (GeoInfo) Geotransform

func (g GeoInfo) Geotransform(level int) (Geotransform, error)

type GeoTIFF

type GeoTIFF struct {
	Overviews    []ImgDesc
	GeoTrans     Geotransform
	NoData       float64
	GDALMetadata string
	// contains filtered or unexported fields
}

func (GeoTIFF) Proj4

func (g GeoTIFF) Proj4() (string, error)

type GeogAngularUnits

type GeogAngularUnits string

type GeogEllipsoid

type GeogEllipsoid string

type GeogGeodeticDatum

type GeogGeodeticDatum string

type GeographicType

type GeographicType string

type Geotransform

type Geotransform [6]float64

type ImgDesc

type ImgDesc struct {
	NewSubfileType     uint32
	ImageWidth         uint32
	ImageHeight        uint32
	TileWidth          uint32
	TileHeight         uint32
	PhotometricInterpr uint16
	Predictor          uint16
	Compression        uint16
	SamplesPerPixel    uint16
	BitsPerSample      []uint16
	SampleFormat       []uint16
	TileOffsets        []uint32
	TileByteCounts     []uint32
}

type KeyEntry

type KeyEntry struct {
	KeyID, TIFFTagLocation, Count, ValueOffset uint16
}

type ModelType

type ModelType string

type Overview

type Overview struct {
	Size [2]uint32 `json:"size"`
}

type ProjCSTType

type ProjCSTType string

type ProjCoordTrans

type ProjCoordTrans string

type ProjLinearUnits

type ProjLinearUnits string

type Projection

type Projection string

type RasterType

type RasterType string

type UnsupportedError

type UnsupportedError string

An UnsupportedError reports that the input uses a valid but unimplemented feature.

func (UnsupportedError) Error

func (e UnsupportedError) Error() string

Directories

Path Synopsis
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.

Jump to

Keyboard shortcuts

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