decoding

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 16 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 layer.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 layer.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 layer.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 layer.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 layer.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    layer.PluginID          `json:"plugin"`
	Extension layer.PluginExtensionID `json:"extension"`
	Property  *ReearthProperty        `json:"property"`
}

type ReearthLayer

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

type ReearthPropertyField

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

type ReearthPropertyGroup

type ReearthPropertyGroup map[property.FieldID]*ReearthPropertyField

type ReearthPropertyItem

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

type ReearthRoot

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

func (*ReearthRoot) Result

func (r *ReearthRoot) Result(scene layer.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 layer.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