Documentation ¶
Index ¶
- func AddFeatures(geobuf *Writer, feats []string, count int, s time.Time) int
- func BenchmarkRead(filename_geojson string, filename_geobuf string)
- func BenchmarkWrite(filename_geojson string, filename_geobuf string)
- func BoundingBox_GeometryCollection(gs []*geojson.Geometry) []float64
- func BoundingBox_LineStringGeometry(line [][]float64) []float64
- func BoundingBox_MultiLineStringGeometry(multiline [][][]float64) []float64
- func BoundingBox_MultiPointGeometry(pts [][]float64) []float64
- func BoundingBox_MultiPolygonGeometry(multipolygon [][][][]float64) []float64
- func BoundingBox_PointGeometry(pt []float64) []float64
- func BoundingBox_Points(pts [][]float64) []float64
- func BoundingBox_PolygonGeometry(polygon [][][]float64) []float64
- func ConvertGeobuf(infile string, outfile string)
- func ConvertGeojson(infile string, outfile string)
- func EncodeVarint(x uint64) []byte
- func Expand_BoundingBoxs(bboxs [][]float64) []float64
- func GetBoundingBox(g *geojson.Geometry) []float64
- func GetFilesize(filename string) int
- func GetKeys(buf *Reader) ([]string, int)
- func Increment(buf *Reader, increment int) ([]byte, bool)
- func MapGeobuf(infile string, newfile string, mapfunc MapFunc)
- func Push_Two_BoundingBoxs(bb1 []float64, bb2 []float64) []float64
- func ReadBoundingBox(bytevals []byte) []float64
- func ReadFeature(bytevals []byte) *geojson.Feature
- func ReadGeobufCSV(filename string)
- func ReadKeys(bytevals []byte) []string
- func WriteMetaData(meta MetaData) interface{}
- func WriteRow(feature *geojson.Feature, keys []string)
- type Concurrent
- type Geojson_File
- type MapFunc
- type MetaData
- type Reader
- func (reader *Reader) Bytes() []byte
- func (reader *Reader) BytesIndicies() ([]byte, [2]int)
- func (reader *Reader) CheckMetaData()
- func (reader *Reader) Close()
- func (reader *Reader) Feature() *geojson.Feature
- func (reader *Reader) FeatureIndicies() (*geojson.Feature, [2]int)
- func (reader *Reader) Next() bool
- func (reader *Reader) ReadAll() []*geojson.Feature
- func (reader *Reader) ReadIndAppend(inds [2]int) []byte
- func (reader *Reader) ReadIndFeature(inds [2]int) *geojson.Feature
- func (reader *Reader) ReadIndicies(inds [2]int) []byte
- func (reader *Reader) Reset()
- func (reader *Reader) Seek(pos int)
- func (reader *Reader) SubFileBytes(key string) *Reader
- func (reader *Reader) SubFileNext() bool
- func (reader *Reader) SubFileSeek(key string)
- type SubFile
- type Writer
- func (writer *Writer) AddGeobuf(buf *Writer)
- func (writer *Writer) Bytes() []byte
- func (writer *Writer) Close()
- func (writer *Writer) Reader() *Reader
- func (writer *Writer) Write(bytevals []byte)
- func (writer *Writer) WriteFeature(feature *geojson.Feature)
- func (writer *Writer) WriteRaw(bytevals []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFeatures ¶
adds featuers
func BenchmarkRead ¶
func BenchmarkWrite ¶
func BoundingBox_GeometryCollection ¶
func BoundingBox_GeometryCollection(gs []*geojson.Geometry) []float64
Returns a BoundingBox for a geometry collection
func BoundingBox_LineStringGeometry ¶
Returns BoundingBox for a LineString
func BoundingBox_MultiLineStringGeometry ¶
Returns BoundingBox for a MultiLineString
func BoundingBox_MultiPointGeometry ¶
Returns BoundingBox for a MultiPoint
func BoundingBox_MultiPolygonGeometry ¶
Returns BoundingBox for a Polygon
func BoundingBox_PointGeometry ¶
boudning box on a normal point geometry relatively useless
func BoundingBox_Points ¶
BoundingBox implementation as per https://tools.ietf.org/html/rfc7946 BoundingBox syntax: "bbox": [west, south, east, north] BoundingBox defaults "bbox": [-180.0, -90.0, 180.0, 90.0]
func BoundingBox_PolygonGeometry ¶
Returns BoundingBox for a Polygon
func ConvertGeobuf ¶
function used for converting geojson to geobuf
func ConvertGeojson ¶
function used for converting geojson to geobuf
func EncodeVarint ¶
func Expand_BoundingBoxs ¶
this functions takes an array of bounding box objects and pushses them all out
func GetBoundingBox ¶
func GetBoundingBox(g *geojson.Geometry) []float64
retrieves a boundingbox for a given geometry
func GetFilesize ¶
func Push_Two_BoundingBoxs ¶
func ReadFeature ¶
func ReadFeature(bytevals []byte) *geojson.Feature
reads a single feature form bytes
func ReadGeobufCSV ¶
func ReadGeobufCSV(filename string)
func WriteMetaData ¶
func WriteMetaData(meta MetaData) interface{}
reads the metadata from a raw bytes set
Types ¶
type Concurrent ¶
type Concurrent struct { Reader *Reader C chan *geojson.Feature Count int Limit int FeatureCount int }
func NewConcurrent ¶
func NewConcurrent(buf *Reader, limit int) *Concurrent
intiating a new concurrent reader
func (*Concurrent) Feature ¶
func (con *Concurrent) Feature() *geojson.Feature
recieving a feature from a channel
func (*Concurrent) StartProcesses ¶
func (con *Concurrent) StartProcesses()
a start process read concurrently
type Geojson_File ¶
type Geojson_File struct { Features []*geojson.Feature Count int File *os.File Pos int64 Feat_Pos int }
structure used for converting geojson
func (*Geojson_File) ReadChunk ¶
func (geojsonfile *Geojson_File) ReadChunk(size int) []string
reads a chunk of a geojson file
type MetaData ¶
struct for handling metadata
func ReadMetaData ¶
reads the metadata from a raw bytes set
type Reader ¶
type Reader struct { FileBool bool // a boolean for whether its a file or byte buffer Reader *protoscan.ProtobufScanner // underlying protoscan reader Filename string // filename File *os.File // file object Buf []byte // buffer if applicable MetaData MetaData // metadata MetaDataBool bool // metadatabool SubFileEnd int // the end point of a given subfile FeatureCount int // number of features iterated through }
protobuf scanner implementation
func (*Reader) BytesIndicies ¶
alias for the Protobuf() method again more expressive for our use case
func (*Reader) Feature ¶
func (reader *Reader) Feature() *geojson.Feature
alias for the Protobuf() method again more expressive for our use case
func (*Reader) FeatureIndicies ¶
alias for the Protobuf() method again more expressive for our use case
func (*Reader) ReadIndAppend ¶
reads an indicies ready to append
func (*Reader) ReadIndFeature ¶
read feature from an indicies
func (*Reader) ReadIndicies ¶
a simple read of the bytes between two indices in a reader
func (*Reader) Seek ¶
this functions types into the underlying protoscan implementation and reconfigures the protoscan to start reading a certain position
func (*Reader) SubFileBytes ¶
this function takes a subfile map key and reads the entire byte array from the the section fo the file and returns a NEW geobuf reader object
func (*Reader) SubFileNext ¶
alias for the Scan method on reader next is a little more expressive this next specifically pertains to all features within a sub file
func (*Reader) SubFileSeek ¶
this functions seeks a specific key in the filemap if it contains metadata given a key the underlying reader is moved to exact positon where that subfile starts
type Writer ¶
type Writer struct { Filename string Writer *bufio.Writer FileBool bool Buffer *bytes.Buffer File *os.File Bytesvals []byte }
the writer struct
func (*Writer) WriteFeature ¶
func (writer *Writer) WriteFeature(feature *geojson.Feature)
writing feature