geo

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Properties map[string]interface{} `json:"properties"`
	Geometry   interface{}            `json:"geometry"`
	Type       Type                   `json:"type"`
}

Feature description

func NewFeature

func NewFeature(geometry interface{}, properties map[string]interface{}) Feature

NewFeature creates a Feature from given geometry and properties

type FeatureCollection

type FeatureCollection struct {
	Type     Type      `json:"type"`
	Features []Feature `json:"features"`
}

FeatureCollection description

func NewFeatureCollection

func NewFeatureCollection(features []Feature) FeatureCollection

NewFeatureCollection creates a FeatureCollection from given features

type Point

type Point struct {
	Type        Type     `json:"type"`
	Coordinates Position `json:"coordinates"`
}

Point description

func NewPoint

func NewPoint(position Position) Point

NewPoint creates a Point from given position

type Position

type Position struct {
	Longitude float64
	Latitude  float64
	Altitude  float64
}

Position description

func NewPosition

func NewPosition(lon, lat, alt float64) Position

NewPosition creates a new position

func (Position) MarshalJSON

func (p Position) MarshalJSON() ([]byte, error)

MarshalJSON marshals the position as an array

func (*Position) UnmarshalJSON

func (p *Position) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON unmarshal Position

type Type

type Type string

Type is a type of GeoJSON Object

const (
	// TypeFeatureCollection as defined in https://datatracker.ietf.org/doc/html/rfc7946#section-1.4
	TypeFeatureCollection Type = "FeatureCollection"
	// TypeFeature as defined in https://datatracker.ietf.org/doc/html/rfc7946#section-1.4
	TypeFeature Type = "Feature"
	// TypePoint as defined in https://datatracker.ietf.org/doc/html/rfc7946#section-1.4
	TypePoint Type = "Point"
)

Jump to

Keyboard shortcuts

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