shapefile

package module
v0.0.0-...-ae93dba Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

go-shapefile has moved to github.com/everystreet/go-shapefile

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes interface {
	Fields() []dbf.Field
	Field(string) (dbf.Field, bool)
	Deleted() bool
}

Attributes provides access to the dbf record.

type FieldDesc

type FieldDesc interface {
	Name() string
}

type FieldDescList

type FieldDescList []FieldDesc

func (FieldDescList) Exists

func (l FieldDescList) Exists(name string) bool

type GeoJSONOption

type GeoJSONOption func(*geoJSONConfig)

GeoJSONOption funcs can be passed to Record.GeoJSONFeature().

func RenameProperties

func RenameProperties(oldNews map[string]string) GeoJSONOption

RenameProperties allows shapefile field names to be mapped to user-defined GeoJSON property names.

type Info

type Info struct {
	BoundingBox shp.BoundingBox
	NumRecords  uint32
	ShapeType   shp.ShapeType
	Fields      FieldDescList
}

type Option

type Option func(*options)

Option funcs can be passed to NewScanner().

func CharacterEncoding

func CharacterEncoding(enc cpg.CharacterEncoding) Option

CharacterEncoding sets dbf.CharacterEncoding.

func FilterFields

func FilterFields(names ...string) Option

FilterFields sets dbf.FilterFields.

func PointPrecision

func PointPrecision(p uint) Option

PointPrecision sets shp.PointPrecision.

type Record

type Record struct {
	Shape      shp.Shape
	Attributes Attributes
}

Record consists of a shape (read from the .shp file) and attributes (from the .dbf file).

func (*Record) GeoJSONFeature

func (r *Record) GeoJSONFeature(opts ...GeoJSONOption) *geojson.Feature

GeoJSONFeature creates a GeoJSON Feature for the Shapefile Record.

type Scannable

type Scannable interface {
	AddOptions(...Option)
	Info() (*Info, error)
	Scan() error
	Record() *Record
	Err() error
}

type Scanner

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

func NewScanner

func NewScanner(shpR, dbfR io.Reader, opts ...Option) *Scanner

func (*Scanner) AddOptions

func (s *Scanner) AddOptions(opts ...Option)

func (*Scanner) Err

func (s *Scanner) Err() error

func (*Scanner) Info

func (s *Scanner) Info() (*Info, error)

func (*Scanner) Record

func (s *Scanner) Record() *Record

func (*Scanner) Scan

func (s *Scanner) Scan() error

type TablePrinter

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

func NewTablePrinter

func NewTablePrinter(s Scannable, fields ...string) (*TablePrinter, error)

func (*TablePrinter) PrettyPrint

func (p *TablePrinter) PrettyPrint() error

func (*TablePrinter) Print

func (p *TablePrinter) Print() error

type ZipScanner

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

func NewZipScanner

func NewZipScanner(r io.ReaderAt, size int64, filename string, opts ...Option) (*ZipScanner, error)

func (*ZipScanner) AddOptions

func (s *ZipScanner) AddOptions(opts ...Option)

func (*ZipScanner) Err

func (s *ZipScanner) Err() error

func (*ZipScanner) Info

func (s *ZipScanner) Info() (*Info, error)

func (*ZipScanner) Record

func (s *ZipScanner) Record() *Record

func (*ZipScanner) Scan

func (s *ZipScanner) Scan() error

Directories

Path Synopsis
dbf

Jump to

Keyboard shortcuts

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