geoparquet

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version                     = "1.0.0"
	MetadataKey                 = "geo"
	EdgesPlanar                 = "planar"
	EdgesSpherical              = "spherical"
	OrientationCounterClockwise = "counterclockwise"
	DefaultGeometryColumn       = "geometry"
	DefaultGeometryEncoding     = geo.EncodingWKB
)

Variables

View Source
var ErrDuplicateMetadata = fmt.Errorf("found more than one %s metadata key", MetadataKey)
View Source
var ErrNoMetadata = fmt.Errorf("missing %s metadata key", MetadataKey)
View Source
var GeometryTypes = []string{
	"Point",
	"LineString",
	"Polygon",
	"MultiPoint",
	"MultiLineString",
	"MultiPolygon",
	"GeometryCollection",
	"Point Z",
	"LineString Z",
	"Polygon Z",
	"MultiPoint Z",
	"MultiLineString Z",
	"MultiPolygon Z",
	"GeometryCollection Z",
}

Functions

func FromParquet added in v0.11.0

func FromParquet(input parquet.ReaderAtSeeker, output io.Writer, convertOptions *ConvertOptions) error

func GetMetadataValue added in v0.10.0

func GetMetadataValue(keyValueMetadata metadata.KeyValueMetadata) (string, error)

Types

type ConvertOptions added in v0.11.0

type ConvertOptions struct {
	InputPrimaryColumn string
	Compression        string
	RowGroupLength     int
}

type FeatureWriter added in v0.14.0

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

func NewFeatureWriter added in v0.14.0

func NewFeatureWriter(config *WriterConfig) (*FeatureWriter, error)

func (*FeatureWriter) Close added in v0.14.0

func (w *FeatureWriter) Close() error

func (*FeatureWriter) Write added in v0.14.0

func (w *FeatureWriter) Write(feature *geo.Feature) error

type GeometryColumn

type GeometryColumn struct {
	Encoding      string    `json:"encoding"`
	GeometryType  any       `json:"geometry_type,omitempty"`
	GeometryTypes any       `json:"geometry_types"`
	CRS           *Proj     `json:"crs,omitempty"`
	Edges         string    `json:"edges,omitempty"`
	Orientation   string    `json:"orientation,omitempty"`
	Bounds        []float64 `json:"bbox,omitempty"`
	Epoch         float64   `json:"epoch,omitempty"`
}

func (*GeometryColumn) GetGeometryTypes

func (col *GeometryColumn) GetGeometryTypes() []string

type Metadata added in v0.10.0

type Metadata struct {
	Version       string                     `json:"version"`
	PrimaryColumn string                     `json:"primary_column"`
	Columns       map[string]*GeometryColumn `json:"columns"`
}

func DefaultMetadata added in v0.10.0

func DefaultMetadata() *Metadata

func GetMetadata added in v0.10.0

func GetMetadata(keyValueMetadata metadata.KeyValueMetadata) (*Metadata, error)

func (*Metadata) Clone added in v0.12.0

func (m *Metadata) Clone() *Metadata

type Proj added in v0.12.0

type Proj struct {
	Name string  `json:"name"`
	Id   *ProjId `json:"id"`
}

func (*Proj) String added in v0.12.0

func (p *Proj) String() string

type ProjId added in v0.12.0

type ProjId struct {
	Authority string `json:"authority"`
	Code      any    `json:"code"`
}

type ReaderConfig added in v0.14.0

type ReaderConfig struct {
	BatchSize int
	Reader    parquet.ReaderAtSeeker
	File      *file.Reader
	Context   context.Context
}

type RecordReader added in v0.14.0

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

func NewRecordReader added in v0.14.0

func NewRecordReader(config *ReaderConfig) (*RecordReader, error)

func (*RecordReader) Close added in v0.14.0

func (r *RecordReader) Close() error

func (*RecordReader) Metadata added in v0.14.0

func (r *RecordReader) Metadata() *Metadata

func (*RecordReader) Read added in v0.14.0

func (r *RecordReader) Read() (arrow.Record, error)

func (*RecordReader) Schema added in v0.14.0

func (r *RecordReader) Schema() *schema.Schema

type RecordWriter added in v0.14.0

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

func NewRecordWriter added in v0.14.0

func NewRecordWriter(config *WriterConfig) (*RecordWriter, error)

func (*RecordWriter) AppendKeyValueMetadata added in v0.14.0

func (w *RecordWriter) AppendKeyValueMetadata(key string, value string) error

func (*RecordWriter) Close added in v0.14.0

func (w *RecordWriter) Close() error

func (*RecordWriter) Write added in v0.14.0

func (w *RecordWriter) Write(record arrow.Record) error

type WriterConfig added in v0.14.0

type WriterConfig struct {
	Writer             io.Writer
	Metadata           *Metadata
	ParquetWriterProps *parquet.WriterProperties
	ArrowWriterProps   *pqarrow.ArrowWriterProperties
	ArrowSchema        *arrow.Schema
}

Jump to

Keyboard shortcuts

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