geo

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 1 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]any `json:"properties"`
	Geometry   any            `json:"geometry"`
	Type       Type           `json:"type"`
}

Feature description

func NewFeature

func NewFeature(geometry any, properties map[string]any) Feature

NewFeature creates a Feature from given geometry and properties

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
}

Position description

func NewPosition

func NewPosition(lon, lat float64) Position

NewPosition creates a new position

func (Position) MarshalJSON

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

MarshalJSON marshals the position as an array

type Type

type Type string

Type is a type of GeoJSON Object

const (
	// 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