decoding

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadColor  = errors.New("bad color")
	ErrFieldType = errors.New("incompatible field Type")
)

Functions

func MustCreateProperty

func MustCreateProperty(t string, v interface{}, sceneID id.SceneID, styleItem interface{}, extension string) *property.Property

Types

type CZMLDecoder

type CZMLDecoder struct {
	// contains filtered or unexported fields
}

func NewCZMLDecoder

func NewCZMLDecoder(d *json.Decoder, s id.SceneID) *CZMLDecoder

func (*CZMLDecoder) Decode

func (d *CZMLDecoder) Decode() (Result, error)

type Decoder

type Decoder interface {
	Decode() (Result, error)
}

type GeoJSONDecoder

type GeoJSONDecoder struct {
	// contains filtered or unexported fields
}

func NewGeoJSONDecoder

func NewGeoJSONDecoder(r io.Reader, s id.SceneID) *GeoJSONDecoder

func (*GeoJSONDecoder) Decode

func (d *GeoJSONDecoder) Decode() (Result, error)

type GeoStyle

type GeoStyle struct {
	StrokeColor string  `json:"stroke"`
	StrokeWidth float64 `json:"stroke-width"`
	FillColor   string  `json:"fill"`
}

type KMLDecoder

type KMLDecoder struct {
	// contains filtered or unexported fields
}

func NewKMLDecoder

func NewKMLDecoder(d *xml.Decoder, s id.SceneID) *KMLDecoder

func (*KMLDecoder) Decode

func (d *KMLDecoder) Decode() (Result, error)

type LayerEncodingFormat

type LayerEncodingFormat string
const (
	LayerEncodingFormatKML     LayerEncodingFormat = "kml"
	LayerEncodingFormatCZML    LayerEncodingFormat = "czml"
	LayerEncodingFormatGEOJSON LayerEncodingFormat = "geojson"
	LayerEncodingFormatSHAPE   LayerEncodingFormat = "shape"
	LayerEncodingFormatREEARTH LayerEncodingFormat = "reearth"
)

type ReearthDecoder

type ReearthDecoder struct {
	// contains filtered or unexported fields
}

func NewReearthDecoder

func NewReearthDecoder(d *json.Decoder, scene id.SceneID) *ReearthDecoder

func (*ReearthDecoder) Decode

func (d *ReearthDecoder) Decode() (r Result, err error)

type ReearthInfobox

type ReearthInfobox struct {
	Property *ReearthProperty       `json:"property"`
	Blocks   []*ReearthInfoboxField `json:"blocks"`
}

type ReearthInfoboxField

type ReearthInfoboxField struct {
	Plugin    id.PluginID          `json:"plugin"`
	Extension id.PluginExtensionID `json:"extension"`
	Property  *ReearthProperty     `json:"property"`
}

type ReearthLayer

type ReearthLayer struct {
	Plugin              *id.PluginID          `json:"plugin"`
	Extension           *id.PluginExtensionID `json:"extension"`
	Name                string                `json:"name"`
	Infobox             *ReearthInfobox       `json:"infobox"`
	Property            *ReearthProperty      `json:"property"`
	Layers              []ReearthLayer        `json:"layers"`
	IsVisible           *bool                 `json:"isVisible"`
	LinkedDatasetSchema *id.DatasetSchemaID   `json:"linkedDatasetSchema"`
	LinkedDataset       *id.DatasetID         `json:"linkedDataset"`
}

type ReearthPropertyField

type ReearthPropertyField struct {
	Type  string                 `json:"type"`
	Links []*ReearthPropertyLink `json:"links"`
	Value interface{}            `json:"value"`
}

type ReearthPropertyItem

type ReearthPropertyItem struct {
	Groups []ReearthPropertyGroup `json:"groups"`
	Fields ReearthPropertyGroup   `json:"fields"`
}
type ReearthPropertyLink struct {
	Dataset *id.DatasetID           `json:"dataset"`
	Schema  id.DatasetSchemaID      `json:"schema"`
	Field   id.DatasetSchemaFieldID `json:"field"`
}

type ReearthRoot

type ReearthRoot struct {
	Reearth int             `json:"reearth"`
	Layers  []*ReearthLayer `json:"layers"`
}

func (*ReearthRoot) Result

func (r *ReearthRoot) Result(scene id.SceneID) (result Result, err error)

type Result

type Result struct {
	Root       *layer.IDList
	Layers     layer.Map
	Properties property.Map
}

func (Result) Merge

func (r Result) Merge(r2 Result) Result

func (Result) MergeInitializerResult

func (r Result) MergeInitializerResult(r2 layer.InitializerResult) Result

func (Result) RootLayers

func (r Result) RootLayers() layer.List

func (Result) Validate

func (r Result) Validate() error

type ShapeDecoder

type ShapeDecoder struct {
	// contains filtered or unexported fields
}

func NewShapeDecoder

func NewShapeDecoder(r ShapeReader, s id.SceneID) *ShapeDecoder

func (*ShapeDecoder) Decode

func (shd *ShapeDecoder) Decode() (Result, error)

type ShapeReader

type ShapeReader interface {
	Next() bool
	Shape() (int, shp.Shape)
	Err() error
}

Jump to

Keyboard shortcuts

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