spr

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryPaginated

func QueryPaginated(ctx context.Context, conn *sql.DB, pg_opts pagination.Options, q string, args ...interface{}) (spr.StandardPlacesResults, pagination.Results, error)

QueryPaginated will iterate over all the rows for 'q' in batches determined by 'pg_opts' and return a `spr.StandardPlacesResults` and `pagination.Results` instance for the results.

func RetrieveSPR

func RetrieveSPR(ctx context.Context, spr_db *sql.DB, spr_table database_sql.Table, id int64, alt_label string) (wof_spr.StandardPlacesResult, error)

func RetrieveSPRWithRow

func RetrieveSPRWithRow(ctx context.Context, row *sql.Row) (wof_spr.StandardPlacesResult, error)

func RetrieveSPRWithRows

func RetrieveSPRWithRows(ctx context.Context, rows *sql.Rows) (wof_spr.StandardPlacesResult, error)

Types

type Results

type Results struct {
	wof_spr.StandardPlacesResults `json:",omitempty"`
	// Places are the list of `StandardPlacesResults.StandardPlacesResults` instances contained by the struct.
	Places []wof_spr.StandardPlacesResult `json:"places"`
}

Results is a struct that implements the `whosonfirst/go-whosonfirst-spr.StandardPlacesResults` interface for returning a list of `StandardPlacesResults.StandardPlacesResults` instances.

func (*Results) Results

func (r *Results) Results() []wof_spr.StandardPlacesResult

Results returns a list of `StandardPlacesResults.StandardPlacesResults` instances.

type StandardPlacesResult

type StandardPlacesResult struct {
	wof_spr.StandardPlacesResult `json:",omitempty"`
	WOFId                        string  `json:"wof:id"`
	WOFParentId                  string  `json:"wof:parent_id"`
	WOFName                      string  `json:"wof:name"`
	WOFCountry                   string  `json:"wof:country"`
	WOFPlacetype                 string  `json:"wof:placetype"`
	MZLatitude                   float64 `json:"mz:latitude"`
	MZLongitude                  float64 `json:"mz:longitude"`
	MZMinLatitude                float64 `json:"mz:min_latitude"`
	MZMinLongitude               float64 `json:"mz:min_longitude"`
	MZMaxLatitude                float64 `json:"mz:max_latitude"`
	MZMaxLongitude               float64 `json:"mz:max_longitude"`
	MZIsCurrent                  int64   `json:"mz:is_current"`
	MZIsDeprecated               int64   `json:"mz:is_deprecated"`
	MZIsCeased                   int64   `json:"mz:is_ceased"`
	MZIsSuperseded               int64   `json:"mz:is_superseded"`
	MZIsSuperseding              int64   `json:"mz:is_superseding"`
	EDTFInception                string  `json:"edtf:inception"`
	EDTFCessation                string  `json:"edtf:cessation"`
	WOFSupersedes                []int64 `json:"wof:supersedes"`
	WOFSupersededBy              []int64 `json:"wof:superseded_by"`
	WOFBelongsTo                 []int64 `json:"wof:belongsto"`
	WOFPath                      string  `json:"wof:path"`
	WOFRepo                      string  `json:"wof:repo"`
	WOFLastModified              int64   `json:"wof:lastmodified"`
}

StandardPlacesResult is a struct that implements the `whosonfirst/go-whosonfirst-spr.StandardPlacesResult` interface for records stored in a database and which have been indexed by the `whosonfirst/go-whosonfirst-sqlite-features` package.

func (*StandardPlacesResult) BelongsTo

func (spr *StandardPlacesResult) BelongsTo() []int64

func (*StandardPlacesResult) Cessation

func (spr *StandardPlacesResult) Cessation() *edtf.EDTFDate

func (*StandardPlacesResult) Country

func (spr *StandardPlacesResult) Country() string

func (*StandardPlacesResult) Id

func (spr *StandardPlacesResult) Id() string

func (*StandardPlacesResult) Inception

func (spr *StandardPlacesResult) Inception() *edtf.EDTFDate

func (*StandardPlacesResult) IsCeased

func (spr *StandardPlacesResult) IsCeased() flags.ExistentialFlag

func (*StandardPlacesResult) IsCurrent

func (spr *StandardPlacesResult) IsCurrent() flags.ExistentialFlag

func (*StandardPlacesResult) IsDeprecated

func (spr *StandardPlacesResult) IsDeprecated() flags.ExistentialFlag

func (*StandardPlacesResult) IsSuperseded

func (spr *StandardPlacesResult) IsSuperseded() flags.ExistentialFlag

func (*StandardPlacesResult) IsSuperseding

func (spr *StandardPlacesResult) IsSuperseding() flags.ExistentialFlag

func (*StandardPlacesResult) LastModified

func (spr *StandardPlacesResult) LastModified() int64

func (*StandardPlacesResult) Latitude

func (spr *StandardPlacesResult) Latitude() float64

func (*StandardPlacesResult) Longitude

func (spr *StandardPlacesResult) Longitude() float64

func (*StandardPlacesResult) MaxLatitude

func (spr *StandardPlacesResult) MaxLatitude() float64

func (*StandardPlacesResult) MaxLongitude

func (spr *StandardPlacesResult) MaxLongitude() float64

func (*StandardPlacesResult) MinLatitude

func (spr *StandardPlacesResult) MinLatitude() float64

func (*StandardPlacesResult) MinLongitude

func (spr *StandardPlacesResult) MinLongitude() float64

func (*StandardPlacesResult) Name

func (spr *StandardPlacesResult) Name() string

func (*StandardPlacesResult) ParentId

func (spr *StandardPlacesResult) ParentId() string

func (*StandardPlacesResult) Path

func (spr *StandardPlacesResult) Path() string

func (*StandardPlacesResult) Placetype

func (spr *StandardPlacesResult) Placetype() string

func (*StandardPlacesResult) Repo

func (spr *StandardPlacesResult) Repo() string

func (*StandardPlacesResult) SupersededBy

func (spr *StandardPlacesResult) SupersededBy() []int64

func (*StandardPlacesResult) Supersedes

func (spr *StandardPlacesResult) Supersedes() []int64

func (*StandardPlacesResult) URI

func (spr *StandardPlacesResult) URI() string

Jump to

Keyboard shortcuts

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