gdal

package module
v0.0.0-...-82163bd Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

-------------
About
-------------

The gdal.go package provides a go wrapper for GDAL, the Geospatial Data Abstraction Library. More information about GDAL can be found at http://www.gdal.org

This has been forked from github.com/lukeroth/gdal, and is targeting GDAL 2.x.
This is not ready for general use and is a work in progress.

-------------
Installation
-------------

1) go get github.com/lukeroth/gdal
2) Set the GDAL library and include directories to the appropriate locations.
3) go build

-------------
Compatibility
-------------

This software has been tested most recently on Windows 7, using MinGW32_x64, GDAL version 1.11.

-------------
Examples
-------------

-------------
Status (4/17/2015)
-------------

The majority of GDAL functionality exposed by the C API is available, as well as much of the OGR API.
Most functionality is not yet covered by tests or benchmarks.

Documentation

Overview

Package gdal provides a wrapper for GDAL, the Geospatial Data Abstraction Library. This C/C++ library provides access to a large number of geospatial raster data formats. It also contains a wrapper for the related OGR Simple Feature Library which provides similar functionality for vector formats.

Limitations

Some less oftenly used functions are not yet implemented. The majoriry of these involve style tables, asynchronous I/O, and GCPs.

The documentation is fairly limited, but the functionality fairly closely matches that of the C++ api.

This wrapper has most recently been tested on Windows7, using the MinGW32_x64 compiler and GDAL version 1.11.

Usage

A simple program to create a georeferenced blank 256x256 GeoTIFF:

package main

import (
	"fmt"
	"flag"
	gdal "github.com/lukeroth/gdal_go"
)

func main() {
	flag.Parse()
	filename := flag.Arg(0)
	if filename == "" {
		fmt.Printf("Usage: test_tiff [filename]\n")
		return
	}
	buffer := make([]uint8, 256 * 256)

	driver, err := gdal.GetDriverByName("GTiff")
	if err != nil {
		fmt.Println(err.Error())
		return
	}

	dataset := driver.Create(filename, 256, 256, 1, gdal.Byte, nil)
	defer dataset.Close()

	spatialRef := gdal.CreateSpatialReference("")
	spatialRef.FromEPSG(3857)
	srString, err := spatialRef.ToWKT()
	dataset.SetProjection(srString)
	dataset.SetGeoTransform([]float64{444720, 30, 0, 3751320, 0, -30})
	raster := dataset.RasterBand(1)
	raster.IO(gdal.Write, 0, 0, 256, 256, buffer, 256, 256, 0, 0)
}

More examples can be found in the ./examples subdirectory.

Index

Constants

View Source
const (
	InverseDistanceToAPower                = GridAlgorithm(C.GGA_InverseDistanceToAPower)
	MovingAverage                          = GridAlgorithm(C.GGA_MovingAverage)
	NearestNeighbor                        = GridAlgorithm(C.GGA_NearestNeighbor)
	MetricMinimum                          = GridAlgorithm(C.GGA_MetricMinimum)
	MetricMaximum                          = GridAlgorithm(C.GGA_MetricMaximum)
	MetricRange                            = GridAlgorithm(C.GGA_MetricRange)
	MetricCount                            = GridAlgorithm(C.GGA_MetricCount)
	MetricAverageDistance                  = GridAlgorithm(C.GGA_MetricAverageDistance)
	MetricAverageDistancePts               = GridAlgorithm(C.GGA_MetricAverageDistancePts)
	Linear                                 = GridAlgorithm(C.GGA_Linear)
	InverseDistanceToAPowerNearestNeighbor = GridAlgorithm(C.GGA_InverseDistanceToAPowerNearestNeighbor)
)
View Source
const (
	// Grayscale (in GDALColorEntry.c1)
	PI_Gray = PaletteInterp(C.GPI_Gray)
	// Red, Green, Blue and Alpha in (in c1, c2, c3 and c4)
	PI_RGB = PaletteInterp(C.GPI_RGB)
	// Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)
	PI_CMYK = PaletteInterp(C.GPI_CMYK)
	// Hue, Lightness and Saturation (in c1, c2, and c3)
	PI_HLS = PaletteInterp(C.GPI_HLS)
)
View Source
const (
	VERSION_MAJOR = int(C.GDAL_VERSION_MAJOR)
	VERSION_MINOR = int(C.GDAL_VERSION_MINOR)
	VERSION_REV   = int(C.GDAL_VERSION_REV)
	VERSION_BUILD = int(C.GDAL_VERSION_BUILD)
	VERSION_NUM   = int(C.GDAL_VERSION_NUM)
	RELEASE_DATE  = int(C.GDAL_RELEASE_DATE)
	RELEASE_NAME  = string(C.GDAL_RELEASE_NAME)
)
View Source
const (
	Unknown  = DataType(C.GDT_Unknown)
	Byte     = DataType(C.GDT_Byte)
	UInt16   = DataType(C.GDT_UInt16)
	Int16    = DataType(C.GDT_Int16)
	UInt32   = DataType(C.GDT_UInt32)
	Int32    = DataType(C.GDT_Int32)
	Float32  = DataType(C.GDT_Float32)
	Float64  = DataType(C.GDT_Float64)
	CInt16   = DataType(C.GDT_CInt16)
	CInt32   = DataType(C.GDT_CInt32)
	CFloat32 = DataType(C.GDT_CFloat32)
	CFloat64 = DataType(C.GDT_CFloat64)
)
View Source
const (
	// Read only (no update) access
	ReadOnly = Access(C.GA_ReadOnly)
	// Read/write access.
	Update = Access(C.GA_Update)

	// Allow raster and vector drivers to be used.
	AllDrivers = Access(C.GDAL_OF_ALL)

	// Allow raster drivers to be used.
	RasterDrivers = Access(C.GDAL_OF_RASTER)

	// Allow vector drivers to be used.
	VectorDrivers = Access(C.GDAL_OF_VECTOR)

	// Allow gnm drivers to be used.
	GNMDrivers = Access(C.GDAL_OF_GNM)

	// Unsure
	KindMask = Access(C.GDAL_OF_KIND_MASK)

	// Open in shared mode.
	Shared = Access(C.GDAL_OF_SHARED)

	// Emit error message in case of failed open.
	Verbose = Access(C.GDAL_OF_VERBOSE_ERROR)

	// Open as internal dataset. Such dataset isn't registered in the global list
	// of opened dataset. Cannot be used with GDAL_OF_SHARED.
	Internal = Access(C.GDAL_OF_INTERNAL)
)
View Source
const (
	// Read data
	Read = RWFlag(C.GF_Read)
	// Write data
	Write = RWFlag(C.GF_Write)
)
View Source
const (
	CI_Undefined      = ColorInterp(C.GCI_Undefined)
	CI_GrayIndex      = ColorInterp(C.GCI_GrayIndex)
	CI_PaletteIndex   = ColorInterp(C.GCI_PaletteIndex)
	CI_RedBand        = ColorInterp(C.GCI_RedBand)
	CI_GreenBand      = ColorInterp(C.GCI_GreenBand)
	CI_BlueBand       = ColorInterp(C.GCI_BlueBand)
	CI_AlphaBand      = ColorInterp(C.GCI_AlphaBand)
	CI_HueBand        = ColorInterp(C.GCI_HueBand)
	CI_SaturationBand = ColorInterp(C.GCI_SaturationBand)
	CI_LightnessBand  = ColorInterp(C.GCI_LightnessBand)
	CI_CyanBand       = ColorInterp(C.GCI_CyanBand)
	CI_MagentaBand    = ColorInterp(C.GCI_MagentaBand)
	CI_YellowBand     = ColorInterp(C.GCI_YellowBand)
	CI_BlackBand      = ColorInterp(C.GCI_BlackBand)
	CI_YCbCr_YBand    = ColorInterp(C.GCI_YCbCr_YBand)
	CI_YCbCr_CbBand   = ColorInterp(C.GCI_YCbCr_CbBand)
	CI_YCbCr_CrBand   = ColorInterp(C.GCI_YCbCr_CrBand)
	CI_Max            = ColorInterp(C.GCI_Max)
)
View Source
const (
	MD_AREA_OR_POINT = string(C.GDALMD_AREA_OR_POINT)
	MD_AOP_AREA      = string(C.GDALMD_AOP_AREA)
	MD_AOP_POINT     = string(C.GDALMD_AOP_POINT)
)

"well known" metadata items.

View Source
const (
	DMD_LONGNAME           = string(C.GDAL_DMD_LONGNAME)
	DMD_HELPTOPIC          = string(C.GDAL_DMD_HELPTOPIC)
	DMD_MIMETYPE           = string(C.GDAL_DMD_MIMETYPE)
	DMD_EXTENSION          = string(C.GDAL_DMD_EXTENSION)
	DMD_CREATIONOPTIONLIST = string(C.GDAL_DMD_CREATIONOPTIONLIST)
	DMD_CREATIONDATATYPES  = string(C.GDAL_DMD_CREATIONDATATYPES)
	DCAP_CREATE            = string(C.GDAL_DCAP_CREATE)
	DCAP_CREATECOPY        = string(C.GDAL_DCAP_CREATECOPY)
	DCAP_VIRTUALIO         = string(C.GDAL_DCAP_VIRTUALIO)
)
View Source
const (
	GRA_NearestNeighbour = ResampleAlg(0)
	GRA_Bilinear         = ResampleAlg(1)
	GRA_Cubic            = ResampleAlg(2)
	GRA_CubicSpline      = ResampleAlg(3)
	GRA_Lanczos          = ResampleAlg(4)
)
View Source
const (
	GT_Unknown               = GeometryType(C.wkbUnknown)
	GT_Point                 = GeometryType(C.wkbPoint)
	GT_LineString            = GeometryType(C.wkbLineString)
	GT_Polygon               = GeometryType(C.wkbPolygon)
	GT_MultiPoint            = GeometryType(C.wkbMultiPoint)
	GT_MultiLineString       = GeometryType(C.wkbMultiLineString)
	GT_MultiPolygon          = GeometryType(C.wkbMultiPolygon)
	GT_GeometryCollection    = GeometryType(C.wkbGeometryCollection)
	GT_None                  = GeometryType(C.wkbNone)
	GT_LinearRing            = GeometryType(C.wkbLinearRing)
	GT_Point25D              = GeometryType(C.wkbPoint25D)
	GT_LineString25D         = GeometryType(C.wkbLineString25D)
	GT_Polygon25D            = GeometryType(C.wkbPolygon25D)
	GT_MultiPoint25D         = GeometryType(C.wkbMultiPoint25D)
	GT_MultiLineString25D    = GeometryType(C.wkbMultiLineString25D)
	GT_MultiPolygon25D       = GeometryType(C.wkbMultiPolygon25D)
	GT_GeometryCollection25D = GeometryType(C.wkbGeometryCollection25D)
)
View Source
const (
	FT_Integer     = FieldType(C.OFTInteger)
	FT_IntegerList = FieldType(C.OFTIntegerList)
	FT_Real        = FieldType(C.OFTReal)
	FT_RealList    = FieldType(C.OFTRealList)
	FT_String      = FieldType(C.OFTString)
	FT_StringList  = FieldType(C.OFTStringList)
	FT_Binary      = FieldType(C.OFTBinary)
	FT_Date        = FieldType(C.OFTDate)
	FT_Time        = FieldType(C.OFTTime)
	FT_DateTime    = FieldType(C.OFTDateTime)
)
View Source
const (
	J_Undefined = Justification(C.OJUndefined)
	J_Left      = Justification(C.OJLeft)
	J_Right     = Justification(C.OJRight)
)
View Source
const (
	GFT_Integer = RATFieldType(C.GFT_Integer)
	GFT_Real    = RATFieldType(C.GFT_Real)
	GFT_String  = RATFieldType(C.GFT_String)
)
View Source
const (
	GFU_Generic    = RATFieldUsage(C.GFU_Generic)
	GFU_PixelCount = RATFieldUsage(C.GFU_PixelCount)
	GFU_Name       = RATFieldUsage(C.GFU_Name)
	GFU_Min        = RATFieldUsage(C.GFU_Min)
	GFU_Max        = RATFieldUsage(C.GFU_Max)
	GFU_MinMax     = RATFieldUsage(C.GFU_MinMax)
	GFU_Red        = RATFieldUsage(C.GFU_Red)
	GFU_Green      = RATFieldUsage(C.GFU_Green)
	GFU_Blue       = RATFieldUsage(C.GFU_Blue)
	GFU_Alpha      = RATFieldUsage(C.GFU_Alpha)
	GFU_RedMin     = RATFieldUsage(C.GFU_RedMin)
	GFU_GreenMin   = RATFieldUsage(C.GFU_GreenMin)
	GFU_BlueMin    = RATFieldUsage(C.GFU_BlueMin)
	GFU_AlphaMin   = RATFieldUsage(C.GFU_AlphaMin)
	GFU_RedMax     = RATFieldUsage(C.GFU_RedMax)
	GFU_GreenMax   = RATFieldUsage(C.GFU_GreenMax)
	GFU_BlueMax    = RATFieldUsage(C.GFU_BlueMax)
	GFU_AlphaMax   = RATFieldUsage(C.GFU_AlphaMax)
	GFU_MaxCount   = RATFieldUsage(C.GFU_MaxCount)
)

Variables

View Source
var (
	ErrDebug   = errors.New("Debug Error")
	ErrWarning = errors.New("Warning Error")
	ErrFailure = errors.New("Failure Error")
	ErrFatal   = errors.New("Fatal Error")
	ErrIllegal = errors.New("Illegal Error")
)
View Source
var (
	ErrOGRNotEnoughData           = errors.New("not enough data")
	ErrOGRNotEnoughMemory         = errors.New("not enough memory")
	ErrOGRUnsupportedGeometryType = errors.New("unsupported geometry type")
	ErrOGRUnsupportedOperation    = errors.New("unsupported operation")
	ErrOGRCorruptData             = errors.New("corrupt data")
	ErrOGRFailure                 = errors.New("failure")
	ErrOGRUnsupportedSRS          = errors.New("unsupported SRS")
	ErrOGRInvalidHandle           = errors.New("invalid handle")
	ErrOGRNonExistingFeature      = errors.New("non-existing feature")
	EOL                           = errors.New("end of features")
)

OGR errors

View Source
var ErrIllegalBand = errors.New("illegal band #")

ErrInvalidBand represents an invalid band number when requested. It is set when the return from GDALGetRasterBand(n) is NULL.

View Source
var ErrInvalidDriver = errors.New("driver not found")

Functions

func BoolToCInt

func BoolToCInt(in bool) (out C.int)

Convert a go bool to a C int

func CIntSliceToInt

func CIntSliceToInt(data []C.GUIntBig) []uint64

Safe array conversion

func CleanupOGR

func CleanupOGR()

Clean up all OGR related resources

func CleanupSR

func CleanupSR()

Cleanup cached SRS related memory

func ComputeMedianCutPCT

func ComputeMedianCutPCT(
	red, green, blue *RasterBand,
	colors int,
	ct ColorTable,
	progress ProgressFunc,
	data interface{},
) int

Compute optimal PCT for RGB image

func ConfigOption

func ConfigOption(key, def string) string

ConfigOption reads an internal configuration option.

The value is the value of a (key, value) option set with CPLSetConfigOption(). If the given option was no defined with CPLSetConfigOption(), it tries to find it in environment variables.

Note: the string returned by CPLGetConfigOption() might be short-lived, and in particular it will become invalid after a call to CPLSetConfigOption() with the same key.

To override temporary a potentially existing option with a new value, you can use the following snippet :

// backup old value
const char* pszOldValTmp = CPLGetConfigOption(pszKey, NULL);
char* pszOldVal = pszOldValTmp ? CPLStrdup(pszOldValTmp) : NULL;
// override with new value
CPLSetConfigOption(pszKey, pszNewVal);
// do something useful
// restore old value
CPLSetConfigOption(pszKey, pszOldVal);
CPLFree(pszOldVal);

see SetConfigOption()

http://trac.osgeo.org/gdal/wiki/ConfigOptions

func CreateScaledProgress

func CreateScaledProgress(min, max float64, progress ProgressFunc, data unsafe.Pointer) unsafe.Pointer

func DestroyDriverManager

func DestroyDriverManager()

Destroy the driver manager

func DestroyScaledProgress

func DestroyScaledProgress(data unsafe.Pointer)

func DitherRGB2PCT

func DitherRGB2PCT(
	red, green, blue, target *RasterBand,
	ct ColorTable,
	progress ProgressFunc,
	data interface{},
) int

24bit to 8bit conversion with dithering

func DummyProgress

func DummyProgress(complete float64, message string, data interface{}) int

func FlushCacheBlock

func FlushCacheBlock() bool

Try to flush one cached raster block

func GetCacheMax

func GetCacheMax() int

Get maximum cache memory

func GetCacheUsed

func GetCacheUsed() int

Get cache memory used

func GetDriverCount

func GetDriverCount() int

Fetch the number of registered drivers.

func Grid

func Grid(
	algorithm GridAlgorithm,
	options interface{},
	x, y, z []float64,
	xmin, xmax float64,
	ymin, ymax float64,
	xsize, ysize uint32,
	buffer interface{},
	progress ProgressFunc,
	data interface{},
) error

Fill selected raster regions by interpolation from the edges

func HTTPEnabled

func HTTPEnabled() bool

HTTPEnabled returns if CPLHTTP services can be useful

Those services depend on GDAL being build with libcurl support.

func IntSliceToCInt

func IntSliceToCInt(data []int) []C.int

Safe array conversion

func InvGeoTransform

func InvGeoTransform(transform [6]float64) [6]float64

Invert the supplied transform

func OGRDriverCount

func OGRDriverCount() int

Fetch the number of registered drivers

func OpenDataSourceCount

func OpenDataSourceCount() int

Return the number of opened data sources

func ParameterInfo

func ParameterInfo(
	projectionMethod, parameterName string,
) (
	username, paramType string,
	defaultValue float64,
	ok bool,
)

Fetch information about a single parameter of a projection method

func ParameterList

func ParameterList(method string) (params []string, name string)

Fetch the parameters for a given projection method

func PopHandler

func PopHandler()

PopHandler pops the current error handler off of the error handling function stack.

func ProjectionMethods

func ProjectionMethods() []string

Fetch list of possible projection methods

func PushQuietHandler

func PushQuietHandler()

PushQuietHandler installs the no-op error handling mechanism in GDAL. No output is printed out for warnings or errors. Use PopHandler() to uninstall the quiet handler.

func ScaledProgress

func ScaledProgress(complete float64, message string, data interface{}) int

func SetCacheMax

func SetCacheMax(bytes int)

Set maximum cache memory

func SetConfigOption

func SetConfigOption(key, value string)

SetConfigOption

Set a configuration option for GDAL/OGR use.

Those options are defined as a (key, value) couple. The value corresponding to a key can be got later with the CPLGetConfigOption() method.

This mechanism is similar to environment variables, but options set with CPLSetConfigOption() overrides, for CPLGetConfigOption() point of view, values defined in the environment.

If CPLSetConfigOption() is called several times with the same key, the value provided during the last call will be used.

Options can also be passed on the command line of most GDAL utilities with the with '--config KEY VALUE'. For example, ogrinfo --config CPL_DEBUG ON ~/data/test/point.shp

This function can also be used to clear a setting by passing NULL as the value (note: passing NULL will not unset an existing environment variable; it will just unset a value previously set by CPLSetConfigOption()).

see GetConfigOption

http://trac.osgeo.org/gdal/wiki/ConfigOptions

func TermProgress

func TermProgress(complete float64, message string, data interface{}) int

Types

type Access

type Access uint

Flag indicating read/write, or read-only access to data.

type AsyncReader

type AsyncReader struct {
	// contains filtered or unexported fields
}

type AsyncStatusType

type AsyncStatusType int

status of the asynchronous stream

func GetAsyncStatusTypeByName

func GetAsyncStatusTypeByName(statusTypeName string) AsyncStatusType

func (AsyncStatusType) Name

func (statusType AsyncStatusType) Name() string

type ColorEntry

type ColorEntry struct {
	// contains filtered or unexported fields
}

type ColorInterp

type ColorInterp int

Types of color interpretation for raster bands.

func GetColorInterpretationByName

func GetColorInterpretationByName(name string) ColorInterp

func (ColorInterp) Name

func (colorInterp ColorInterp) Name() string

type ColorTable

type ColorTable struct {
	// contains filtered or unexported fields
}

func CreateColorTable

func CreateColorTable(interp PaletteInterp) *ColorTable

Construct a new color table

func (*ColorTable) Clone

func (ct *ColorTable) Clone() *ColorTable

Make a copy of the color table

func (*ColorTable) CreateColorRamp

func (ct *ColorTable) CreateColorRamp(start, end int, startColor, endColor *ColorEntry)

Create color ramp

func (*ColorTable) Destroy

func (ct *ColorTable) Destroy()

Destroy the color table

func (*ColorTable) Entry

func (ct *ColorTable) Entry(index int) *ColorEntry

Fetch a color entry from table

func (*ColorTable) EntryCount

func (ct *ColorTable) EntryCount() int

Get number of color entries in table

func (*ColorTable) PaletteInterpretation

func (ct *ColorTable) PaletteInterpretation() PaletteInterp

Fetch palette interpretation

func (*ColorTable) SetEntry

func (ct *ColorTable) SetEntry(index int, entry *ColorEntry)

Set entry in color table

type CoordinateTransform

type CoordinateTransform struct {
	// contains filtered or unexported fields
}

func CreateCoordinateTransform

func CreateCoordinateTransform(
	source *SpatialReference,
	dest *SpatialReference,
) *CoordinateTransform

Create a new CoordinateTransform

func (*CoordinateTransform) Destroy

func (ct *CoordinateTransform) Destroy()

Destroy CoordinateTransform

func (*CoordinateTransform) Transform

func (ct *CoordinateTransform) Transform(numPoints int, xPoints []float64, yPoints []float64, zPoints []float64) bool

type DataSource

type DataSource struct {
	// contains filtered or unexported fields
}

func OpenDataSource

func OpenDataSource(name string, update int) *DataSource

Open a file / data source with one of the registered drivers

func OpenDataSourceByIndex

func OpenDataSourceByIndex(index int) *DataSource

Return the i'th datasource opened

func OpenSharedDataSource

func OpenSharedDataSource(name string, update int) *DataSource

Open a shared file / data source with one of the registered drivers

func (*DataSource) CopyLayer

func (ds *DataSource) CopyLayer(
	source Layer,
	name string,
	options []string,
) *Layer

Duplicate an existing layer

func (*DataSource) CreateLayer

func (ds *DataSource) CreateLayer(
	name string,
	sr SpatialReference,
	geomType GeometryType,
	options []string,
) *Layer

Create a new layer on the data source

func (*DataSource) Delete

func (ds *DataSource) Delete(index int) error

Delete the layer from the data source

func (*DataSource) Destroy

func (ds *DataSource) Destroy()

Closes datasource and releases resources

func (*DataSource) Driver

func (ds *DataSource) Driver() *OGRDriver

Fetch the driver that the data source was opened with

func (*DataSource) ExecuteSQL

func (ds *DataSource) ExecuteSQL(sql string, filter Geometry, dialect string) *Layer

Execute an SQL statement against the data source

func (*DataSource) LayerByIndex

func (ds *DataSource) LayerByIndex(index int) *Layer

Fetch a layer of this data source by index

func (*DataSource) LayerByName

func (ds *DataSource) LayerByName(name string) *Layer

Fetch a layer of this data source by name

func (*DataSource) LayerCount

func (ds *DataSource) LayerCount() int

Fetch the number of layers in this data source

func (*DataSource) Name

func (ds *DataSource) Name() string

Fetch the name of the data source

func (*DataSource) Release

func (ds *DataSource) Release() error

Drop a reference to this datasource and destroy if reference is zero

func (*DataSource) ReleaseResultSet

func (ds *DataSource) ReleaseResultSet(layer *Layer)

Release the results of ExecuteSQL

func (*DataSource) Sync

func (ds *DataSource) Sync() error

Flush pending changes to the data source

func (*DataSource) TestCapability

func (ds *DataSource) TestCapability(capability string) bool

Test if the data source has the indicated capability

type DataType

type DataType int

Pixel data types

func (DataType) IsComplex

func (dataType DataType) IsComplex() int

func (DataType) Name

func (dataType DataType) Name() string

func (DataType) Size

func (dataType DataType) Size() int

Get data type size in bits.

func (DataType) Union

func (dataType DataType) Union(dataTypeB DataType) DataType

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

func Open

func Open(filename string, access Access) (*Dataset, error)

Open an existing dataset

func OpenEx

func OpenEx(filename string, flags Access, allowedDrivers []string, options []string, siblingFiles []string) (*Dataset, error)

TODO(kyle): deprecate Open(), rename OpenEx->Open

func OpenShared

func OpenShared(filename string, access Access) *Dataset

Open a shared existing dataset

func (*Dataset) Access

func (dataset *Dataset) Access() Access

Return access flag

func (*Dataset) AddBand

func (dataset *Dataset) AddBand(dataType DataType, options []string) error

Add a band to a dataset

func (*Dataset) AdviseRead

func (dataset *Dataset) AdviseRead(
	rwFlag RWFlag,
	xOff, yOff, xSize, ySize, bufXSize, bufYSize int,
	dataType DataType,
	bandCount int,
	bandMap []int,
	options []string,
) error

Advise driver of upcoming read requests

func (*Dataset) AutoCreateWarpedVRT

func (dataset *Dataset) AutoCreateWarpedVRT(srcWKT, dstWKT string, resampleAlg ResampleAlg) (*Dataset, error)

func (*Dataset) BuildOverviews

func (dataset *Dataset) BuildOverviews(
	resampling string,
	nOverviews int,
	overviewList []int,
	nBands int,
	bandList []int,
	progress ProgressFunc,
	data interface{},
) error

Build raster overview(s)

func (*Dataset) Close

func (dataset *Dataset) Close()

Close the dataset

func (*Dataset) CopyWholeRaster

func (sourceDataset *Dataset) CopyWholeRaster(
	destDataset *Dataset,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Copy all dataset raster data

func (*Dataset) CreateMaskBand

func (dataset *Dataset) CreateMaskBand(flags int) error

Adds a mask band to the dataset

func (*Dataset) Driver

func (dataset *Dataset) Driver() *Driver

Get the driver to which this dataset relates

func (*Dataset) ExecuteSQL

func (ds *Dataset) ExecuteSQL(sql string, spatialFilter Geometry, dialect string) (*Layer, error)

ExecuteSQL Executes an SQL statement against the data store.

The result of an SQL query is either NULL for statements that are in error, or that have no results set, or an OGRLayer pointer representing a results set from the query. Note that this OGRLayer is in addition to the layers in the data store and must be destroyed with ReleaseResultSet() before the dataset is closed (destroyed).

This method is the same as the C++ method GDALDataset::ExecuteSQL()

For more information on the SQL dialect supported internally by OGR review the OGR SQL document. Some drivers (i.e. Oracle and PostGIS) pass the SQL directly through to the underlying RDBMS.

func (*Dataset) FileList

func (dataset *Dataset) FileList() []string

Fetch files forming the dataset.

func (*Dataset) FlushCache

func (dataset *Dataset) FlushCache()

Write all write cached data to disk

func (*Dataset) GDALDereferenceDataset

func (dataset *Dataset) GDALDereferenceDataset() int

Subtract one from dataset reference count

func (*Dataset) GDALGetGCPCount

func (dataset *Dataset) GDALGetGCPCount() int

Get number of GCPs

func (*Dataset) GDALGetInternalHandle

func (dataset *Dataset) GDALGetInternalHandle(request string) unsafe.Pointer

Fetch a format specific internally meaningful handle

func (*Dataset) GDALReferenceDataset

func (dataset *Dataset) GDALReferenceDataset() int

Add one to dataset reference count

func (*Dataset) GeoTransform

func (dataset *Dataset) GeoTransform() [6]float64

Get the affine transformation coefficients

func (*Dataset) IO

func (dataset *Dataset) IO(
	rwFlag RWFlag,
	xOff, yOff, xSize, ySize int,
	buffer interface{},
	bufXSize, bufYSize int,
	bandCount int,
	bandMap []int,
	pixelSpace, lineSpace, bandSpace int,
) error

Read / write a region of image data from multiple bands

func (*Dataset) InvGeoTransform

func (dataset *Dataset) InvGeoTransform() [6]float64

Return the inverted transform

func (*Dataset) Layer

func (ds *Dataset) Layer(layer int) (*Layer, error)

LayerByIndex fetches a layer by index.

The returned layer remains owned by the GDALDataset and should not be deleted by the application.

This function is the same as the C++ method GDALDataset::GetLayer()

func (*Dataset) LayerByName

func (ds *Dataset) LayerByName(name string) (*Layer, error)

LayerByName fetches a layer by name.

The returned layer remains owned by the GDALDataset and should not be deleted by the application.

This function is the same as the C++ method GDALDataset::GetLayerByName()

func (*Dataset) LayerCount

func (ds *Dataset) LayerCount() int

LayerCount gets the number of layers in this dataset.

func (*Dataset) Metadata

func (dataset *Dataset) Metadata(domain string) []string

func (*Dataset) ProjectionRef

func (dataset *Dataset) ProjectionRef() string

Fetch the projection definition string for this dataset

func (*Dataset) RasterBand

func (dataset *Dataset) RasterBand(band int) (*RasterBand, error)

RasterBand returns the RasterBand at index band, where:

0 > band >= Dataset.RasterCount()

If the band is invalid, nil and ErrInvalidBand is returned

func (*Dataset) RasterCount

func (dataset *Dataset) RasterCount() int

Fetch the number of raster bands in the dataset

func (*Dataset) RasterXSize

func (dataset *Dataset) RasterXSize() int

Fetch X size of raster

func (*Dataset) RasterYSize

func (dataset *Dataset) RasterYSize() int

Fetch Y size of raster

func (*Dataset) SetGeoTransform

func (dataset *Dataset) SetGeoTransform(transform [6]float64) error

Set the affine transformation coefficients

func (*Dataset) SetMetadataItem

func (object *Dataset) SetMetadataItem(name, value, domain string) error

func (*Dataset) SetProjection

func (dataset *Dataset) SetProjection(proj string) error

Set the projection reference string

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func GetDriver

func GetDriver(index int) (*Driver, error)

Fetch driver by index

func GetDriverByName

func GetDriverByName(driverName string) (*Driver, error)

Return the driver by short name

func IdentifyDriver

func IdentifyDriver(filename string, filenameList []string) *Driver

Return the driver needed to access the provided dataset name.

func (*Driver) CopyDatasetFiles

func (driver *Driver) CopyDatasetFiles(newName, oldName string) error

Copy all files associated with the named dataset

func (*Driver) Create

func (driver *Driver) Create(
	filename string,
	xSize, ySize, bands int,
	dataType DataType,
	options []string,
) *Dataset

Create a new dataset with this driver.

func (*Driver) CreateCopy

func (driver *Driver) CreateCopy(
	filename string,
	sourceDataset Dataset,
	strict int,
	options []string,
	progress ProgressFunc,
	data interface{},
) *Dataset

Create a copy of a dataset

func (*Driver) DeleteDataset

func (driver *Driver) DeleteDataset(name string) error

Delete named dataset

func (*Driver) Deregister

func (driver *Driver) Deregister()

Deregister the driver

func (*Driver) Destroy

func (driver *Driver) Destroy()

Destroy a GDAL driver

func (*Driver) LongName

func (driver *Driver) LongName() string

Get the long name associated with this driver

func (*Driver) MetadataItem

func (object *Driver) MetadataItem(name, domain string) string

Fetch single metadata item.

func (*Driver) Register

func (driver *Driver) Register() int

Registers a driver for use

func (*Driver) RenameDataset

func (driver *Driver) RenameDataset(newName, oldName string) error

Rename named dataset

func (*Driver) ShortName

func (driver *Driver) ShortName() string

Get the short name associated with this driver

type Envelope

type Envelope struct {
	// contains filtered or unexported fields
}

func (Envelope) Contains

func (env Envelope) Contains(other Envelope) bool

Test if one envelope completely contains another

func (Envelope) Intersect

func (env Envelope) Intersect(other Envelope)

Return the intersection of this envelope with another

func (Envelope) Intersects

func (env Envelope) Intersects(other Envelope) bool

Test if one envelope intersects another

func (Envelope) IsInit

func (env Envelope) IsInit() bool

func (Envelope) MaxX

func (env Envelope) MaxX() float64

func (Envelope) MaxY

func (env Envelope) MaxY() float64

func (Envelope) MinX

func (env Envelope) MinX() float64

func (Envelope) MinY

func (env Envelope) MinY() float64

func (*Envelope) SetMaxX

func (env *Envelope) SetMaxX(val float64)

func (*Envelope) SetMaxY

func (env *Envelope) SetMaxY(val float64)

func (*Envelope) SetMinX

func (env *Envelope) SetMinX(val float64)

func (*Envelope) SetMinY

func (env *Envelope) SetMinY(val float64)

func (Envelope) Union

func (env Envelope) Union(other Envelope) Envelope

Return the union of this envelope with another one

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

func (*Feature) Clone

func (feature *Feature) Clone() *Feature

Duplicate feature

func (*Feature) Definition

func (feature *Feature) Definition() *FeatureDefinition

Fetch feature definition

func (Feature) Destroy

func (feature Feature) Destroy()

Destroy this feature

func (*Feature) Equal

func (f1 *Feature) Equal(f2 *Feature) bool

Test if two features are the same

func (*Feature) FID

func (feature *Feature) FID() int

Fetch feature indentifier

func (*Feature) FieldAsBinary

func (feature *Feature) FieldAsBinary(index int) []uint8

Fetch field as binary data

func (*Feature) FieldAsDateTime

func (feature *Feature) FieldAsDateTime(index int) (time.Time, bool)

Fetch field as date and time

func (*Feature) FieldAsFloat64

func (feature *Feature) FieldAsFloat64(index int) float64

Fetch field value as float64

func (*Feature) FieldAsFloat64List

func (feature *Feature) FieldAsFloat64List(index int) []float64

Fetch field as list of float64

func (*Feature) FieldAsInteger

func (feature *Feature) FieldAsInteger(index int) int

Fetch field value as integer

func (*Feature) FieldAsIntegerList

func (feature *Feature) FieldAsIntegerList(index int) []int

Fetch field as list of integers

func (*Feature) FieldAsString

func (feature *Feature) FieldAsString(index int) string

Fetch field value as string

func (*Feature) FieldAsStringList

func (feature *Feature) FieldAsStringList(index int) []string

Fetch field as list of strings

func (*Feature) FieldCount

func (feature *Feature) FieldCount() int

Fetch number of fields on this feature

func (*Feature) FieldDefinition

func (feature *Feature) FieldDefinition(index int) *FieldDefinition

Fetch definition for the indicated field

func (*Feature) FieldIndex

func (feature *Feature) FieldIndex(name string) int

Fetch the field index for the given field name

func (*Feature) Geometry

func (feature *Feature) Geometry() *Geometry

Fetch geometry of this feature

func (Feature) IsFieldSet

func (feature Feature) IsFieldSet(index int) bool

Return if a field has ever been assigned a value

func (*Feature) RawField

func (feature *Feature) RawField(index int) *Field

Fetch a reference to the internal field value

func (*Feature) SetFID

func (feature *Feature) SetFID(fid int) error

Set feature identifier

func (*Feature) SetFieldBinary

func (feature *Feature) SetFieldBinary(index int, value []uint8)

Set field as binary data

func (*Feature) SetFieldDateTime

func (feature *Feature) SetFieldDateTime(index int, dt time.Time)

Set field as date / time

func (*Feature) SetFieldFloat64

func (feature *Feature) SetFieldFloat64(index int, value float64)

Set field to float64 value

func (*Feature) SetFieldFloat64List

func (feature *Feature) SetFieldFloat64List(index int, value []float64)

Set field to list of float64

func (*Feature) SetFieldInteger

func (feature *Feature) SetFieldInteger(index, value int)

Set field to integer value

func (*Feature) SetFieldIntegerList

func (feature *Feature) SetFieldIntegerList(index int, value []int)

Set field to list of integers

func (*Feature) SetFieldRaw

func (feature *Feature) SetFieldRaw(index int, field Field)

Set field from the raw field pointer

func (*Feature) SetFieldString

func (feature *Feature) SetFieldString(index int, value string)

Set field to string value

func (*Feature) SetFieldStringList

func (feature *Feature) SetFieldStringList(index int, value []string)

Set field to list of strings

func (*Feature) SetFrom

func (this *Feature) SetFrom(other *Feature, forgiving int) error

Set one feature from another

func (*Feature) SetFromWithMap

func (this *Feature) SetFromWithMap(other *Feature, forgiving int, fieldMap []int) error

Set one feature from another, using field map

func (Feature) SetGeometry

func (feature Feature) SetGeometry(geom Geometry) error

Set feature geometry

func (Feature) SetGeometryDirectly

func (feature Feature) SetGeometryDirectly(geom Geometry) error

Set feature geometry, passing ownership to the feature

func (*Feature) SetStyleString

func (feature *Feature) SetStyleString(style string)

Set style string for this feature

func (*Feature) StealGeometry

func (feature *Feature) StealGeometry() *Geometry

Fetch geometry of this feature and assume ownership

func (*Feature) StlyeString

func (feature *Feature) StlyeString() string

Fetch style string for this feature

func (*Feature) UnsetField

func (feature *Feature) UnsetField(index int)

Clear a field and mark it as unset

type FeatureDefinition

type FeatureDefinition struct {
	// contains filtered or unexported fields
}

func CreateFeatureDefinition

func CreateFeatureDefinition(name string) *FeatureDefinition

Create a new feature definition object

func (*FeatureDefinition) AddFieldDefinition

func (fd *FeatureDefinition) AddFieldDefinition(fieldDefn *FieldDefinition)

Add a new field definition to this feature definition

func (*FeatureDefinition) Create

func (fd *FeatureDefinition) Create() *Feature

Create a feature from this feature definition

func (*FeatureDefinition) DeleteFieldDefinition

func (fd *FeatureDefinition) DeleteFieldDefinition(index int) error

Delete a field definition from this feature definition

func (*FeatureDefinition) Dereference

func (fd *FeatureDefinition) Dereference() int

Decrement the reference count by one

func (*FeatureDefinition) Destroy

func (fd *FeatureDefinition) Destroy()

Destroy a feature definition object

func (*FeatureDefinition) FieldCount

func (fd *FeatureDefinition) FieldCount() int

Fetch the number of fields in the feature definition

func (*FeatureDefinition) FieldDefinition

func (fd *FeatureDefinition) FieldDefinition(index int) *FieldDefinition

Fetch the definition of the indicated field

func (*FeatureDefinition) FieldIndex

func (fd *FeatureDefinition) FieldIndex(name string) int

Fetch the index of the named field

func (*FeatureDefinition) GeometryType

func (fd *FeatureDefinition) GeometryType() GeometryType

Fetch the geometry base type of this feature definition

func (*FeatureDefinition) IsGeometryIgnored

func (fd *FeatureDefinition) IsGeometryIgnored() bool

Fetch if the geometry can be ignored when fetching features

func (*FeatureDefinition) IsStyleIgnored

func (fd *FeatureDefinition) IsStyleIgnored() bool

Fetch if the style can be ignored when fetching features

func (*FeatureDefinition) Name

func (fd *FeatureDefinition) Name() string

Fetch the name of this feature definition

func (*FeatureDefinition) Reference

func (fd *FeatureDefinition) Reference() int

Increment the reference count by one

func (*FeatureDefinition) ReferenceCount

func (fd *FeatureDefinition) ReferenceCount() int

Fetch the current reference count

func (*FeatureDefinition) Release

func (fd *FeatureDefinition) Release()

Drop a reference, and delete object if no references remain

func (*FeatureDefinition) SetGeometryIgnored

func (fd *FeatureDefinition) SetGeometryIgnored(val bool)

Set whether the geometry can be ignored when fetching features

func (*FeatureDefinition) SetGeometryType

func (fd *FeatureDefinition) SetGeometryType(geomType GeometryType)

Set the geometry base type for this feature definition

func (*FeatureDefinition) SetStyleIgnored

func (fd *FeatureDefinition) SetStyleIgnored(val bool)

Set whether the style can be ignored when fetching features

type Field

type Field struct {
	// contains filtered or unexported fields
}

type FieldDefinition

type FieldDefinition struct {
	// contains filtered or unexported fields
}

func CreateFieldDefinition

func CreateFieldDefinition(name string, fieldType FieldType) *FieldDefinition

Create a new field definition

func (*FieldDefinition) Destroy

func (fd *FieldDefinition) Destroy()

Destroy the field definition

func (*FieldDefinition) IsIgnored

func (fd *FieldDefinition) IsIgnored() bool

Fetch whether this field should be ignored when fetching features

func (*FieldDefinition) Justification

func (fd *FieldDefinition) Justification() Justification

Fetch the justification for this field

func (*FieldDefinition) Name

func (fd *FieldDefinition) Name() string

Fetch the name of the field

func (*FieldDefinition) Precision

func (fd *FieldDefinition) Precision() int

Fetch the precision for this field

func (*FieldDefinition) Set

func (fd *FieldDefinition) Set(
	name string,
	fType FieldType,
	width, precision int,
	justify Justification,
)

Set defining parameters of field in a single call

func (*FieldDefinition) SetIgnored

func (fd *FieldDefinition) SetIgnored(ignore bool)

Set whether this field should be ignored when fetching features

func (*FieldDefinition) SetJustification

func (fd *FieldDefinition) SetJustification(justify Justification)

Set the justification for this field

func (*FieldDefinition) SetName

func (fd *FieldDefinition) SetName(name string)

Set the name of the field

func (*FieldDefinition) SetPrecision

func (fd *FieldDefinition) SetPrecision(precision int)

Set the precision for this field

func (*FieldDefinition) SetType

func (fd *FieldDefinition) SetType(fType FieldType)

Set the type of this field

func (*FieldDefinition) SetWidth

func (fd *FieldDefinition) SetWidth(width int)

Set the formatting width for this field

func (*FieldDefinition) Type

func (fd *FieldDefinition) Type() FieldType

Fetch the type of this field

func (*FieldDefinition) Width

func (fd *FieldDefinition) Width() int

Fetch the formatting width for this field

type FieldType

type FieldType int

List of well known binary geometry types

func (FieldType) Name

func (ft FieldType) Name() string

Fetch human readable name for the field type

type Geometry

type Geometry struct {
	// contains filtered or unexported fields
}

func ApproximateArcAngles

func ApproximateArcAngles(
	x, y, z,
	primaryRadius,
	secondaryRadius,
	rotation,
	startAngle,
	endAngle,
	stepSizeDegrees float64,
) *Geometry

Stroke arc to linestring

func Create

func Create(geomType GeometryType) *Geometry

Create an empty geometry of the desired type

func CreateFromGML

func CreateFromGML(gml string) *Geometry

Create a geometry from its GML representation

func CreateFromJson

func CreateFromJson(_json string) *Geometry

Create a geometry object from its GeoJSON representation

func CreateFromWKB

func CreateFromWKB(wkb []uint8, srs *SpatialReference, bytes int) (*Geometry, error)

Create a geometry object from its well known binary representation

func CreateFromWKT

func CreateFromWKT(wkt string, srs SpatialReference) (*Geometry, error)

Create a geometry object from its well known text representation

func (*Geometry) AddGeometry

func (geom *Geometry) AddGeometry(other *Geometry) error

Add a geometry to a geometry container

func (*Geometry) AddGeometryDirectly

func (geom *Geometry) AddGeometryDirectly(other *Geometry) error

Add a geometry to a geometry container and assign ownership to that container

func (*Geometry) AddPoint

func (geom *Geometry) AddPoint(x, y, z float64)

Add a new point to the geometry (line string or polygon only)

func (*Geometry) AddPoint2D

func (geom *Geometry) AddPoint2D(x, y float64)

Add a new point to the geometry (line string or polygon only), ignoring the 3rd dimension

func (*Geometry) Area

func (geom *Geometry) Area() float64

Compute area of geometry

func (*Geometry) Boundary

func (geom *Geometry) Boundary() *Geometry

Compute boundary for the geometry

func (*Geometry) Buffer

func (geom *Geometry) Buffer(distance float64, segments int) *Geometry

Compute buffer of the geometry

func (Geometry) BuildPolygonFromEdges

func (geom Geometry) BuildPolygonFromEdges(autoClose bool, tolerance float64) (Geometry, error)

Build a polygon / ring from a set of lines

func (*Geometry) Centroid

func (geom *Geometry) Centroid() *Geometry

Compute centroid of geometry

func (*Geometry) Clone

func (geom *Geometry) Clone() *Geometry

Create a copy of this geometry

func (*Geometry) CloseRings

func (geom *Geometry) CloseRings()

Force rings to be closed

func (*Geometry) Contains

func (geom *Geometry) Contains(other *Geometry) bool

Return true if this geometry contains the other

func (*Geometry) ConvexHull

func (geom *Geometry) ConvexHull() *Geometry

Compute convex hull for the geometry

func (*Geometry) CoordinateDimension

func (geom *Geometry) CoordinateDimension() int

Get the dimension of the coordinates in this geometry

func (*Geometry) Crosses

func (geom *Geometry) Crosses(other *Geometry) bool

Return true if this feature crosses the other

func (*Geometry) Destroy

func (geometry *Geometry) Destroy()

Destroy geometry object

func (*Geometry) Difference

func (geom *Geometry) Difference(other *Geometry) *Geometry

Compute difference between this geometry and the other

func (*Geometry) Dimension

func (geom *Geometry) Dimension() int

Get the dimension of this geometry

func (*Geometry) Disjoint

func (geom *Geometry) Disjoint(other *Geometry) bool

Return true if the features are disjoint

func (*Geometry) Distance

func (geom *Geometry) Distance(other *Geometry) float64

Compute distance between thie geometry and the other

func (*Geometry) Empty

func (geom *Geometry) Empty()

Clear the geometry to its uninitialized state

func (*Geometry) Envelope

func (geom *Geometry) Envelope() Envelope

Compute and return the bounding envelope for this geometry

func (*Geometry) Equals

func (geom *Geometry) Equals(other *Geometry) bool

Return true if these features are equal

func (*Geometry) FlattenTo2D

func (geom *Geometry) FlattenTo2D()

Convert geometry to strictly 2D

func (*Geometry) ForceToMultiLineString

func (geom *Geometry) ForceToMultiLineString() *Geometry

Convert to multilinestring

func (*Geometry) ForceToMultiPoint

func (geom *Geometry) ForceToMultiPoint() *Geometry

Convert to multipoint

func (*Geometry) ForceToMultiPolygon

func (geom *Geometry) ForceToMultiPolygon() *Geometry

Convert to multipolygon

func (*Geometry) ForceToPolygon

func (geom *Geometry) ForceToPolygon() *Geometry

Convert to polygon

func (*Geometry) FromWKB

func (geom *Geometry) FromWKB(wkb []uint8, bytes int) error

Assign a geometry from well known binary data

func (*Geometry) FromWKT

func (geom *Geometry) FromWKT(wkt string) error

Assign geometry object from its well known text representation

func (*Geometry) Geometry

func (geom *Geometry) Geometry(index int) *Geometry

Fetch geometry from a geometry container

func (*Geometry) GeometryCount

func (geom *Geometry) GeometryCount() int

Fetch the number of elements in the geometry, or number of geometries in the container

func (*Geometry) Intersection

func (geom *Geometry) Intersection(other *Geometry) *Geometry

Compute intersection of this geometry with the other

func (*Geometry) Intersects

func (geom *Geometry) Intersects(other *Geometry) bool

Return true if these features intersect

func (*Geometry) IsEmpty

func (geom *Geometry) IsEmpty() bool

Test if the geometry is empty

func (*Geometry) IsRing

func (geom *Geometry) IsRing() bool

Test if the geometry is a ring

func (*Geometry) IsSimple

func (geom *Geometry) IsSimple() bool

Test if the geometry is simple

func (*Geometry) IsValid

func (geom *Geometry) IsValid() bool

Test if the geometry is valid

func (*Geometry) Length

func (geom *Geometry) Length() float64

Compute length of geometry

func (*Geometry) Name

func (geom *Geometry) Name() string

Fetch geometry name

func (*Geometry) Overlaps

func (geom *Geometry) Overlaps(other *Geometry) bool

Return true if this geometry overlaps the other

func (*Geometry) Point

func (geom *Geometry) Point(index int) (x, y, z float64)

Fetch the coordinates of a point in the geometry

func (*Geometry) PointCount

func (geom *Geometry) PointCount() int

Fetch number of points in the geometry

func (*Geometry) Polygonize

func (geom *Geometry) Polygonize() *Geometry

Polygonize a set of sparse edges

func (Geometry) RemoveGeometry

func (geom Geometry) RemoveGeometry(index int, delete bool) error

Remove a geometry from the geometry container

func (*Geometry) Segmentize

func (geom *Geometry) Segmentize(distance float64)

Modify the geometry such that it has no line segment longer than the given distance

func (*Geometry) SetCoordinateDimension

func (geom *Geometry) SetCoordinateDimension(dim int)

Set the dimension of the coordinates in this geometry

func (*Geometry) SetPoint

func (geom *Geometry) SetPoint(index int, x, y, z float64)

Set the coordinates of a point in the geometry

func (*Geometry) SetPoint2D

func (geom *Geometry) SetPoint2D(index int, x, y float64)

Set the coordinates of a point in the geometry, ignoring the 3rd dimension

func (*Geometry) SetSpatialReference

func (geom *Geometry) SetSpatialReference(spatialRef *SpatialReference)

Assign a spatial reference to this geometry

func (*Geometry) Simplify

func (geom *Geometry) Simplify(tolerance float64) *Geometry

Simplify the geometry

func (*Geometry) SimplifyPreservingTopology

func (geom *Geometry) SimplifyPreservingTopology(tolerance float64) *Geometry

Simplify the geometry while preserving topology

func (*Geometry) SpatialReference

func (geom *Geometry) SpatialReference() *SpatialReference

Fetch the spatial reference associated with this geometry

func (*Geometry) SymmetricDifference

func (geom *Geometry) SymmetricDifference(other *Geometry) *Geometry

Compute symmetric difference between this geometry and the other

func (*Geometry) ToGML

func (geom *Geometry) ToGML() string

Convert a geometry to GML format

func (*Geometry) ToGML_Ex

func (geom *Geometry) ToGML_Ex(options []string) string

Convert a geometry to GML format with options

func (*Geometry) ToJSON

func (geom *Geometry) ToJSON() string

Convert a geometry to JSON format

func (*Geometry) ToJSON_ex

func (geom *Geometry) ToJSON_ex(options []string) string

Convert a geometry to JSON format with options

func (*Geometry) ToKML

func (geom *Geometry) ToKML() string

Convert a geometry to KML format

func (*Geometry) ToWKB

func (geom *Geometry) ToWKB() ([]uint8, error)

Convert a geometry to well known binary data

func (*Geometry) ToWKT

func (geom *Geometry) ToWKT() (string, error)

Fetch geometry as WKT

func (*Geometry) Touches

func (geom *Geometry) Touches(other *Geometry) bool

Return true if this feature touches the other

func (*Geometry) Transform

func (geom *Geometry) Transform(ct *CoordinateTransform) error

Apply coordinate transformation to geometry

func (*Geometry) TransformTo

func (geom *Geometry) TransformTo(sr *SpatialReference) error

Transform geometry to new spatial reference system

func (*Geometry) Type

func (geom *Geometry) Type() GeometryType

Fetch geometry type

func (*Geometry) Union

func (geom *Geometry) Union(other *Geometry) *Geometry

Compute union of this geometry with the other

func (*Geometry) WKBSize

func (geom *Geometry) WKBSize() int

Returns size of related binary representation

func (*Geometry) Within

func (geom *Geometry) Within(other *Geometry) bool

Return true if this geometry is within the other

func (*Geometry) X

func (geom *Geometry) X(index int) float64

Fetch the X coordinate of a point in the geometry

func (*Geometry) Y

func (geom *Geometry) Y(index int) float64

Fetch the Y coordinate of a point in the geometry

func (*Geometry) Z

func (geom *Geometry) Z(index int) float64

Fetch the Z coordinate of a point in the geometry

type GeometryType

type GeometryType uint32

List of well known binary geometry types

type GridAlgorithm

type GridAlgorithm uint8

TODO(kyle): this is not right

type GridOptions

type GridOptions struct {
	Power           float64
	Smoothing       float64
	AnisotropyRatio float64
	AnisotropyAngle float64
	Radius1         float64
	Radius2         float64
	Angle           float64
	MaxPoints       uint32
	MinPoints       uint32
	NoDataValue     float64
}

type Justification

type Justification int

type Layer

type Layer struct {
	// contains filtered or unexported fields
}

func (*Layer) AlterFieldDefn

func (layer *Layer) AlterFieldDefn(index int, newDefn FieldDefinition, flags int) error

Alter the definition of an existing field of a layer

func (*Layer) CommitTransaction

func (layer *Layer) CommitTransaction() error

Commit a transaction on data sources which support it

func (*Layer) CreateFeature

func (layer *Layer) CreateFeature(feature *Feature) error

Create and write a new feature within a layer

func (*Layer) CreateField

func (layer *Layer) CreateField(fd *FieldDefinition, approxOK bool) error

Create a new field on a layer

func (*Layer) Definition

func (layer *Layer) Definition() *FeatureDefinition

Fetch the schema information for this layer

func (*Layer) DeleteFeature

func (layer *Layer) DeleteFeature(index int) error

Delete indicated feature from layer

func (*Layer) DeleteField

func (layer *Layer) DeleteField(index int) error

Delete a field from the layer

func (*Layer) Extent

func (layer *Layer) Extent(force bool) (env Envelope, err error)

Fetch the extent of this layer

func (*Layer) FIDColumn

func (layer *Layer) FIDColumn() string

Fetch the name of the FID column

func (*Layer) Feature

func (layer *Layer) Feature(index int) *Feature

Fetch a feature by its index

func (*Layer) FeatureCount

func (layer *Layer) FeatureCount(force bool) (count int, ok bool)

Fetch the feature count for this layer

func (*Layer) GeomType

func (layer *Layer) GeomType() GeometryType

Return the layer geometry type

func (*Layer) GeometryColumn

func (layer *Layer) GeometryColumn() string

Fetch the name of the geometry column

func (*Layer) Name

func (layer *Layer) Name() string

Return the layer name

func (*Layer) NextFeature

func (layer *Layer) NextFeature() *Feature

Fetch the next available feature from this layer

func (*Layer) ReorderField

func (layer *Layer) ReorderField(oldIndex, newIndex int) error

Reorder an existing field of a layer

func (*Layer) ReorderFields

func (layer *Layer) ReorderFields(layerMap []int) error

Reorder all the fields of a layer

func (*Layer) ResetReading

func (layer *Layer) ResetReading()

Reset reading to start on the first feature

func (*Layer) RollbackTransaction

func (layer *Layer) RollbackTransaction() error

Roll back the current transaction on data sources which support it

func (*Layer) SetAttributeFilter

func (layer *Layer) SetAttributeFilter(filter string) error

Set a new attribute query filter

func (*Layer) SetFeature

func (layer *Layer) SetFeature(feature *Feature) error

Rewrite the provided feature

func (*Layer) SetIgnoredFields

func (layer *Layer) SetIgnoredFields(names []string) error

Set which fields can be ignored when retrieving features from the layer

func (*Layer) SetNextByIndex

func (layer *Layer) SetNextByIndex(index int) error

Move read cursor to the provided index

func (*Layer) SetSpatialFilter

func (layer *Layer) SetSpatialFilter(filter *Geometry)

Set a new spatial filter for this layer

func (*Layer) SetSpatialFilterRect

func (layer *Layer) SetSpatialFilterRect(minX, minY, maxX, maxY float64)

Set a new rectangular spatial filter for this layer

func (*Layer) SpatialFilter

func (layer *Layer) SpatialFilter() *Geometry

Return the current spatial filter for this layer

func (*Layer) SpatialRef

func (layer *Layer) SpatialRef() *SpatialReference

Fetch the spatial reference system for this layer

func (*Layer) StartTransaction

func (layer *Layer) StartTransaction() error

Begin a transation on data sources which support it

func (*Layer) Sync

func (layer *Layer) Sync() error

Flush pending changes to the layer

func (*Layer) TestCapability

func (layer *Layer) TestCapability(capability string) bool

Test if this layer supports the named capability

type MajorObject

type MajorObject struct {
	// contains filtered or unexported fields
}

func (MajorObject) Description

func (object MajorObject) Description() string

Fetch object description

func (MajorObject) Metadata

func (object MajorObject) Metadata(domain string) []string

Fetch metadata

func (MajorObject) MetadataItem

func (object MajorObject) MetadataItem(name, domain string) string

Fetch a single metadata item

func (MajorObject) SetDescription

func (object MajorObject) SetDescription(desc string)

Set object description

func (MajorObject) SetMetadata

func (object MajorObject) SetMetadata(metadata []string, domain string)

Set metadata

func (MajorObject) SetMetadataItem

func (object MajorObject) SetMetadataItem(name, value, domain string)

Set a single metadata item

type OGRDriver

type OGRDriver struct {
	// contains filtered or unexported fields
}

func OGRDriverByIndex

func OGRDriverByIndex(index int) *OGRDriver

Fetch the indicated driver by index

func OGRDriverByName

func OGRDriverByName(name string) *OGRDriver

Fetch the indicated driver by name

func (*OGRDriver) Copy

func (driver *OGRDriver) Copy(source DataSource, name string, options []string) (newDS *DataSource, ok bool)

Create a new datasource with this driver by copying all layers of the existing datasource

func (*OGRDriver) Create

func (driver *OGRDriver) Create(name string, options []string) (newDS *DataSource, ok bool)

Create a new data source based on this driver

func (*OGRDriver) Delete

func (driver *OGRDriver) Delete(filename string) error

Delete a data source

func (*OGRDriver) Deregister

func (driver *OGRDriver) Deregister()

Remove a driver from the list of registered drivers

func (*OGRDriver) Name

func (driver *OGRDriver) Name() string

Fetch name of driver (file format)

func (*OGRDriver) Open

func (driver *OGRDriver) Open(filename string, update int) (newDS *DataSource, ok bool)

Attempt to open file with this driver

func (*OGRDriver) Register

func (driver *OGRDriver) Register()

Add a driver to the list of registered drivers

func (*OGRDriver) TestCapability

func (driver *OGRDriver) TestCapability(capability string) bool

Test if this driver supports the named capability

type PaletteInterp

type PaletteInterp int

Types of color interpretations for a GDALColorTable.

func (PaletteInterp) Name

func (paletteInterp PaletteInterp) Name() string

type ProgressFunc

type ProgressFunc func(complete float64, message string, progressArg interface{}) int

type RATFieldType

type RATFieldType int

type RATFieldUsage

type RATFieldUsage int

type RWFlag

type RWFlag int

Read/Write flag for RasterIO() method

type RasterAttributeTable

type RasterAttributeTable struct {
	// contains filtered or unexported fields
}

func CreateRasterAttributeTable

func CreateRasterAttributeTable() *RasterAttributeTable

Construct empty raster attribute table

func (*RasterAttributeTable) ColOfUsage

func (rat *RasterAttributeTable) ColOfUsage(rfu RATFieldUsage) int

Fetch column index for indicated usage

func (*RasterAttributeTable) ColumnCount

func (rat *RasterAttributeTable) ColumnCount() int

Fetch table column count

func (*RasterAttributeTable) CreateColumn

func (rat *RasterAttributeTable) CreateColumn(name string, rft RATFieldType, rfu RATFieldUsage) error

Create new column

func (*RasterAttributeTable) Destroy

func (rat *RasterAttributeTable) Destroy()

Destroy a RAT

func (*RasterAttributeTable) FromColorTable

func (rat *RasterAttributeTable) FromColorTable(ct ColorTable) error

Initialize RAT from color table

func (*RasterAttributeTable) LinearBinning

func (rat *RasterAttributeTable) LinearBinning() (row0min, binsize float64, exists bool)

Fetch linear binning information

func (*RasterAttributeTable) NameOfCol

func (rat *RasterAttributeTable) NameOfCol(index int) string

Fetch the name of indicated column

func (*RasterAttributeTable) RowCount

func (rat *RasterAttributeTable) RowCount() int

Fetch row count

func (*RasterAttributeTable) RowOfValue

func (rat *RasterAttributeTable) RowOfValue(val float64) (int, bool)

Get row for pixel value

func (*RasterAttributeTable) SetLinearBinning

func (rat *RasterAttributeTable) SetLinearBinning(row0min, binsize float64) error

Set linear binning information

func (*RasterAttributeTable) SetRowCount

func (rat *RasterAttributeTable) SetRowCount(count int)

Set row count

func (*RasterAttributeTable) SetValueAsFloat64

func (rat *RasterAttributeTable) SetValueAsFloat64(row, field int, val float64)

Set field value from float64

func (*RasterAttributeTable) SetValueAsInt

func (rat *RasterAttributeTable) SetValueAsInt(row, field, val int)

Set field value from integer

func (*RasterAttributeTable) SetValueAsString

func (rat *RasterAttributeTable) SetValueAsString(row, field int, val string)

Set field value from string

func (*RasterAttributeTable) ToColorTable

func (rat *RasterAttributeTable) ToColorTable(count int) ColorTable

Translate RAT to a color table

func (*RasterAttributeTable) TypeOfCol

func (rat *RasterAttributeTable) TypeOfCol(index int) RATFieldType

Fetch the type of indicated column

func (*RasterAttributeTable) UsageOfCol

func (rat *RasterAttributeTable) UsageOfCol(index int) RATFieldUsage

Fetch the usage of indicated column

func (*RasterAttributeTable) ValueAsFloat64

func (rat *RasterAttributeTable) ValueAsFloat64(row, field int) float64

Fetch field value as float64

func (*RasterAttributeTable) ValueAsInt

func (rat *RasterAttributeTable) ValueAsInt(row, field int) int

Fetch field value as integer

func (*RasterAttributeTable) ValueAsString

func (rat *RasterAttributeTable) ValueAsString(row, field int) string

Fetch field value as string

type RasterBand

type RasterBand struct {
	// contains filtered or unexported fields
}

func (*RasterBand) AdviseRead

func (band *RasterBand) AdviseRead(
	xOff, yOff, xSize, ySize, bufXSize, bufYSize int,
	dataType DataType,
	options []string,
) error

Advise driver of upcoming read requests

func (*RasterBand) Band

func (band *RasterBand) Band() int

Fetch the band number of this raster band

func (*RasterBand) BlockSize

func (band *RasterBand) BlockSize() (int, int)

Fetch the "natural" block size of this band

func (*RasterBand) CategoryNames

func (band *RasterBand) CategoryNames() []string

Fetch the list of category names for this raster

func (*RasterBand) Checksum

func (rb *RasterBand) Checksum(xOff, yOff, xSize, ySize int) int

Compute checksum for image region

func (*RasterBand) ColorInterp

func (band *RasterBand) ColorInterp() ColorInterp

How should this band be interpreted as color?

func (*RasterBand) ColorTable

func (band *RasterBand) ColorTable() *ColorTable

Fetch the color table associated with this raster band

func (*RasterBand) ComputeMinMax

func (band *RasterBand) ComputeMinMax(approxOK int) (min, max float64)

Compute the min / max values for a band

func (*RasterBand) ComputeProximity

func (src *RasterBand) ComputeProximity(
	dest *RasterBand,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Compute the proximity of all pixels in the image to a set of pixels in the source image

func (*RasterBand) ComputeStatistics

func (band *RasterBand) ComputeStatistics(
	approxOK int,
	progress ProgressFunc,
	data interface{},
) (min, max, mean, stdDev float64)

Compute image statistics

func (*RasterBand) CreateMaskBand

func (band *RasterBand) CreateMaskBand(flags int) error

Adds a mask band to the current band

func (*RasterBand) DefaultHistogram

func (rb *RasterBand) DefaultHistogram(
	force int,
	progress ProgressFunc,
	data interface{},
) (min, max float64, buckets int, histogram []uint64, err error)

Fetch default raster histogram

func (*RasterBand) FPolygonize

func (src *RasterBand) FPolygonize(
	mask *RasterBand,
	layer *Layer,
	fieldIndex int,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Create polygon coverage from raster data using a floating point buffer

func (*RasterBand) Fill

func (band *RasterBand) Fill(real, imaginary float64) error

Fill this band with a constant value

func (*RasterBand) FillNoData

func (src *RasterBand) FillNoData(
	mask *RasterBand,
	distance float64,
	iterations int,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Fill selected raster regions by interpolation from the edges

func (*RasterBand) FlushCache

func (band *RasterBand) FlushCache()

Flush raster data cache

func (*RasterBand) GetAccess

func (band *RasterBand) GetAccess() Access

Find out if we have update permission for this band

func (*RasterBand) GetDataset

func (band *RasterBand) GetDataset() *Dataset

Fetch the owning dataset handle

func (*RasterBand) GetDefaultRAT

func (band *RasterBand) GetDefaultRAT() RasterAttributeTable

Fetch default Raster Attribute Table

func (*RasterBand) GetMaskBand

func (band *RasterBand) GetMaskBand() *RasterBand

Return the mask band associated with the band

func (*RasterBand) GetMaskFlags

func (band *RasterBand) GetMaskFlags() int

Return the status flags of the mask band associated with the band

func (*RasterBand) GetMaximum

func (band *RasterBand) GetMaximum() (val float64, valid bool)

Fetch the maximum value for this band

func (*RasterBand) GetMinimum

func (band *RasterBand) GetMinimum() (val float64, valid bool)

Fetch the minimum value for this band

func (*RasterBand) GetOffset

func (band *RasterBand) GetOffset() (float64, bool)

Fetch the raster value offset

func (*RasterBand) GetScale

func (band *RasterBand) GetScale() (float64, bool)

Fetch the raster value scale

func (*RasterBand) GetStatistics

func (band *RasterBand) GetStatistics(approxOK, force int) (min, max, mean, stdDev float64)

Fetch image statistics

func (*RasterBand) GetUnitType

func (band *RasterBand) GetUnitType() string

Return raster unit type

func (*RasterBand) HasArbitraryOverviews

func (band *RasterBand) HasArbitraryOverviews() int

Check for arbitrary overviews

func (*RasterBand) Histogram

func (rb *RasterBand) Histogram(
	min, max float64,
	buckets int,
	includeOutOfRange, approxOK int,
	progress ProgressFunc,
	data interface{},
) ([]uint64, error)

Compute raster histogram

func (*RasterBand) IO

func (band *RasterBand) IO(
	rwFlag RWFlag,
	xOff, yOff, xSize, ySize int,
	buffer interface{},
	bufXSize, bufYSize int,
	pixelSpace, lineSpace int,
) error

Read / Write a region of image data for this band

func (*RasterBand) Metadata

func (band *RasterBand) Metadata(domain string) []string

func (*RasterBand) MetadataItem

func (band *RasterBand) MetadataItem(name, domain string) string

func (*RasterBand) NoDataValue

func (band *RasterBand) NoDataValue() (val float64, valid bool)

Fetch the no data value for this band

func (*RasterBand) Overview

func (band *RasterBand) Overview(level int) *RasterBand

Fetch overview raster band object

func (*RasterBand) OverviewCount

func (band *RasterBand) OverviewCount() int

Return the number of overview layers available

func (*RasterBand) Polygonize

func (src *RasterBand) Polygonize(
	mask *RasterBand,
	layer *Layer,
	fieldIndex int,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Create polygon coverage from raster data using an integer buffer

func (*RasterBand) RasterBandCopyWholeRaster

func (sourceRaster *RasterBand) RasterBandCopyWholeRaster(
	destRaster *RasterBand,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Copy all raster band raster data

func (*RasterBand) RasterDataType

func (band *RasterBand) RasterDataType() DataType

Fetch the pixel data type for this band

func (*RasterBand) ReadBlock

func (band *RasterBand) ReadBlock(xOff, yOff int, dataPtr unsafe.Pointer) error

Read a block of image data efficiently

func (*RasterBand) SetColorInterp

func (band *RasterBand) SetColorInterp(colorInterp ColorInterp) error

Set color interpretation of the raster band

func (*RasterBand) SetColorTable

func (band *RasterBand) SetColorTable(colorTable ColorTable) error

Set the raster color table for this raster band

func (*RasterBand) SetDefaultRAT

func (band *RasterBand) SetDefaultRAT(rat RasterAttributeTable) error

Set default Raster Attribute Table

func (*RasterBand) SetMetadataItem

func (object *RasterBand) SetMetadataItem(name, value, domain string) error

func (*RasterBand) SetNoDataValue

func (band *RasterBand) SetNoDataValue(val float64) error

Set the no data value for this band

func (*RasterBand) SetOffset

func (band *RasterBand) SetOffset(offset float64) error

Set scaling offset

func (*RasterBand) SetRasterCategoryNames

func (band *RasterBand) SetRasterCategoryNames(names []string) error

Set the category names for this band

func (*RasterBand) SetScale

func (band *RasterBand) SetScale(scale float64) error

Set scaling ratio

func (*RasterBand) SetStatistics

func (band *RasterBand) SetStatistics(min, max, mean, stdDev float64) error

Set statistics on raster band

func (*RasterBand) SetUnitType

func (band *RasterBand) SetUnitType(unit string) error

Set unit type

func (*RasterBand) SieveFilter

func (src *RasterBand) SieveFilter(
	mask, dest *RasterBand,
	threshold, connectedness int,
	options []string,
	progress ProgressFunc,
	data interface{},
) error

Removes small raster polygons

func (*RasterBand) WriteBlock

func (band *RasterBand) WriteBlock(xOff, yOff int, dataPtr unsafe.Pointer) error

Write a block of image data efficiently

func (*RasterBand) XSize

func (band *RasterBand) XSize() int

Fetch X size of raster

func (*RasterBand) YSize

func (band *RasterBand) YSize() int

Fetch Y size of raster

type ResampleAlg

type ResampleAlg int

type SpatialReference

type SpatialReference struct {
	// contains filtered or unexported fields
}

func CreateSpatialReference

func CreateSpatialReference(wkt string) *SpatialReference

Create a new SpatialReference

func (*SpatialReference) AngularUnits

func (sr *SpatialReference) AngularUnits() (string, float64)

Fetch the angular units for the geographic coordinate system

func (*SpatialReference) AttrValue

func (sr *SpatialReference) AttrValue(key string, child int) (value string, ok bool)

Fetch indicated attribute of named node

func (*SpatialReference) AuthorityCode

func (sr *SpatialReference) AuthorityCode(target string) string

Get the authority code for a node

func (*SpatialReference) AuthorityName

func (sr *SpatialReference) AuthorityName(target string) string

Get the authority name for a node

func (*SpatialReference) AutoIdentifyEPSG

func (sr *SpatialReference) AutoIdentifyEPSG() error

Set EPSG authority info if possible

func (*SpatialReference) Clone

func (sr *SpatialReference) Clone() *SpatialReference

Make a duplicate of this spatial reference

func (*SpatialReference) CloneGeogCS

func (sr *SpatialReference) CloneGeogCS() *SpatialReference

Make a duplicate of the GEOGCS node of this spatial reference

func (*SpatialReference) CopyGeographicCSFrom

func (sr *SpatialReference) CopyGeographicCSFrom(other *SpatialReference) error

Copy geographic CS from another spatial reference

func (*SpatialReference) Dereference

func (sr *SpatialReference) Dereference() int

Decrements the reference count by one, returning reference count

func (*SpatialReference) Destroy

func (sr *SpatialReference) Destroy()

Destroy the spatial reference

func (*SpatialReference) EPSGTreatsAsLatLong

func (sr *SpatialReference) EPSGTreatsAsLatLong() bool

Return true if EPSG feels this coordinate system should be treated as having lat/long coordinate ordering

func (*SpatialReference) Fixup

func (sr *SpatialReference) Fixup() error

Fix up spatial reference as needed

func (*SpatialReference) FixupOrdering

func (sr *SpatialReference) FixupOrdering() error

Correct parameter ordering to match CT specification

func (*SpatialReference) FromEPSG

func (sr *SpatialReference) FromEPSG(code int) error

Initialize SRS based on EPSG code

func (*SpatialReference) FromEPSGA

func (sr *SpatialReference) FromEPSGA(code int) error

Initialize SRS based on EPSG code, using EPSG lat/long ordering

func (*SpatialReference) FromERM

func (sr *SpatialReference) FromERM(proj, datum, units string) error

Import coordinate system from ERMapper projection definitions

func (*SpatialReference) FromESRI

func (sr *SpatialReference) FromESRI(input string) error

Import coordinate system from ESRI .prj formats

func (*SpatialReference) FromPCI

func (sr *SpatialReference) FromPCI(proj, units string, params []float64) error

Import coordinate system from PCI projection definition

func (*SpatialReference) FromProj4

func (sr *SpatialReference) FromProj4(input string) error

Import PROJ.4 coordinate string

func (*SpatialReference) FromURL

func (sr *SpatialReference) FromURL(url string) error

Import coordinate system from a URL

func (*SpatialReference) FromUSGS

func (sr *SpatialReference) FromUSGS(projsys, zone int, params []float64, datum int) error

Import coordinate system from USGS projection definition

func (*SpatialReference) FromWKT

func (sr *SpatialReference) FromWKT(wkt string) error

Initialize SRS based on WKT string

func (*SpatialReference) FromXML

func (sr *SpatialReference) FromXML(xml string) error

Import coordinate system from XML format (GML only currently)

func (*SpatialReference) InverseFlattening

func (sr *SpatialReference) InverseFlattening() (float64, error)

Get spheroid inverse flattening axis

func (*SpatialReference) IsCompound

func (sr *SpatialReference) IsCompound() bool

Return true if compound coordinate system

func (*SpatialReference) IsGeocentric

func (sr *SpatialReference) IsGeocentric() bool

Return true if geocentric coordinate system

func (SpatialReference) IsGeographic

func (sr SpatialReference) IsGeographic() bool

Return true if geographic coordinate system

func (*SpatialReference) IsLocal

func (sr *SpatialReference) IsLocal() bool

Return true if local coordinate system

func (*SpatialReference) IsProjected

func (sr *SpatialReference) IsProjected() bool

Return true if projected coordinate system

func (*SpatialReference) IsSame

func (sr *SpatialReference) IsSame(other *SpatialReference) bool

Return true if the coordinate systems describe the same system

func (*SpatialReference) IsSameGeographicCS

func (sr *SpatialReference) IsSameGeographicCS(other *SpatialReference) bool

Return true if the geographic coordinate systems match

func (*SpatialReference) IsSameVerticalCS

func (sr *SpatialReference) IsSameVerticalCS(other *SpatialReference) bool

Return true if the vertical coordinate systems match

func (*SpatialReference) IsVertical

func (sr *SpatialReference) IsVertical() bool

Return true if vertical coordinate system

func (*SpatialReference) LinearUnits

func (sr *SpatialReference) LinearUnits() (string, float64)

Fetch linear projection units

func (*SpatialReference) MorphFromESRI

func (sr *SpatialReference) MorphFromESRI() error

Convert in place from ESRI WKT format

func (*SpatialReference) MorphToESRI

func (sr *SpatialReference) MorphToESRI() error

Convert in place to ESRI WKT format

func (*SpatialReference) NormalizedProjectionParameter

func (sr *SpatialReference) NormalizedProjectionParameter(
	name string, defaultValue float64,
) (float64, error)

Fetch a normalized projection parameter value

func (*SpatialReference) PrimeMeridian

func (sr *SpatialReference) PrimeMeridian() (string, float64)

Fetch prime meridian information

func (*SpatialReference) ProjectionParameter

func (sr *SpatialReference) ProjectionParameter(name string, defaultValue float64) (float64, error)

Fetch a projection parameter value

func (*SpatialReference) Reference

func (sr *SpatialReference) Reference() int

Increments the reference count by one, returning reference count

func (*SpatialReference) Release

func (sr *SpatialReference) Release()

Decrements the reference count by one and destroy if zero

func (*SpatialReference) SemiMajorAxis

func (sr *SpatialReference) SemiMajorAxis() (float64, error)

Get spheroid semi-major axis

func (*SpatialReference) SemiMinorAxis

func (sr *SpatialReference) SemiMinorAxis() (float64, error)

Get spheroid semi-minor axis

func (*SpatialReference) SetACEA

func (sr *SpatialReference) SetACEA(
	stdp1, stdp2, centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Albers Conic Equal Area

func (*SpatialReference) SetAE

func (sr *SpatialReference) SetAE(centerLat, centerLong, falseEasting, falseNorthing float64) error

Set to Azimuthal Equidistant

func (*SpatialReference) SetAngularUnits

func (sr *SpatialReference) SetAngularUnits(units string, radians float64) error

Set the angular units for the geographic coordinate system

func (*SpatialReference) SetAttrValue

func (sr *SpatialReference) SetAttrValue(path, value string) error

Set attribute value in spatial reference

func (*SpatialReference) SetAuthority

func (sr *SpatialReference) SetAuthority(target, authority string, code int) error

Sets the authority for a node

func (*SpatialReference) SetBonne

func (sr *SpatialReference) SetBonne(standardParallel, centralMeridian, falseEasting, falseNorthing float64) error

Set to Bonne

func (*SpatialReference) SetCEA

func (sr *SpatialReference) SetCEA(stdp1, centralMeridian, falseEasting, falseNorthing float64) error

Set to Cylindrical Equal Area

func (*SpatialReference) SetCS

func (sr *SpatialReference) SetCS(centerLat, centerLong, falseEasting, falseNorthing float64) error

Set to Cassini-Soldner

func (*SpatialReference) SetCompoundCS

func (sr *SpatialReference) SetCompoundCS(
	name string,
	horizontal, vertical *SpatialReference,
) error

Setup a compound coordinate system

func (*SpatialReference) SetEC

func (sr *SpatialReference) SetEC(
	stdp1, stdp2, centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Equidistant Conic

func (*SpatialReference) SetEckert

func (sr *SpatialReference) SetEckert(variation int, centralMeridian, falseEasting, falseNorthing float64) error

Set to Eckert I-VI

func (*SpatialReference) SetEquirectangular

func (sr *SpatialReference) SetEquirectangular(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Equirectangular

func (*SpatialReference) SetEquirectangularGeneralized

func (sr *SpatialReference) SetEquirectangularGeneralized(
	centerLat, centerLong, psuedoStdParallel, falseEasting, falseNorthing float64,
) error

Set to Equirectangular (generalized form)

func (*SpatialReference) SetFromUserInput

func (sr *SpatialReference) SetFromUserInput(name string) error

Set spatial reference from various text formats

func (*SpatialReference) SetGEOS

func (sr *SpatialReference) SetGEOS(
	centralMeridian, satelliteHeight, falseEasting, falseNorthing float64,
) error

Set to GEOS - Geostationary Satellite View

func (*SpatialReference) SetGH

func (sr *SpatialReference) SetGH(centralMeridian, falseEasting, falseNorthing float64) error

Set to Goode Homolosine

func (*SpatialReference) SetGS

func (sr *SpatialReference) SetGS(centralMeridian, falseEasting, falseNorthing float64) error

Set to Gall Stereographic

func (*SpatialReference) SetGSTM

func (sr *SpatialReference) SetGSTM(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Gauss Schreiber Transverse Mercator

func (*SpatialReference) SetGeocentricCS

func (sr *SpatialReference) SetGeocentricCS(name string) error

Set the user visible geographic CS name

func (*SpatialReference) SetGeographicCS

func (sr *SpatialReference) SetGeographicCS(
	geogName, datumName, spheroidName string,
	semiMajor, flattening float64,
	pmName string,
	offset float64,
	angularUnits string,
	toRadians float64,
) error

Set geographic coordinate system

func (*SpatialReference) SetGnomonic

func (sr *SpatialReference) SetGnomonic(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to gnomonic

func (*SpatialReference) SetHOM

func (sr *SpatialReference) SetHOM(
	centerLat, centerLong, azimuth, rectToSkew, scale, falseEasting, falseNorthing float64,
) error

Set to Hotine Oblique Mercator projection using azimuth angle

func (*SpatialReference) SetHOM2PNO

func (sr *SpatialReference) SetHOM2PNO(
	centerLat, lat1, long1, lat2, long2, scale, falseEasting, falseNorthing float64,
) error

Set to Hotine Oblique Mercator projection using two points on projection centerline

func (*SpatialReference) SetIGH

func (sr *SpatialReference) SetIGH() error

Set to Interrupted Goode Homolosine

func (*SpatialReference) SetIWMPolyconic

func (sr *SpatialReference) SetIWMPolyconic(
	lat1, lat2, centerLong, falseEasting, falseNorthing float64,
) error

Set to International Map of the World Polyconic

func (*SpatialReference) SetKrovak

func (sr *SpatialReference) SetKrovak(
	centerLat, centerLong, azimuth, psuedoStdParallel, scale, falseEasting, falseNorthing float64,
) error

Set to Krovak Oblique Conic Conformal

func (*SpatialReference) SetLAEA

func (sr *SpatialReference) SetLAEA(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Lambert Azimuthal Equal Area

func (*SpatialReference) SetLCC

func (sr *SpatialReference) SetLCC(
	stdp1, stdp2, centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Lambert Conformal Conic

func (*SpatialReference) SetLCC1SP

func (sr *SpatialReference) SetLCC1SP(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Lambert Conformal Conic (1 standard parallel)

func (*SpatialReference) SetLCCB

func (sr *SpatialReference) SetLCCB(
	stdp1, stdp2, centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Lambert Conformal Conic (Belgium)

func (*SpatialReference) SetLinearUnits

func (sr *SpatialReference) SetLinearUnits(name string, toMeters float64) error

Set the linear units for the projection

func (*SpatialReference) SetLinearUnitsAndUpdateParameters

func (sr *SpatialReference) SetLinearUnitsAndUpdateParameters(name string, toMeters float64) error

Set the linear units for the target node and update all existing linear parameters

func (*SpatialReference) SetLocalCS

func (sr *SpatialReference) SetLocalCS(name string) error

Set the user visible local CS name

func (*SpatialReference) SetMC

func (sr *SpatialReference) SetMC(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Miller Cylindrical

func (*SpatialReference) SetMercator

func (sr *SpatialReference) SetMercator(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Mercator

func (*SpatialReference) SetMollweide

func (sr *SpatialReference) SetMollweide(
	centralMeridian, falseEasting, falseNorthing float64,
) error

Set tp Mollweide

func (*SpatialReference) SetNZMG

func (sr *SpatialReference) SetNZMG(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to New Zealand Map Grid

func (*SpatialReference) SetNormalizedProjectionParameter

func (sr *SpatialReference) SetNormalizedProjectionParameter(name string, value float64) error

Set a projection parameter with a normalized value

func (*SpatialReference) SetOS

func (sr *SpatialReference) SetOS(
	originLat, meridian, scale, falseEasting, falseNorthing float64,
) error

Set to Oblique Stereographic

func (*SpatialReference) SetOrthographic

func (sr *SpatialReference) SetOrthographic(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Orthographic

func (*SpatialReference) SetPS

func (sr *SpatialReference) SetPS(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Polar Stereographic

func (*SpatialReference) SetPolyconic

func (sr *SpatialReference) SetPolyconic(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Polyconic

func (*SpatialReference) SetProjectedCS

func (sr *SpatialReference) SetProjectedCS(name string) error

Set the user visible projected CS name

func (*SpatialReference) SetProjectionByName

func (sr *SpatialReference) SetProjectionByName(name string) error

Set a projection by name

func (*SpatialReference) SetProjectionParameter

func (sr *SpatialReference) SetProjectionParameter(name string, value float64) error

Set a projection parameter value

func (*SpatialReference) SetRobinson

func (sr *SpatialReference) SetRobinson(
	centerLong, falseEasting, falseNorthing float64,
) error

Set to Robinson

func (*SpatialReference) SetSOC

func (sr *SpatialReference) SetSOC(
	latitudeOfOrigin, centralMeridian, falseEasting, falseNorthing float64,
) error

Set to Swiss Oblique Cylindrical

func (*SpatialReference) SetSinusoidal

func (sr *SpatialReference) SetSinusoidal(
	centerLong, falseEasting, falseNorthing float64,
) error

Set to Sinusoidal

func (*SpatialReference) SetStatePlane

func (sr *SpatialReference) SetStatePlane(zone int, nad83 bool) error

Set State Plane projection definition

func (*SpatialReference) SetStatePlaneWithUnits

func (sr *SpatialReference) SetStatePlaneWithUnits(
	zone int,
	nad83 bool,
	unitName string,
	factor float64,
) error

Set State Plane projection definition

func (*SpatialReference) SetStereographic

func (sr *SpatialReference) SetStereographic(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Stereographic

func (*SpatialReference) SetTM

func (sr *SpatialReference) SetTM(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Transverse Mercator

func (*SpatialReference) SetTMG

func (sr *SpatialReference) SetTMG(
	centerLat, centerLong, falseEasting, falseNorthing float64,
) error

Set to Tunisia Mining Grid

func (*SpatialReference) SetTMSO

func (sr *SpatialReference) SetTMSO(
	centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Transverse Mercator (South Oriented)

func (*SpatialReference) SetTMVariant

func (sr *SpatialReference) SetTMVariant(
	variantName string, centerLat, centerLong, scale, falseEasting, falseNorthing float64,
) error

Set to Transverse Mercator variant

func (*SpatialReference) SetTOWGS84

func (sr *SpatialReference) SetTOWGS84(dx, dy, dz, ex, ey, ez, ppm float64) error

Set the Bursa-Wolf conversion to WGS84

func (*SpatialReference) SetTargetLinearUnits

func (sr *SpatialReference) SetTargetLinearUnits(target, units string, toMeters float64) error

Set the linear units for the target node

func (*SpatialReference) SetUTM

func (sr *SpatialReference) SetUTM(zone int, north bool) error

Set UTM projection definition

func (*SpatialReference) SetVDG

func (sr *SpatialReference) SetVDG(
	centerLong, falseEasting, falseNorthing float64,
) error

Set to VanDerGrinten

func (*SpatialReference) SetVerticalCS

func (sr *SpatialReference) SetVerticalCS(csName, datumName string, datumType int) error

Set up the vertical coordinate system

func (*SpatialReference) SetWellKnownGeographicCS

func (sr *SpatialReference) SetWellKnownGeographicCS(name string) error

Set geographic CS based on well known name

func (*SpatialReference) StripCTParams

func (sr *SpatialReference) StripCTParams() error

Strip OGC CT parameters

func (*SpatialReference) TOWGS84

func (sr *SpatialReference) TOWGS84() (coeff [7]float64, err error)

Fetch the TOWGS84 parameters if available

func (*SpatialReference) TargetLinearUnits

func (sr *SpatialReference) TargetLinearUnits(target string) (string, float64)

Fetch linear units for target

func (*SpatialReference) ToMICoordSys

func (sr *SpatialReference) ToMICoordSys() (output string, errVal error)

Export coordinate system in Mapinfo style CoordSys format

func (*SpatialReference) ToPCI

func (sr *SpatialReference) ToPCI() (proj, units string, params []float64, errVal error)

Export coordinate system in PCI format

func (*SpatialReference) ToPrettyWKT

func (sr *SpatialReference) ToPrettyWKT(simplify bool) (string, error)

Export coordinate system to a nicely formatted WKT string

func (*SpatialReference) ToProj4

func (sr *SpatialReference) ToProj4() (string, error)

Export coordinate system in PROJ.4 format

func (*SpatialReference) ToUSGS

func (sr *SpatialReference) ToUSGS() (proj, zone int, params []float64, datum int, errVal error)

Export coordinate system to USGS GCTP projection definition

func (*SpatialReference) ToWKT

func (sr *SpatialReference) ToWKT() (string, error)

Export coordinate system to WKT

func (*SpatialReference) ToXML

func (sr *SpatialReference) ToXML() (xml string, errVal error)

Export coordinate system in XML format

func (*SpatialReference) UTMZone

func (sr *SpatialReference) UTMZone() (zone int, north bool)

Get UTM zone information

func (*SpatialReference) Validate

func (sr *SpatialReference) Validate() error

Validate spatial reference tokens

type StyleMgr

type StyleMgr struct {
	// contains filtered or unexported fields
}

type StyleTable

type StyleTable struct {
	// contains filtered or unexported fields
}

type StyleTool

type StyleTool struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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