command

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColName          = "Column"
	ColType          = "Type"
	ColAnnotation    = "Annotation"
	ColRepetition    = "Repetition"
	ColCompression   = "Compression"
	ColEncoding      = "Encoding"
	ColGeometryTypes = "Geometry Types"
	ColBounds        = "Bounds"
	ColDetail        = "Detail"
)

Variables

View Source
var CLI struct {
	Convert  ConvertCmd  `cmd:"" help:"Convert data from one format to another."`
	Validate ValidateCmd `cmd:"" help:"Validate a GeoParquet file."`
	Describe DescribeCmd `cmd:"" help:"Describe a GeoParquet file."`
	Version  VersionCmd  `cmd:"" help:"Print the version of this program."`
}

Functions

This section is empty.

Types

type CommandError

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

func NewCommandError

func NewCommandError(format string, a ...any) *CommandError

func (*CommandError) Error

func (e *CommandError) Error() string

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

type ConvertCmd

type ConvertCmd struct {
	Input              string `arg:"" optional:"" name:"input" help:"Input file path or URL.  If not provided, input is read from stdin."`
	From               string `help:"Input file format.  Possible values: ${enum}." enum:"auto, geojson, geoparquet, parquet" default:"auto"`
	Output             string `arg:"" optional:"" name:"output" help:"Output file.  If not provided, output is written to stdout." type:"path"`
	To                 string `help:"Output file format.  Possible values: ${enum}." enum:"auto, geojson, geoparquet" default:"auto"`
	Min                int    `help:"Minimum number of features to consider when building a schema." default:"10"`
	Max                int    `help:"Maximum number of features to consider when building a schema." default:"100"`
	InputPrimaryColumn string `help:"Primary geometry column name when reading Parquet withtout metadata." default:"geometry"`
	Compression        string `help:"Parquet compression to use.  Possible values: ${enum}." enum:"uncompressed, snappy, gzip, brotli, zstd" default:"zstd"`
	RowGroupLength     int    `help:"Maximum number of rows per group when writing Parquet."`
}

func (*ConvertCmd) Run

func (c *ConvertCmd) Run() error

type DescribeCmd

type DescribeCmd struct {
	Input        string `arg:"" optional:"" name:"input" help:"Path or URL for a GeoParquet file.  If not provided, input is read from stdin."`
	Format       string `help:"Report format.  Possible values: ${enum}." enum:"text, json" default:"text"`
	MetadataOnly bool   `help:"Print the unformatted geo metadata only (other arguments will be ignored)."`
	Unpretty     bool   `help:"No newlines or indentation in the JSON output."`
}

func (*DescribeCmd) Run

func (c *DescribeCmd) Run() error

type DescribeInfo

type DescribeInfo struct {
	Schema       *DescribeSchema      `json:"schema"`
	Metadata     *geoparquet.Metadata `json:"metadata"`
	NumRows      int64                `json:"rows"`
	NumRowGroups int64                `json:"groups"`
	Issues       []string             `json:"issues"`
}

type DescribeSchema

type DescribeSchema struct {
	Name        string            `json:"name,omitempty"`
	Optional    bool              `json:"optional,omitempty"`
	Repeated    bool              `json:"repeated,omitempty"`
	Type        string            `json:"type,omitempty"`
	Annotation  string            `json:"annotation,omitempty"`
	Compression string            `json:"compression,omitempty"`
	Fields      []*DescribeSchema `json:"fields,omitempty"`
}

type FormatType

type FormatType string
const (
	AutoType       FormatType = "auto"
	GeoParquetType FormatType = "geoparquet"
	ParquetType    FormatType = "parquet"
	GeoJSONType    FormatType = "geojson"
	UnknownType    FormatType = "unknown"
)

type ValidateCmd

type ValidateCmd struct {
	Input        string `arg:"" optional:"" name:"input" help:"Path or URL for a GeoParquet file.  If not provided, input is read from stdin."`
	MetadataOnly bool   `help:"Only run rules that apply to file metadata and schema (no data will be scanned)."`
	Unpretty     bool   `help:"No colors in text output, no newlines and indentation in JSON output."`
	Format       string `help:"Report format.  Possible values: ${enum}." enum:"text, json" default:"text"`
}

func (*ValidateCmd) Run

func (c *ValidateCmd) Run(ctx *kong.Context) error

type VersionCmd

type VersionCmd struct {
	Detail bool `help:"Include detail about the commit and build date."`
}

func (*VersionCmd) Run

func (c *VersionCmd) Run(info *VersionInfo) error

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

Jump to

Keyboard shortcuts

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