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 ¶
- Variables
- func GeoDataToCoverCellUnion(gd *GeoData, coverer *s2.RegionCoverer) (s2.CellUnion, error)deprecated
- func GeoDataToGeom(gd *GeoData) (geom.T, error)
- func GeoDataToRect(gd *GeoData) (s2.Rect, error)
- func GeoJSONFeatureToGeoData(f *geojson.Feature, gd *GeoData) error
- func GeomToGeoData(g geom.T, gd *GeoData) error
- func LoopFromCoordinates(c []float64) *s2.Loop
- func LoopFromCoordinatesAndCCW(c []float64, checkCCW bool) *s2.Loop
- func PointsToGeoJSONPolyLines(geos []*GeoData) ([]byte, error)
- func PropertiesToGeoData(f *geojson.Feature, gd *GeoData) error
- func PropertiesToJSONMap(src map[string]*spb.Value) map[string]interface{}
- func ToGeoJSONFeatureCollection(geos []*GeoData) ([]byte, error)
- type GeoData
- func (gd *GeoData) Cover(coverer *s2.RegionCoverer) (s2.CellUnion, error)
- func (*GeoData) Descriptor() ([]byte, []int)
- func (m *GeoData) GetGeometry() *Geometry
- func (m *GeoData) GetProperties() map[string]*google_protobuf.Value
- func (gd *GeoData) InteriorCover(coverer *s2.RegionCoverer) (s2.CellUnion, error)
- func (*GeoData) ProtoMessage()
- func (m *GeoData) Reset()
- func (m *GeoData) String() string
- type Geometry
- type Geometry_Type
Constants ¶
This section is empty.
Variables ¶
var Geometry_Type_name = map[int32]string{
0: "POINT",
1: "POLYGON",
2: "MULTIPOLYGON",
3: "LINESTRING",
}
var Geometry_Type_value = map[string]int32{
"POINT": 0,
"POLYGON": 1,
"MULTIPOLYGON": 2,
"LINESTRING": 3,
}
Functions ¶
func GeoDataToCoverCellUnion
deprecated
func GeoDataToGeom ¶
GeoDataToGeom converts GeoData to a geom.T representation
func GeoDataToRect ¶
GeoDataToRect generate a RectBound for GeoData gd only works with Polygons & LineString
func GeoJSONFeatureToGeoData ¶
GeoJSONFeatureToGeoData fill gd with the GeoJSON data f
func GeomToGeoData ¶
GeomToGeoData update gd with geo data gathered from g
func LoopFromCoordinates ¶
LoopFromCoordinates creates a LoopFence from a list of lng lat
func LoopFromCoordinatesAndCCW ¶
LoopFromCoordinatesAndCCW creates a LoopFence from a list of lng lat if checkCCW is true also try to fix CCW
func PointsToGeoJSONPolyLines ¶
PointsToGeoJSONPolyLines converts a list of GeoData containing points to a polylines GeoJSON
func PropertiesToGeoData ¶
PropertiesToGeoData update gd.Properties with the properties found in f
func PropertiesToJSONMap ¶
PropertiesToJSONMap converts a protobuf map to it's JSON serializable map equivalent
func ToGeoJSONFeatureCollection ¶
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) Descriptor ¶
func (*GeoData) GetGeometry ¶
func (*GeoData) GetProperties ¶
func (m *GeoData) GetProperties() map[string]*google_protobuf.Value
func (*GeoData) InteriorCover ¶
InteriorCover generates an s2 interior cover for GeoData gd
func (*GeoData) ProtoMessage ¶
func (*GeoData) ProtoMessage()
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) GetGeometries ¶
func (*Geometry) ProtoMessage ¶
func (*Geometry) ProtoMessage()
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