pgds

package
v0.0.0-...-d078246 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMapView

func LoadMapView(ctx context.Context, db bun.DB, mr *geo.MapRequest, fc *geo.FeatureCollection) error

func StoreGeoData

func StoreGeoData(ctx context.Context, db bun.DB, gObj *GeoObject) error

Types

type Cluster

type Cluster struct {
	ID          int64                `bun:"tile_id"`
	MinID       int64                `bun:"min_id"`
	Count       int64                `bun:"count"`
	ClusterData []*GeoObject         `bun:"cluster_data"`
	Centroid    *geo.GeographicPoint `bun:"centroid"`
	GeoObject
}

type GeoObject

type GeoObject struct {
	bun.BaseModel `bun:"table:geo_objects"`
	ID            int64                  `bun:"id,pk,autoincrement"`
	QuadKey       int64                  `bun:"quad_key,notnull"`
	Lat           float64                `bun:"lat,notnull"`
	Lon           float64                `bun:"lon,notnull"`
	Properties    map[string]interface{} `bun:"properties"`
	Point         *geo.GeographicPoint   `bun:"point,type:geography(POINT,4326)"`
}

type PostGISDataSource

type PostGISDataSource struct {
	DB *bun.DB
	// contains filtered or unexported fields
}

func NewPostGISDataSource

func NewPostGISDataSource(ctx context.Context, dsn string, gs *geo.GeographicSystem, mapper PropertiesMapper) (*PostGISDataSource, error)

func (*PostGISDataSource) LoadMapView

func (p *PostGISDataSource) LoadMapView(ctx context.Context, mr *geo.MapRequest, fc *geo.FeatureCollection) error

func (*PostGISDataSource) StoreGeoData

func (p *PostGISDataSource) StoreGeoData(ctx context.Context, d interface{}) error

type PropertiesMapper

type PropertiesMapper func(obj *Cluster) map[string]interface{}

Jump to

Keyboard shortcuts

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