convert

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MultiPolygonType = "MultiPolygon"
	PolygonType      = "Polygon"
	FeatureType      = "Feature"
)

Variables

This section is empty.

Functions

func Do

func Do(input *BoundaryFile) (*pb.Locations, error)

func FromLocationPBToGeometryPoly

func FromLocationPBToGeometryPoly(location *pb.Location) []*geometry.Poly

Types

type BoundaryFile

type BoundaryFile struct {
	Type     string         `json:"type"`
	Features []*FeatureItem `json:"features"`
}

func Revert

func Revert(input *pb.Locations) *BoundaryFile

Revert could convert pb define data to GeoJSON format.

type FeatureItem

type FeatureItem struct {
	Geometry   GeometryDefine   `json:"geometry"`
	Properties PropertiesDefine `json:"properties"`
	Type       string           `json:"type"`
}

func RevertItem

func RevertItem(input *pb.Location) *FeatureItem

type GeometryDefine

type GeometryDefine struct {
	Coordinates interface{} `json:"coordinates"`
	Type        string      `json:"type"`
}

type MultiPolygonCoordinates

type MultiPolygonCoordinates []PolygonCoordinates

func FromPbPolygonToGeoMultipolygon

func FromPbPolygonToGeoMultipolygon(pbpoly []*pb.Polygon) MultiPolygonCoordinates

type PolygonCoordinates

type PolygonCoordinates [][][2]float64

type PropertiesDefine

type PropertiesDefine struct {
	Name string `json:"Name"`
}

Jump to

Keyboard shortcuts

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