pgis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: BSD-3-Clause Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meta

type Meta struct {
	Name      string             `json:"wof:name"`
	Country   string             `json:"wof:country"`
	Repo      string             `json:"wof:repo"`
	Hierarchy []map[string]int64 `json:"wof:hierarchy"`
}

type PgisAsyncWorker

type PgisAsyncWorker struct {
	Client        *PgisClient
	QueryFunc     PgisQueryRowFunc
	CountExpected int
	NumProcesses  int
	PerPage       int
	ResultChannel chan *PgisRow
	DoneChannel   chan bool
	ErrorChannel  chan error
}

func NewPgisAsyncWorker

func NewPgisAsyncWorker(client *PgisClient, expected int, per_page int, num_procs int) (*PgisAsyncWorker, error)

func (*PgisAsyncWorker) Query

func (w *PgisAsyncWorker) Query(sql string, args ...interface{})

type PgisClient

type PgisClient struct {
	Geometry string
	Debug    bool
	Verbose  bool
	Logger   *log.WOFLogger
	// contains filtered or unexported fields
}

func NewPgisClient

func NewPgisClient(host string, port int, user string, password string, dbname string, maxconns int) (*PgisClient, error)

func (*PgisClient) Connection

func (client *PgisClient) Connection() (*sql.DB, error)

func (*PgisClient) GetById

func (client *PgisClient) GetById(id int64) (*PgisRow, error)

func (*PgisClient) IndexFeature

func (client *PgisClient) IndexFeature(feature geojson.Feature, collection string) error

func (*PgisClient) Prune

func (client *PgisClient) Prune(data_root string, delete bool) error

func (*PgisClient) PruneRow

func (client *PgisClient) PruneRow(row *PgisRow, data_root string, delete bool) error

type PgisQueryRowFunc

type PgisQueryRowFunc func(row PgisResultSet) (*PgisRow, error)

type PgisResultSet

type PgisResultSet interface {
	Scan(dest ...interface{}) error
}

type PgisRow

type PgisRow struct {
	Id           int64
	ParentId     int64
	PlacetypeId  int64
	IsSuperseded int
	IsDeprecated int
	Meta         string
	Geom         string
	Centroid     string
}

func NewPgisRow

func NewPgisRow(id int64, pid int64, ptid int64, superseded int, deprecated int, meta string, geom string, centroid string) (*PgisRow, error)

func QueryRowToPgisRow

func QueryRowToPgisRow(row PgisResultSet) (*PgisRow, error)

func QueryRowToPgisRowForPruning

func QueryRowToPgisRowForPruning(row PgisResultSet) (*PgisRow, error)

Jump to

Keyboard shortcuts

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