splitcombine

package
v0.0.0-...-cb44b2d Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EndZoom = 0
View Source
var StartZoom = 0

Functions

func CombineFileSubFiles

func CombineFileSubFiles(filenames []string)

this is a corner case that continues to come up if splitting a file and the sub file needs to be split again each subfile contains its own subfile that needs to be handled combine all the sub files into one big file then dump meta data into another

func GetSize

func GetSize(filename string) int

gets the size of a given file

func GetSizeGrid

func GetSizeGrid(bb m.Extrema, zoom int) int

getting size of the estimated square grid of tiles

func Intersect

func Intersect(bdsref m.Extrema, bds m.Extrema) bool

returns a boolval for whether or not the bb intersects

func LazyFeatureTileID

func LazyFeatureTileID(bs []byte) m.TileID

this function is intended to be a light weight read of feature bytes with minimal logic / alloc to read the single feature property we need, "TILEID"

func MapGeobuf

func MapGeobuf(filename string, mapfunc TileMap, tileconfig *TileConfig)

a powerful function that maps an entire geobuf into a submapping that can be navigated through geobufs seek api one can effectively view this as a sort with about tiles

func Overlapping_1D

func Overlapping_1D(box1min float64, box1max float64, box2min float64, box2max float64) bool

structure for finding overlapping values

func PushTwoBoundingBoxs

func PushTwoBoundingBoxs(bb1, bb2 m.Extrema) m.Extrema

pushs two bounding box values

func SplitCombineFile

func SplitCombineFile(buf *g.Reader, myfunc func(feature *geojson.Feature) []string)

wrapping all the methods up

func SplitCombineTiles

func SplitCombineTiles(buf *g.Reader, zoom int) *g.Reader

a function to split and combine tiles

Types

type LoggingInitialMap

type LoggingInitialMap struct {
	StartTime time.Time
}

func (*LoggingInitialMap) Log

func (logger *LoggingInitialMap) Log(numberoffeautures int, featurescreated, numberoffiles int, percent_read float64)

logs the number of features and number of files

type Splitter

type Splitter struct {
	Bounds         m.Extrema
	Reader         *g.Reader
	NumberFeatures int
	SplitMap       map[string]*g.Writer
}

this structure allows for easy splitting of tiles

func NewSplitter

func NewSplitter(buf *g.Reader) *Splitter

func (*Splitter) AddBytes

func (splitter *Splitter) AddBytes(key string, bs []byte)

adds a set of bytes representing a features

func (*Splitter) AddFeature

func (splitter *Splitter) AddFeature(key string, feature *geojson.Feature)

adds a single feature to the split map

func (*Splitter) Combine

func (splitter *Splitter) Combine()

combines all hte intermediate files and removes them

func (*Splitter) MapToSubFiles

func (splitter *Splitter) MapToSubFiles(myfunc func(feature *geojson.Feature) []string)

maps a function that generates a key to an entire geobuf file

type TileConfig

type TileConfig struct {
	InPlace        bool      // create new file or replace existing
	Bounds         m.Extrema // expected bounds of the mapping
	Zoom           int
	OutputFileName string // defaults to "new_mapped.geobuf"
	Concurrent     int    // defaults at 1k
}

configuration structure for tile mapping

type TileMap

type TileMap func(feature *geojson.Feature) map[m.TileID]*geojson.Feature

Jump to

Keyboard shortcuts

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