geodata

package
v0.0.0-...-f4e3eaa Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package geodata is a generated protocol buffer package.

It is generated from these files:

geodata.proto

It has these top-level messages:

Geometry
GeoData

Index

Constants

This section is empty.

Variables

View Source
var Geometry_Type_name = map[int32]string{
	0: "POINT",
	1: "POLYGON",
	2: "MULTIPOLYGON",
	3: "LINESTRING",
}
View Source
var Geometry_Type_value = map[string]int32{
	"POINT":        0,
	"POLYGON":      1,
	"MULTIPOLYGON": 2,
	"LINESTRING":   3,
}

Functions

func GeoDataToCoverCellUnion deprecated

func GeoDataToCoverCellUnion(gd *GeoData, coverer *s2.RegionCoverer) (s2.CellUnion, error)

Deprecated: use Cover() GeoDataToCoverCellUnion generates an s2 cover for GeoData gd

func GeoDataToGeom

func GeoDataToGeom(gd *GeoData) (geom.T, error)

GeoDataToGeom converts GeoData to a geom.T representation

func GeoDataToRect

func GeoDataToRect(gd *GeoData) (s2.Rect, error)

GeoDataToRect generate a RectBound for GeoData gd only works with Polygons & LineString

func GeoJSONFeatureToGeoData

func GeoJSONFeatureToGeoData(f *geojson.Feature, gd *GeoData) error

GeoJSONFeatureToGeoData fill gd with the GeoJSON data f

func GeomToGeoData

func GeomToGeoData(g geom.T, gd *GeoData) error

GeomToGeoData update gd with geo data gathered from g

func LoopFromCoordinates

func LoopFromCoordinates(c []float64) *s2.Loop

LoopFromCoordinates creates a LoopFence from a list of lng lat

func LoopFromCoordinatesAndCCW

func LoopFromCoordinatesAndCCW(c []float64, checkCCW bool) *s2.Loop

LoopFromCoordinatesAndCCW creates a LoopFence from a list of lng lat if checkCCW is true also try to fix CCW

func PointsToGeoJSONPolyLines

func PointsToGeoJSONPolyLines(geos []*GeoData) ([]byte, error)

PointsToGeoJSONPolyLines converts a list of GeoData containing points to a polylines GeoJSON

func PropertiesToGeoData

func PropertiesToGeoData(f *geojson.Feature, gd *GeoData) error

PropertiesToGeoData update gd.Properties with the properties found in f

func PropertiesToJSONMap

func PropertiesToJSONMap(src map[string]*spb.Value) map[string]interface{}

PropertiesToJSONMap converts a protobuf map to it's JSON serializable map equivalent

func ToGeoJSONFeatureCollection

func ToGeoJSONFeatureCollection(geos []*GeoData) ([]byte, error)

ToGeoJSONFeatureCollection converts a list of GeoData to a GeoJSON Feature Collection

Types

type GeoData

type GeoData struct {
	Geometry   *Geometry                         `protobuf:"bytes,1,opt,name=geometry" json:"geometry,omitempty"`
	Properties map[string]*google_protobuf.Value `` /* 140-byte string literal not displayed */
}

func (*GeoData) Cover

func (gd *GeoData) Cover(coverer *s2.RegionCoverer) (s2.CellUnion, error)

Cover generates an s2 cover for GeoData gd

func (*GeoData) Descriptor

func (*GeoData) Descriptor() ([]byte, []int)

func (*GeoData) GetGeometry

func (m *GeoData) GetGeometry() *Geometry

func (*GeoData) GetProperties

func (m *GeoData) GetProperties() map[string]*google_protobuf.Value

func (*GeoData) InteriorCover

func (gd *GeoData) InteriorCover(coverer *s2.RegionCoverer) (s2.CellUnion, error)

InteriorCover generates an s2 interior cover for GeoData gd

func (*GeoData) ProtoMessage

func (*GeoData) ProtoMessage()

func (*GeoData) Reset

func (m *GeoData) Reset()

func (*GeoData) String

func (m *GeoData) String() string

type Geometry

type Geometry struct {
	Type        Geometry_Type `protobuf:"varint,1,opt,name=type,enum=geodata.Geometry_Type" json:"type,omitempty"`
	Geometries  []*Geometry   `protobuf:"bytes,2,rep,name=geometries" json:"geometries,omitempty"`
	Coordinates []float64     `protobuf:"fixed64,3,rep,packed,name=coordinates" json:"coordinates,omitempty"`
}

func (*Geometry) Descriptor

func (*Geometry) Descriptor() ([]byte, []int)

func (*Geometry) GetGeometries

func (m *Geometry) GetGeometries() []*Geometry

func (*Geometry) ProtoMessage

func (*Geometry) ProtoMessage()

func (*Geometry) Reset

func (m *Geometry) Reset()

func (*Geometry) String

func (m *Geometry) String() string

type Geometry_Type

type Geometry_Type int32
const (
	Geometry_POINT        Geometry_Type = 0
	Geometry_POLYGON      Geometry_Type = 1
	Geometry_MULTIPOLYGON Geometry_Type = 2
	Geometry_LINESTRING   Geometry_Type = 3
)

func (Geometry_Type) EnumDescriptor

func (Geometry_Type) EnumDescriptor() ([]byte, []int)

func (Geometry_Type) String

func (x Geometry_Type) String() string

Jump to

Keyboard shortcuts

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