indexer

package
v0.0.0-...-e9a8072 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pi               = math.Pi
	TwoPi            = 2 * math.Pi
	DegreesPerRadian = 180.0 / math.Pi
	Epsilon1         = 0.1
	Epsilon12        = 0.000000000001
	Epsilon14        = 0.00000000000001
)
View Source
const (
	AxisX = 0
	AxisY = 1
	AxisZ = 2
)
View Source
const DRACO_EXT = "KHR_draco_mesh_compression" // draco.ExtensionName

Variables

View Source
var (
	Wgs84OneOverRadii = Cartesian3{
		X: 1.0 / 6378137.0,
		Y: 1.0 / 6378137.0,
		Z: 1.0 / 6356752.3142451793,
	}
	Wgs84OneOverRadiiSquared = Cartesian3{
		X: 1.0 / (6378137.0 * 6378137.0),
		Y: 1.0 / (6378137.0 * 6378137.0),
		Z: 1.0 / (6356752.3142451793 * 6356752.3142451793),
	}
	Wgs84CenterToleranceSquared = Epsilon1
)
View Source
var (
	ScaleToGeodeticSurfaceGradient = &Cartesian3{}
)

Functions

func ForEachTile

func ForEachTile(ts *tiles.Tileset, iterFn TileIterFn) error

func Map

func Map(elem []interface{}, f func(interface{}) (float64, error)) ([]float64, error)

func ReadTilesetFeatures

func ReadTilesetFeatures(ctx context.Context, ts *tiles.Tileset, config *Config, fsys FS, debug bool) (map[string]TilesetFeature, error)

func Retry

func Retry(RetriableFunc RetriableFunc) error

Types

type Cartesian3

type Cartesian3 struct {
	X float64
	Y float64
	Z float64
}

type Cartographic

type Cartographic struct {
	Longitude float64
	Latitude  float64
	Height    float64
}

type CesiumRTC

type CesiumRTC struct {
	Center [3]float64
}

type Config

type Config struct {
	IdProperty string           `json:"idProperty"`
	Indexes    map[string]Index `json:"indexes"`
}

type DelayTypeFunc

type DelayTypeFunc func(n uint, err error, config *RetryConfig) time.Duration

type EnumIndex

type EnumIndex struct {
	Kind   string                `json:"kind"`
	Values map[string]*EnumValue `json:"values"`
}

type EnumIndexBuilder

type EnumIndexBuilder struct {
	Property string
	Config   Index
	ValueIds map[string][]Ids
}

func (EnumIndexBuilder) AddIndexValue

func (enumBuilder EnumIndexBuilder) AddIndexValue(dataRowId int, value string)

func (EnumIndexBuilder) GetValueIds

func (enumBuilder EnumIndexBuilder) GetValueIds() *map[string][]Ids

type EnumValue

type EnumValue struct {
	Count int    `json:"count"`
	Url   string `json:"url"`
}

type FS

type FS interface {
	Open(ctx context.Context, name string) (io.ReadCloser, error)
}

type FSFS

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

func NewFSFS

func NewFSFS(f fs.FS) *FSFS

func (*FSFS) Open

func (f *FSFS) Open(ctx context.Context, name string) (io.ReadCloser, error)

type HTTPFS

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

func NewHTTPFS

func NewHTTPFS(c *http.Client, base string) *HTTPFS

func (*HTTPFS) Open

func (f *HTTPFS) Open(ctx context.Context, name string) (io.ReadCloser, error)

type Ids

type Ids struct {
	DataRowId int
}

type Index

type Index struct {
	Kind string `json:"kind"`
}

type IndexBuilder

type IndexBuilder interface {
	AddIndexValue(int, string)
	GetValueIds() *map[string][]Ids
}

type IndexRoot

type IndexRoot struct {
	ResultDataUrl string                 `json:"resultDataUrl"`
	IdProperty    string                 `json:"idProperty"`
	Indexes       map[string]interface{} `json:"indexes"`
}

type Indexer

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

func NewIndexer

func NewIndexer(config *Config, fs FS, output OutputFS, debug bool) *Indexer

func (*Indexer) Build

func (indexer *Indexer) Build(ctx context.Context) (res Result, errMsg error)

func (*Indexer) BuildAndWrite

func (indexer *Indexer) BuildAndWrite(ctx context.Context) error

type NopCloser

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

func NewNopCloser

func NewNopCloser(w io.Writer) *NopCloser

func (*NopCloser) Close

func (n *NopCloser) Close() error

func (*NopCloser) Write

func (n *NopCloser) Write(p []byte) (int, error)

type OSOutputFS

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

func NewOSOutputFS

func NewOSOutputFS(base string) *OSOutputFS

func (*OSOutputFS) Open

func (f *OSOutputFS) Open(ctx context.Context, name string) (w WriteCloser, err error)

type OutputFS

type OutputFS interface {
	Open(ctx context.Context, name string) (WriteCloser, error)
}

type Rectangle

type Rectangle struct {
	West  float64
	South float64
	East  float64
	North float64
}

type Result

type Result struct {
	IndexBuilders []IndexBuilder
	Data          ResultData
}

type ResultData

type ResultData []map[string]string

type RetriableFunc

type RetriableFunc func() error

type RetryConfig

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

type TileIterFn

type TileIterFn func(*tiles.Tile, *mat.Dense) error

type TilesetFeature

type TilesetFeature struct {
	Properties map[string]interface{}
	Position   Cartographic
}

type WriteCloser

type WriteCloser interface {
	io.Writer
	io.Closer
}

type Writer

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

func NewWriter

func NewWriter(config *Config, o OutputFS) *Writer

func (*Writer) Write

func (w *Writer) Write(ctx context.Context, r Result) error

func (*Writer) WriteIndex

func (w *Writer) WriteIndex(ctx context.Context, enumBuilder EnumIndexBuilder, fileId int) (_ *EnumIndex, err error)

func (*Writer) WriteIndexes

func (w *Writer) WriteIndexes(ctx context.Context, indexBuilders []IndexBuilder) (_ map[string]any, err error)

Write indexes using the index builders and returns a IndexRoot.indexes map

func (*Writer) WriteResultsData

func (w *Writer) WriteResultsData(ctx context.Context, data ResultData) (string, error)

Writes the data.csv file and returns its path.

func (*Writer) WriteValueIndex

func (w *Writer) WriteValueIndex(ctx context.Context, fileId int, valueId int, ids []Ids) (*EnumValue, error)

type ZipFS

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

func NewZipFS

func NewZipFS(z *zip.Reader) *ZipFS

func (*ZipFS) Open

func (f *ZipFS) Open(ctx context.Context, name string) (io.ReadCloser, error)

type ZipOutputFS

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

func NewZipOutputFS

func NewZipOutputFS(w *zip.Writer, base string) *ZipOutputFS

func (*ZipOutputFS) Open

func (f *ZipOutputFS) Open(ctx context.Context, name string) (WriteCloser, error)

Jump to

Keyboard shortcuts

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